SA-MP Forums Archive
Keeps Repeating :S [URGENT] - 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: Keeps Repeating :S [URGENT] (/showthread.php?tid=86024)



Keeps Repeating :S [URGENT] - Kyle - 11.07.2009

For some reason the RobCasino1 And RobCasino2 Work Fine
But when it comes to RobCasino3

It gives me cash and a wanted level and what other i asked for but it keep repeating over and over again and wont stop but i cant see the problem in the code

Thanks Ky[le]

http://pastebin.com/m44802132


Re: Keeps Repeating :S [URGENT] - -Sneaky- - 11.07.2009

It repeats because you are doing for(new i=0; i < MAX_PLAYERS; i++) I'm guessing.. you should use SetTimerEx instead, for example:

pawn Код:
new mwah[MAX_PLAYERS]; // on top

SetTimerEx("RobCasino1",5000,0,"i",playerid); // somewhere..
// or
RobCasino1(playerid); // somewhere..

forward RobCasino1(playerid);
public RobCasino1(playerid)
{
  GameTextForPlayer(playerid, "~b~Robbing ~w~Casino~n~ ~p~Threatening ~w~Staff", 5000, 5);
  SetTimerEx("RobCasino2",5000,0,"i",playerid);
  return 1;
}

forward RobCasino2(playerid);
public RobCasino2(playerid)
{
  GameTextForPlayer(playerid, "~b~Robbing ~w~Casino~n~ ~p~Grabbing ~w~Money", 5000, 5);
  mwah[playerid] = SetTimerEx("RobCasino2",5000,0,"i",playerid);
  return 1;
}
Understand?


Re: Keeps Repeating :S [URGENT] - Kyle - 11.07.2009

Thanks Alot!