Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- zGangZones.
- Include: zGangZones include - 2014
- Versión: v0.1.1
- By: Zume-Zero
- Functionss.
- - v0.1.0 -
- * PlayerOnGangZone
- * CreateGangZone
- * DestroyGangZone
- - v0.1.1 -
- * ShowGangZoneToPlayer
- * SetGangZoneColorForAll
- * ShowGangZoneForAll
- */
- #include <a_samp>
- #if defined _zGangZones_included
- #endinput
- #endif
- #define _zGangZones_included
- enum gZonas
- {
- gID,
- bool:gCreated,
- Float:gminx,
- Float:gminy,
- Float:gmaxx,
- Float:gmaxy,
- gColor
- };
- static
- gInfo[MAX_GANG_ZONES][gZonas];
- forward zGangZone:CreateGangZone(Float:minx, Float:miny, Float:maxx, Float:maxy, color);
- forward DestroyGangZone(gIDe);
- forward ShowGangZoneToPlayer(playerid, zGangZone:ID);
- forward PlayerOnGangZone(playerid, zGangZone:ID);
- forward SetGangZoneColorForAll(zGangZone:ID, color);
- forward ShowGangZoneForAll(zGangZone:ID);
- public zGangZone:CreateGangZone(Float:minx, Float:miny, Float:maxx, Float:maxy, color)
- {
- new IDg;
- for(IDg = 0; IDg < MAX_GANG_ZONES; ++IDg)
- {
- if(gInfo[IDg][gCreated] == false)
- {
- gInfo[IDg][gID] = IDg;
- break;
- }
- }
- new zId = gInfo[IDg][gID];
- gInfo[zId][gCreated] = true;
- gInfo[zId][gminx] = minx;
- gInfo[zId][gminy] = miny;
- gInfo[zId][gmaxx] = maxx;
- gInfo[zId][gmaxy] = maxy;
- gInfo[zId][gColor] = color;
- gInfo[zId][gID] = GangZoneCreate(gInfo[zId][gminx], gInfo[zId][gminy], gInfo[zId][gmaxx], gInfo[zId][gmaxy]);
- return zGangZone:IDg;
- }
- public PlayerOnGangZone(playerid, zGangZone:ID)
- {
- if(playerid != INVALID_PLAYER_ID)
- {
- new Float:
- POS[3];
- if(gInfo[ID][gCreated] == true)
- {
- GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
- return (POS[0] > gInfo[ID][gminx] && POS[0] < gInfo[ID][gmaxx] && POS[1] > gInfo[ID][gminy] && POS[1] < gInfo[ID][gmaxy]);
- }
- }
- return 1;
- }
- public SetGangZoneColorForAll(zGangZone:ID, color)
- {
- if(gInfo[ID][gCreated] == true)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- gInfo[ID][gColor] = color;
- GangZoneShowForPlayer(i, ID, gInfo[ID][gColor]);
- }
- }
- return 1;
- }
- public DestroyGangZone(gIDe)
- {
- if(gInfo[gIDe][gCreated] == false) return 0;
- gInfo[gIDe][gCreated] = false;
- GangZoneDestroy(gIDe);
- return 0;
- }
- public ShowGangZoneForAll(zGangZone:ID)
- {
- if(gInfo[ID][gCreated] == true)
- {
- return GangZoneShowForAll(ID, gInfo[ID][gColor]);
- }
- return 1;
- }
- public ShowGangZoneToPlayer(playerid, zGangZone:ID)
- {
- if(playerid != INVALID_PLAYER_ID)
- {
- if(gInfo[ID][gCreated] == true)
- {
- return GangZoneShowForPlayer(playerid, ID, gInfo[ID][gColor]);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement