SA-MP Forums Archive
Question about SetTimerEx - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question about SetTimerEx (/showthread.php?tid=211256)



Question about SetTimerEx - Antonio [G-RP] - 14.01.2011

I had a question about SetTimerEx.

I have a function, but it contains "playerid, vehicleid".

I'm not 100% sure how to put it in, just wondering if this is right?

pawn Код:
SetTimerEx("FunctionName", 10000, 0, "ii", playerid, vehicleid);
Feedback is greatly appreciated. Thankyou


Re: Question about SetTimerEx - cessil - 14.01.2011

looks right


Re: Question about SetTimerEx - ғαιιοцт - 14.01.2011

Yes, it's correct.
Also make sure that ou forward the function with the same parameters. (same amount and same type of parameters, but they don't need to have the same name)

For example, you could have this code:
Код:
forward StickPlayerOnVehicle(playerid, vehicleid)

//somewhere inside another function:
    new vehid = GetPlayerVehicleId(playerid);
    SetVehicleColor(vehid, 8, 5);
    SetTimerEx("StickPlayerToVehicle", 1000, 0, "ii", playerid, vehid);
vehicleid and vehid isn't the same, but we have the same amount of parameters, and they are both integers so it'll work without any problems


Re: Question about SetTimerEx - Antonio [G-RP] - 14.01.2011

Quote:
Originally Posted by ғαιιοцт
Посмотреть сообщение
Yes, it's correct.
Also make sure that ou forward the function with the same parameters. (same amount and same type of parameters, but they don't need to have the same name)

For example, you could have this code:
Код:
forward StickPlayerOnVehicle(playerid, vehicleid)

//somewhere inside another function:
    new vehid = GetPlayerVehicleId(playerid);
    SetVehicleColor(vehid, 8, 5);
    SetTimerEx("StickPlayerToVehicle", 1000, 0, "ii", playerid, vehid);
vehicleid and vehid isn't the same, but we have the same amount of parameters, and they are both integers so it'll work without any problems
Thanks for the extra info lol. I'm not that much of a noob, but thanks.


Re: Question about SetTimerEx - ғαιιοцт - 14.01.2011

Oh ok haha sorry


Re: Question about SetTimerEx - Antonio [G-RP] - 15.01.2011

Quote:
Originally Posted by ғαιιοцт
Посмотреть сообщение
Oh ok haha sorry
No problem