[Tutorial] [TUT] OnPlayerSpawn Debug
#1

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;
}
Reply
#2

Why should it be called twice?
Reply
#3

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

Not for me.
Reply
#5

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
Reply
#6

Calls only once for me.
Reply
#7

same here
Reply
#8

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.
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)