Calls OnPlayerSpawn twice?
#1

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

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?
Reply
#3

Post OnPlayerSpawn.
Reply
#4

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

Also post OnPlayerDeath please.
Reply
#6

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

do you use TogglePlayerSpectating somewhere, besides spectate command?
Reply
#8

Any filterscripts?
Reply
#9

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


Forum Jump:


Users browsing this thread: 2 Guest(s)