02.02.2011, 12:32
(
Последний раз редактировалось !Phoenix!; 02.02.2011 в 13:07.
Причина: Changed "code" tags to "pawn" tags
)
pawn Код:
if(strcmp(cmd, "/searchgun", true) == 0)
{
SetTimer("searchgun", 300000,false); //searchgun will be called in 5 minutes! (Player gets the weapon in 5 min)
}
//-------------------------------------
public searchgun()
{
SendClientMessage(playerid,YELLOW,"you have found a gun / ammo");
GivePlayerWeapon(playerid,22,100);
}
} //Only one bracked is open!
pawn Код:
if(strcmp(cmd, "/searchgun", true) == 0)
{
if(PlayerVar[playerid][searchedgun] == 0) //Check if he used the command less than 5 minutes ago
{
SendClientMessage(playerid,YELLOW,"you have found a gun / ammo");
GivePlayerWeapon(playerid,22,100);
SetTimerEx("searchgun", 300000, false, "i", playerid); //Use SetTimerEx to pass the playerid
PlayerVar[playerid][searchedgun] = 1; //Set that he used the command
}
else SendClientMessage(playerid,YELLOW,"you have to wait 5 minutes until you can use this command again");
}
//-------------------------------------
public searchgun(playerid)
{
PlayerVar[playerid][searchedgun] = 0; //Reset the variable after 5 minutes
}