SA-MP Forums Archive
[Tutorial] [TUT] OnPlayerSpawn Debug - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] OnPlayerSpawn Debug (/showthread.php?tid=112206)



[TUT] OnPlayerSpawn Debug - MJ! - 06.12.2009

ATTENTION: This is only for GodFather Mode

Are you tired of OnPlayerSpawn Bug because he's called twice ?



pawn Code:
static bool: ONP_Debug[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
  if(ONP_Debug[playerid]) return true;
  ONP_Debug[playerid] = true;
  SetTimerEx("ResetSpawn",1000,false,"d",playerid);
  // Rest of OnPlayerSpawn
}

forward ResetSpawn(playerid);
public ResetSpawn(playerid)
{
  if(ONP_Debug[playerid]) ONP_Debug[playerid] = false;
  return true;
}



Re: [TUT] OnPlayerSpawn Debug - Streetplaya - 06.12.2009

Why should it be called twice?


Re: [TUT] OnPlayerSpawn Debug - MJ! - 06.12.2009

It's a Client Bug , you can test if you don't trust me xD


Re: [TUT] OnPlayerSpawn Debug - Malice - 06.12.2009

Not for me.


Re: [TUT] OnPlayerSpawn Debug - MJ! - 06.12.2009

Quote:
Originally Posted by Malice
Not for me.
Do this

pawn Code:
public OnPlayerSpawn(playerid)
{
  SendClientMessage(playerid,0xFFFFFFF,"TEST");
}
Enter in game , and make a ss


Re: [TUT] OnPlayerSpawn Debug - Chaprnks - 11.12.2009

Calls only once for me.


Re: [TUT] OnPlayerSpawn Debug - cmg4life - 17.12.2009

same here


Re: [TUT] OnPlayerSpawn Debug - Danny_Costelo - 17.12.2009

pawn Code:
public OnPlayerSpawn(playerid)
{
  print("Debug: OnPlayerSpawn Called");
}
Just tested it, it's only called once.

And that code does nothing besides switch a couple of useless variables.


Re: [TUT] OnPlayerSpawn Debug - Daren_Jacobson - 17.12.2009

try doing it in the GF, it should say it twice, so the real problem is the script, but indeed, this would fix it.


Re: [TUT] OnPlayerSpawn Debug - Danny_Costelo - 17.12.2009

Quote:
Originally Posted by Daren_Jacobson
try doing it in the GF, it should say it twice, so the real problem is the script, but indeed, this would fix it.
Fix what? There's nothing to fix, and GF is a whole other story.