30.06.2009, 00:13
Untested
pawn Код:
//top of script
new IsSwat[MAX_PLAYERS];
forward IsAtLockers();
//OnGameModeInIt()
SetTimer("IsAtLockers", 1000, 1);
//OnPlayerCommandText(playerid, cmdtext[])
if(strcmp(cmdtext, "/swat", true) == 0)
{
SetPlayerSkin(playerid, 285);
GivePlayerWeapon(playerid, 29, 600);
GivePlayerWeapon(playerid, 31, 500);
IsSwat[playerid] = 1;
return 1;
}
//somewhere in script after main()
public IsAtLockers()
{
for(new i = 0; i<GetMaxPlayers(); i++)
{
if(PlayerToPoint(3, playerid, X, Y, Z) && IsSwat[i] == 1) //replace X Y Z with the coordinates of the lockers
{
SetPlayerHealth(i, 100);
}
}
}