10.09.2013, 12:56
I haven't coded in a while and I've became very rusty even making the most basic of scripts. This script returns no errors on Pawn but in-game, it allows me to go on duty if I'm pPD 1, but it puts me on duty no matter where I am, but also returns the error: "ERROR: Unknown command".
The below is the relevant code, I think I've only made a minor mistake. I seem to remember coding this successfully before but I've forgotten how to properly do it.
I've tried many combinations but to no avail.
Any help would be appreciated.
Thanks.
The below is the relevant code, I think I've only made a minor mistake. I seem to remember coding this successfully before but I've forgotten how to properly do it.
pawn Код:
if (strcmp("/duty", cmdtext, true, 5) == 0)
{
if(PlayerInfo[playerid][pPD] < 1)
return SendClientMessage(playerid, COLOR_ERROR,"ERROR.");
if(IsPlayerInRangeOfPoint(playerid, 5.0,-2500.2500,250.2500,5.2500))
SendClientMessage(playerid, COLOR_ERROR,"ERROR.");
else
SendClientMessage(playerid, COLOR_WHITE, "Police duty");
SetPlayerHealth(playerid, 100.100);
SetPlayerArmour(playerid, 100.100);
SetPlayerColor(playerid, COLOR_WHITE);
return 0;
}
Any help would be appreciated.
Thanks.