Calls OnPlayerSpawn twice? - 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: Calls OnPlayerSpawn twice? (
/showthread.php?tid=265424)
Calls OnPlayerSpawn twice? -
Snoozy1337 - 30.06.2011
My script for some reason calls OnPlayerSpawn twice, I got no idea why or where to look? It does it when you login for first time (Through dialog) and it does it when you die. I've glanced around OnPlayerDeath, around the login stuff without luck so I was hoping someone here could help, thanks in advance.
Re: Calls OnPlayerSpawn twice? -
langricr - 30.06.2011
Quote:
Originally Posted by Snoozy1337
My script for some reason calls OnPlayerSpawn twice, I got no idea why or where to look? It does it when you login for first time (Through dialog) and it does it when you die. I've glanced around OnPlayerDeath, around the login stuff without luck so I was hoping someone here could help, thanks in advance.
|
Does it call SpawnPlayer anywhere?
Re: Calls OnPlayerSpawn twice? -
Shadoww5 - 01.07.2011
Post
OnPlayerSpawn.
Re: Calls OnPlayerSpawn twice? -
Snoozy1337 - 01.07.2011
I got one place where it calls SpawnPlayer but that's right after login so he actually spawns, else he doesn't spawn. Here is the OnPlayerSpawn(playerid)
pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerSpectating(playerid, false);
if(gPlayerAnimLibsPreloaded[playerid] == 0)
{
gPlayerAnimLibsPreloaded[playerid] = 1;
}
SendClientMessage(playerid,COLOR_YELLOW,"TEST");
return 1;
}
Re: Calls OnPlayerSpawn twice? -
Jochemd - 01.07.2011
Also post OnPlayerDeath please.
Re: Calls OnPlayerSpawn twice? -
Snoozy1337 - 01.07.2011
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerAccount[playerid][Deaths] += 1;
PlayerAccount[killerid][Kills] += 1;
if(gPlayerUsingLoopingAnim[playerid] == 1)
{
gPlayerUsingLoopingAnim[playerid] = 0;
}
if(IsOnePlayAnim[playerid] == 1)
{
IsOnePlayAnim[playerid] = 0;
}
if(BackOut[playerid] == 1)
{
BackOut[playerid] = 0;
}
}
Re: Calls OnPlayerSpawn twice? -
Macluawn - 01.07.2011
do you use TogglePlayerSpectating somewhere, besides spectate command?
Re: Calls OnPlayerSpawn twice? -
bartje01 - 01.07.2011
Any filterscripts?
Re: Calls OnPlayerSpawn twice? -
Jochemd - 01.07.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerSpectating(playerid, false);
Here we go. When the player stops specating, it calls OnPlayerSpawn again. Use this TogglePlayerSpectating somewhere else, where you really stop it, instead of here.