Help | "TAB" key
#3

Deathly force, this will cause HUGE lags because every second you run a loop of 1 to 200.

Try this instead:
On top of the script under #include <a_samp>:
pawn Код:
forward CashUpdate(playerid);
new bool:IsUpdated[MAX_PLAYERS];
OnPlayerConnect:
pawn Код:
if(!IsUpdated[playerid]) { SetTimerEx("CashUpdate",1500,True,"i",playerid); IsUpdated[playerid] = True; }

In the bottom of the mode:
pawn Код:
public CashUpdate(playerid) { if(IsPlayerConnected(playerid)) return SetPlayerScore(playerid, GetPlayerMoney(playerid)); }

This one will run a timer for every ID that connects that will update the score only for him, every second and a half. if the player disconnects the timer keeps running and will keep working for another player gets the id so no needed to run more timers for the same ID

Reply


Messages In This Thread
Help | "TAB" key - by borisblat - 11.04.2009, 10:07
Re: Help | "TAB" key - by GanG$Ta - 11.04.2009, 10:17
Re: Help | "TAB" key - by OmeRinG - 11.04.2009, 10:26
Re: Help | "TAB" key - by Nubotron - 11.04.2009, 10:40
Re: Help | "TAB" key - by borisblat - 11.04.2009, 10:56
Re: Help | "TAB" key - by Weirdosport - 11.04.2009, 11:01
Re: Help | "TAB" key - by Flo_White - 11.04.2009, 11:17
Re: Help | "TAB" key - by Fire Dragon - 11.04.2009, 11:34
Re: Help | "TAB" key - by borisblat - 11.04.2009, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)