Help me (Dominate Gangzones) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me (Dominate Gangzones) (
/showthread.php?tid=630908)
Help me (Dominate Gangzones) -
PuYi - 19.03.2017
I want the server to recognize the TR as a Gangzone this way:
new GZGanton[2];
GZGanton[1] = GangZoneCreate(2222.50,-1852.80,2632.80,-1722.30);
GZGanton[2] = GangZoneCreate(2222.50,-1722.30,2632.80,-1628.50);
Example: I write '/do' into the 'GZganton' and I will dominate this gangzone... not the gangzone in territorios\TR_%s.ini
Command to dominate a 'territorio'
http://pastebin.com/uB5zGYw1
Код:
stock CreateTr(Float:minx, Float:miny, Float:maxx, Float:maxy, trname[])
{
new string[128];
for(new tr; tr != MAX_TERRITORIOS; tr++)
{
if(!trLS[tr][trCreated])
{
format(string, sizeof string, "Territorios/TR_%d.ini", tr);
if(!DOF2_FileExists(string))
{
trLS[tr][trminX] = minx;
trLS[tr][trminY] = miny;
trLS[tr][trmaxX] = maxx;
trLS[tr][trmaxY] = maxy;
format(trLS[tr][trName], 128, trname);
trLS[tr][trDono] = 0;
trLS[tr][trColor] = 0xAAAAAAAA;
trLS[tr][trCreated] = true;
trLS[tr][trGZ] = GangZoneCreate(trLS[tr][trminX], trLS[tr][trminY], trLS[tr][trmaxX], trLS[tr][trmaxY]);
trLS[tr][trArea] = CreateDynamicRectangle(trLS[tr][trminX], trLS[tr][trminY], trLS[tr][trmaxX], trLS[tr][trmaxY]);
GangZoneShowForAll(trLS[tr][trGZ], trLS[tr][trColor]);
DOF2_CreateFile(string);
TrSave(tr);
return 1;
}
}
}
return 1;
}
stock DestroyTr(trid)
{
new string[128];
if(trLS[trid][trCreated])
{
format(string, sizeof string, "Territorios/TR_%d.ini", trid);
if(DOF2_FileExists(string))
{
trLS[trid][trCreated] = false;
GangZoneDestroy(trLS[trid][trGZ]);
DestroyDynamicArea(trLS[trid][trArea]);
DOF2_RemoveFile(string);
}
}
return 1;
}