swat command help
#2

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);
   }
  }
}
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)