16.08.2011, 10:24
You've never had problems with this timer but have you tested it with more than one person? Reality is that it'll only work for ID 0 and when it's called again by another player it'll actually just run for ID 0 too, so ID 0 will have several timers.
I really don't know why people don't understand this, it's very simple:
Using this timer:
Will cause the print to output: The player 0 is driving vehicle 0, this is because you are not passing any data to the callback like it is expecting, so instead it defaults those variables to 0, which is logical and makes sense.
This will print: The player 24 is driving vehicle 50, this is because you have actually passed the information that the callback is expecting and it has assigned it to the variables as intended.
Doesn't that make sense to you? If it doesn't I highly suggest starting back at the beginning with the PAWN manuals over at CompuPhase which will teach you basic programming logic.
I really don't know why people don't understand this, it's very simple:
pawn Код:
public function(playerid, vehicleid)
{
printf("The player %d is driving vehicle %d", playerid, vehicleid);
return 1;
}
pawn Код:
SetTimer("function", 1000, 0);
pawn Код:
SetTimerEx("function", 1000, "ii", 24, 50);
Doesn't that make sense to you? If it doesn't I highly suggest starting back at the beginning with the PAWN manuals over at CompuPhase which will teach you basic programming logic.