Timer.
#1

Hello im tried to put timer 10secdons for Begin arrested but not worked Why? i've add this

At the command i add this

PHP код:
TimerArrest[targetid] = SetTimerEx("BeginArrestedTimer"10000false,"ui"targetid); // 10 Secdons timer
                
BeginArrested[targetid] = 1;
                
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                 
SetPlayerAttachedObject(targetid7194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                
ShowDescriptionText(targetidstring);
                
format(stringsizeof(string), "[BEING ARRESTED]: {FFFFFF}Law Enforcement Officer %s(%d) has put {ADFF2F}Handcuffs {FFFFFF}on you."pNameplayerid);
                
format(stringsizeof(string), "[BEING ARRESTED]: {FFFFFF}Use {0080FF}/breakcuffs (/bc) {FFFFFF}to attempt to evade the Arrest."pNameplayerid);
                
SendClientMessage(targetidbluestring);
                
SendClientMessage(targetidbluestring); 
Код:
public BeginArrestedTimer(playerid)
{
	if(BeginArrested[playerid] == 1)
	{
 		new pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid;
 		GetPlayerName(playerid, pName, sizeof(pName));
		GetPlayerName(targetid, tName, sizeof(tName));
		KillTimer(TimerArrest[targetid]);
		new Random = random(sizeof(RandomJailSpawns));
  		SetPlayerPos(targetid, RandomJailSpawns[Random][0], RandomJailSpawns[Random][1], RandomJailSpawns[Random][2]);
    	SetPlayerFacingAngle(targetid, RandomJailSpawns[Random][0]);

	}
	return 1;
}
But its not worked why?
Reply
#2

TimerArrest[targetid] = SetTimerEx("BeginArrestedTimer", 10000, false,"ui", targetid);

Why do you have "ui"? you need i only.

try this:
pawn Код:
TimerArrest[targetid] = SetTimerEx("BeginArrestedTimer", 10000, false,"i", targetid);
Reply
#3

I changed it but when I type /ar my friend they not giving Me timer for begin arrest How to fix it.....


Full code:

PHP код:
if(GetPlayerWantedLevel(targetid) >= 4)
            {
                new 
ArrestReward random(50000) + 5000;
                  if(
ArrestReward GetPlayerCash(playerid))
                  
                  
                  
TimerArrest[targetid] = SetTimerEx("BeginArrestedTimer"10000false,"i"targetid); // 10 Secdons timer
                
BeginArrested[targetid] = 0;
                
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                 
SetPlayerAttachedObject(targetid7194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                
format(string1sizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}Law Enforcement Officer %s(%d) has put {ADFF2F}Handcuffs {FFFFFF}on you."pNameplayerid);
                
format(string2sizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}Use {0080FF}/breakcuffs (/bc) {FFFFFF}to attempt to evade the Arrest."pNameplayerid);
                
SendClientMessage(targetidbluestring);
                
SendClientMessage(targetidbluestring);
                
format(stringsizeof(string), "You have placed {0080FF}%s(%d) {FFFFFF}in Handcuffs for an Arrest. Use {0080FF}/search (id) {FFFFFF}to search Him for illegal Drugs."tNametargetid);
                
SendClientMessage(playeridredstring);
                
                
                
format(stringsizeof(string), "{ffffff}You have Arrested {FFD700}%s(%d){FFFFFF}. You have received {33FF33}$%d {FFFFFF}for this Arrest."tNametargetidArrestReward);
                
SendClientMessage(playeridredstring);
                
ShowDescriptionText(playeridstring);
                new 
current_zone player_zone[targetid];
                
format(stringsizeof(string), "{FFD700}%s(%d) {FFFFFF}has been {33CCFF}Arrested {FFFFFF}by {308AFF}Officer %s(%d){FFFFFF}! Location: %s"tNametargetidpNameplayerid,zones[current_zone][zone_name]);
                
SendClientMessageToAll(yellowstring);
                
format(stringsizeof(string), "~w~You have ~G~Arrested ~Y~%s(%d)~n~n~You have received ~g~$%d ~w~for this Arrest."tNametargetidArrestReward);
                
GameTextForPlayer(playeridstring70005);
                
GivePlayerMoney(playeridArrestReward);
                
SetPlayerScore(playeridGetPlayerScore(playerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(targetid)-1);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 20 random(41);
                new 
Random random(sizeof(RandomJailSpawns));
                
SetPlayerPos(targetidRandomJailSpawns[Random][0], RandomJailSpawns[Random][1], RandomJailSpawns[Random][2]);
                
SetPlayerFacingAngle(targetidRandomJailSpawns[Random][0]);
                
ResetPlayerWeapons(targetid);
                
SetPlayerInterior(targetid10);
                
SetPlayerWantedLevel(targetid,0);
                
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                for(new 
i=0;i<MAX_PLAYERS;i++)
                {
                if(!
IsPlayerConnected(i))continue;
                if(
gTeam[i] == TEAM_COP)
                {
                new 
copmsg[170];
                
format(copmsgsizeof(copmsg), "%s (%d) has arrested %s (%d)",pName,playerid,tName,targetid);
                
SendClientMessage(iCOLOR_BLUEcopmsg);
                }
              }
            }
        }
    return 
1;

Reply
#4

anyone.
Reply
#5

Don't bump your topic within 24 hours, you even did it within 20 minutes.

Also:

pawn Код:
BeginArrested[targetid] = 0;
Change that 0 into a 1, as you need it to be 1 in the next part
Reply
#6

Quote:
Originally Posted by thegamer355
Посмотреть сообщение
Don't bump your topic within 24 hours, you even did it within 20 minutes.

Also:

pawn Код:
BeginArrested[targetid] = 0;
Change that 0 into a 1, as you need it to be 1 in the next part
ok sir i'll change it to 1 But can i ask a question? Now if i want to arrest someone they will give the player 10 secdons for /bc But after 10secdons he will goto jail?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)