[Include] samp-player-gangzones | Per player gangzones

Started by SA:MP, May 10, 2023, 02:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RobertCow

Идеи для рукоделия https://sweaterok.com.ua мастер-классы, инструкции и вдохновение для создания уникальных изделий. Узнайте больше о шитье, вязании, вышивке и других видах творчества!

RobertCow

Идеи для рукоделия https://sweaterok.com.ua мастер-классы, инструкции и вдохновение для создания уникальных изделий. Узнайте больше о шитье, вязании, вышивке и других видах творчества!

SA:MP

[Include] samp-player-gangzones | Per player gangzones

samp-player-gangzones



About



Creating per player gangzones to avoid normal (global) samp gangzones limit (1024). Uses Pawn.RakNet to send RPCs.

PS: Yes. I know test.pwn file isn't actually a unit test script. You need to go in game and use those commands. sorry!



NOTE: Client has a limit itself, and it's 1024 so you can not have more than that; This include is only for avoiding global gangzones limits (you can only create 1024 global gangzones on server-side, but now 1024 for each player with this include that uses only client-side slots) (credits to J0sh... cause I thought game has a limit for drawing gangzones)







Installation



Simply install to your project:




Код:

sampctl package install AmyrAhmady/samp-player-gangzones

Include in your code and begin using the library:




Код:

#include <samp-player-gangzones>

Functions




Код:

PlayerGangZoneCreate(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy);
PlayerGangZoneDestroy(playerid, gangzoneid);
PlayerGangZoneShow(playerid, gangzoneid, color = PLAYER_GZ_DEFAULT_COLOR);
PlayerGangZoneHide(playerid, gangzoneid);

Testing



To test, simply run the package:




Код:

sampctl package run

and use these commands in game:




Код:

/gzcreate
/gzshow
/gzhide
/gzdelete

Todo



Flash and some new gangzone related functions (i.e: IsPlayerInPlayerGangZone)

Get rid of pawn and make a plugin for it for better performance



For non-sampctl-users:



Just go to its repository and use samp-player-gangzones.inc file, there's test.pwn for... well.. test script?



Github link:



(I assume you couldn't find it in top of this post, so I'm just gonna put it here again)

https://github.com/AmyrAhmady/samp-player-gangzones

Source: [Include] samp-player-gangzones | Per player gangzones