SA-MP Forums

SA-MP Forums (
-   Help Archive (
-   -   Timer problem (

lukas567 24/08/2011 08:00 AM

Timer problem
Hey guys!

I have a problem...

When I and my friend join to server, timers don't work... It have to Set other Camera Pos but don't work.
But when I join to server alone, it works...

Help me!!!


        TextDrawShowForPlayer(playerid, Text:Line1);
        TextDrawShowForPlayer(playerid, Text:Line2);
        SetTimer("lines", 15000, false);
        SetTimer("camera", 5000, false);
        SetPlayerAttachedObject(playerid, 3, 1550, 1, 0.1, -0.3, 0, 0, 40, 0, 1, 1, 1);


forward camera(playerid);
public camera(playerid)
SetTimer("camera2", 5000, false);
return 1;
forward lines(playerid);
public lines(playerid)
TextDrawHideForPlayer(playerid, Text:Line1);
TextDrawHideForPlayer(playerid, Text:Line2);
return 1;
forward camera2(playerid);
public camera2(playerid)
SetTimer("camerab", 5000, false);
return 1;
forward camerab(playerid);
public camerab(playerid)
return 1;

[HiC]TheKiller 24/08/2011 08:03 AM

Re: Timer problem
This must be one of the most common issues with new scripters. You need to actually send the playerid param for the function to actually process it.

For this, we are going to use

pawn Code:
SetTimerEx("camera", 5000, false, "d", playerid);

Do the same thing for all of your other timers.

lukas567 24/08/2011 08:33 AM

Re: Timer problem
Thanks, but i think there is problem because i didn't put [MAX_PLAYERS] to work for all players, but i dont know where to put it.
Please help!

=WoR=Varth 24/08/2011 08:43 AM

Re: Timer problem
pawn Code:
new Timer[MAX_PLAYERS];

Timer[playerid] = SetTimerEx(.............)

lukas567 24/08/2011 08:59 AM

Re: Timer problem
But this will work just with SetTimerEx?

=WoR=Varth 24/08/2011 09:02 AM

Re: Timer problem
You can set anything to variable.
If you need to pass a value, you have to use SetTimerEx.

All times are GMT. The time now is 06:01 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.