SA-MP Forums Archive
How can I? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can I? (/showthread.php?tid=583731)



How can I? - TheRaGeLord - 30.07.2015

How Can i pass multiple params to a function through SetTimerEx

This isn't working

PHP код:
stock arrest(playeridtime)
{
    
TogglePlayerControllable(playeridtrue);
    new 
oldskin GetPlayerSkin(playerid);
    
Player[playerid][jailed]=1;
    
Player[playerid][cuffed]=0;
    
SetPlayerSpecialAction(playerid0);
    new 
skin;
    new 
num=random(2);
    switch(
num)
    {
        case 
0skin=62;
        case 
1skin=50;
        case 
2skin=134;
    }
    
SetPlayerSkin(playerid,skin);
    
SetPlayerInterior(playerid,10);
    
SetPlayerPos(playerid,223.27516109.368531000.06482);
    
SetTimerEx("releasejail",time*60*1000,false,"dd",{playerid,oldskin});
    return 
1;
}
forward releasejail(playerid,oldskin);
public 
releasejail(playerid,oldskin)
{
    
SetPlayerSkin(playeridoldskin);
    return 
1;

It is giving error "error 008: must be a constant expression; assumed zero" at the Timer Line


Re: How can I? - Dan. - 30.07.2015

Why are you putting the parameters inside brackets? Just:

pawn Код:
SetTimerEx("releasejail",time*60*1000,false,"dd", playerid,oldskin);