SA-MP Forums Archive
Deletezone... Help please. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Deletezone... Help please. (/showthread.php?tid=119938)



Deletezone... Help please. - introzen - 10.01.2010

I've got this:

pawn Код:
if(listitem == 3) // OnDialog...Blablabla.
{
new File[64];
new area = GetAreaID(playerid);
if(area == -255) return SendClientMessage(playerid,COLOR_DARKRED,".: Info: You're not inside a zone :.");
format(File,64,"/Zones/%d",area);
dini_Remove(File);
GangZoneHideForAll(AreaInfo[area][aZone]);
GangZoneDestroy(AreaInfo[area][aZone]);
SendClientMessage(playerid,COLOR_GREENLIGHT,".: Info: Zone deleted :.");
return 1;
}


stock GetAreaID(playerid) //Bottom of script
{
    for(new a=0; a<=MAX_AREAS; a++)
    {
        if(IsPlayerInArea(playerid, AreaInfo[a][aMaxX], AreaInfo[a][aMinX], AreaInfo[a][aMaxY], AreaInfo[a][aMinY])) return a;
    }
    return -255;
}
But when Listitem 3 is called, nothing happends.


What is this because of?


Re: Deletezone... Help please. - Donny_k - 10.01.2010

Use print debugs to find what is happening, it could be your path, custom area function, invalid index for the zone, escape characters (// not /) lots of things really so print the values out "printf( "Area was %d", area );", add things like that all over the code.


Re: Deletezone... Help please. - introzen - 10.01.2010

Quote:
Originally Posted by Donny
Use print debugs to find what is happening, it could be your path, custom area function, invalid index for the zone, escape characters (// not /) lots of things really so print the values out "printf( "Area was %d", area );", add things like that all over the code.
I printed a number after each step and the prints stopped at the line:

pawn Код:
if(area == -255) return SendClientMessage(playerid,COLOR_DARKRED,".: Info: You're not inside a zone :.");



Re: Deletezone... Help please. - introzen - 10.01.2010

Bump... I need help please... Is there someone?


Re: Deletezone... Help please. - Donny_k - 10.01.2010

Quote:
Originally Posted by IntrozeN
I printed a number after each step and the prints stopped at the line:

pawn Код:
if(area == -255) return SendClientMessage(playerid,COLOR_DARKRED,".: Info: You're not inside a zone :.");
Well this means your return value from "GetAreaID(playerid)" was -255, the return is kicking in and it only happens if the statement is true (== -255) so that's where your issue is, debug that function (post it also if you like).


Re: Deletezone... Help please. - introzen - 10.01.2010

But why do I not get the Client Message?