swat command help
#5

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


Messages In This Thread
swat command help - by Tommy_Mandaz - 30.06.2009, 00:07
Re: swat command help - by Grim_ - 30.06.2009, 00:13
Re: swat command help - by Tommy_Mandaz - 30.06.2009, 00:38
Re: swat command help - by Grim_ - 30.06.2009, 00:42
Re: swat command help - by Brendan_Thomson - 01.07.2009, 03:09

Forum Jump:


Users browsing this thread: 3 Guest(s)