Okay, looking at what you asked for, I believe Swift_ Got a bit confused.
pawn Код:
//top of script
new IsSwat[MAX_PLAYERS];
forward IsAtLockers(playerid);
//OnGameModeInIt()
SetTimer("IsAtLockers", 1000, 1);
//OnPlayerCommandText(playerid, cmdtext[])
if(strcmp(cmdtext, "/swat", true) == 0)
{
if(IsAtLockers(playerid))
{
SetPlayerSkin(playerid, 285);
GivePlayerWeapon(playerid, 29, 600);
GivePlayerWeapon(playerid, 31, 500);
SetPlayerHealth(playerid, 100);
IsSwat[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOUR, " You are not at the lockers!");
return 1;
}
}
//somewhere in script after main()
public IsAtLockers(playerid)
{
if(PlayerToPoint(3, playerid, X, Y, Z))
{
return 1;
}
return 0;
}
^ just a modified version of what swift_ did.
You could also just get rid of the whole callback and just add the PlayerToPoint to the command, but if you want to check if they are at the lockers in other commands this is easier.