11.10.2013, 21:37
Quote:
Just read over it, looks fine, I just dont know why you compare "zone_name" like integers
The problem with the enum was that if you set an value in the enum it is the index, means that all constants of the enum pointed to the index 0, thus changing all Could you tell me what exactly isnt working with the command anymore? Do you get the Unknown command response, did you checked any case with the crash dedect plugin ? If no way works use prints till you find the line where the code stops |
Code that doesn't work
pawn Код:
if(IsPlayerInDynamicCP(playerid, rCheckpoints[7]))
{
if(zones[current_zone][zone_name] >= zones[93][zone_name] && zones[current_zone][zone_name] <= zones[95][zone_name]) //Espelanade East Tatoo Shop
{
if(RobbedRecently[TatooRobbedRecently] >= 1) return SendClientMessage(playerid, COLOR_RED, "Error"COL_WHITE": This shop/store has been robbed recently, please try again later!");
Robbing[playerid][RobbingTatoo] = 20;
RobbedRecently[TatooRobbedRecently] = 300;
format(string,sizeof(string),"[DISPATCH]"COL_GREY": There's a robbery in progress! Suspect: %s | Shop Name: Tatoo Shop | Shop Location: %s",PlayerName(playerid), playerid, GetZoneName(playerid));
SendLEOMessage(string);
TextDrawShowForPlayer(playerid, RobberyTD[playerid]);
SetPlayerAttachedObject(playerid, 1, 1550, 1, 0.1, -0.2, 0, 0, 90, 0.5, 0.8, 0.8, 0.8);
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 3.0, 0, 0, 0, 0, 0, 1);
}
}
pawn Код:
if(IsPlayerInDynamicCP(playerid, rCheckpoints[7]))
{
if(zones[current_zone][zone_name] == zones[93][zone_name] || zones[current_zone][zone_name] == zones[94][zone_name] ||
zones[current_zone][zone_name] == zones[95][zone_name]) //Espelanade East Tatoo Shop
{
if(RobbedRecently[TatooRobbedRecently] >= 1) return SendClientMessage(playerid, COLOR_RED, "Error"COL_WHITE": This shop/store has been robbed recently, please try again later!");
Robbing[playerid][RobbingTatoo] = 20;
RobbedRecently[TatooRobbedRecently] = 300;
format(string,sizeof(string),"[DISPATCH]"COL_GREY": There's a robbery in progress! Suspect: %s | Shop Name: Tatoo Shop | Shop Location: %s",PlayerName(playerid), playerid, GetZoneName(playerid));
SendLEOMessage(string);
TextDrawShowForPlayer(playerid, RobberyTD[playerid]);
SetPlayerAttachedObject(playerid, 1, 1550, 1, 0.1, -0.2, 0, 0, 90, 0.5, 0.8, 0.8, 0.8);
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 3.0, 0, 0, 0, 0, 0, 1);
}
}
I'm just making my code shorter
using >= 93 and 95 <= instead of == 93 or == 94 or == 95