Deletezone... Help please.
#1

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?
Reply
#2

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.
Reply
#3

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 :.");
Reply
#4

Bump... I need help please... Is there someone?
Reply
#5

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).
Reply
#6

But why do I not get the Client Message?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)