11.03.2009, 16:57
I got this command:
How do i set this timer "UnTaze" for "id" and not for "playerid" ?? Please help =)
pawn Код:
public UnTaze(playerid)
{
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,COLOR_PURPLE,"Taze is over, you can move again");
ClearAnimations(playerid);
}
dcmd_taze(playerid,params[])
{
if(PlayerInfo[playerid][pMember] != 1) return 1;
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /taze <playerid/partofname>");
if(GetDistanceBetweenPlayers(id,playerid) > 7) return SendClientMessage(playerid,COLOR_DARKRED,"Too far away");
if(PlayerInfo[id][pCuffed] != 0) return SendClientMessage(playerid,COLOR_DARKRED,"Player already in custody");
if(PlayerInfo[id][pMember] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Can't Taze a cop");
if(id == playerid) return SendClientMessage(playerid,COLOR_DARKRED,"Can't taze yourself");
TogglePlayerControllable(id,false);
SetTimer("UnTaze",1000*30,0);
new string[256],pName[MAX_PLAYER_NAME],idName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,idName,sizeof(idName));
GameTextForPlayer(id,"~r~Tazed!",3000,4);
ApplyAnimation(id,"CRACK","crckdeth2",4.1,1,1,1,1,0);
format(string,sizeof(string),"%s aims with his tazer on %s and shoots",pName,idName);
ProxDetector(25.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}