SetTimer(PLAYERID,"name",interval,0); This possible??
#1

I got this command:

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;
    }
How do i set this timer "UnTaze" for "id" and not for "playerid" ?? Please help =)
Reply
#2

Use SetTimerEx.
Reply
#3

Nah, you can do it only with SetTimerEx.
pawn Код:
SetTimerEx("untaze",1000*30,0,"d",playerid);
Reply
#4

Meanace, its good if you post links to the wiki. (Just a friendly suggestion)

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply


Forum Jump:


Users browsing this thread: