Question about SetTimerEx
#1

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
Reply
#2

looks right
Reply
#3

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
Reply
#4

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.
Reply
#5

Oh ok haha sorry
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)