SA-MP Forums Archive
OnPlayerSpawn Problem - 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: OnPlayerSpawn Problem (/showthread.php?tid=78407)



OnPlayerSpawn Problem - Franjdea - 19.05.2009

Hey guys,

I got this code from the Morderntopia script, and I tried to make it on my own gamemode.

pawn Код:
public OnPlayerSpawn(playerid)
{
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team

    if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] > 0) // LEADER
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "It Works - Welcome Homicide Detective Leader!");
        SetSpawnInfo(playerid, gTeam[playerid], 240,-204.0065,1153.0325,19.7422,23,51,0,0,0,0,0);
        SpawnPlayer(playerid);
    }

    return 1;
}
SQL etc is all plugged in, but when I login and spawn it spams the message at about 20 messages a second, also lagging me!

Does anyone know what I've done wrong? It's been a few months since I was a scritping addict .

Thanks.

-Franjdea


Re: OnPlayerSpawn Problem - Diogo_Linheiro - 19.05.2009

when i was a newbie, i had some problems with mysql, watch out if you have inserted the right columns, in the right order, the right paramters etc...


Re: OnPlayerSpawn Problem - Franjdea - 20.05.2009

Quote:
Originally Posted by Diogo_Linheiro
when i was a newbie, i had some problems with mysql, watch out if you have inserted the right columns, in the right order, the right paramters etc...
I loaded in the database.sql file like I was supposed to, really wierd bug .


Re: OnPlayerSpawn Problem - Andom - 20.05.2009

public OnPlayerSpawn(playerid)
{
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team

if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] > 0) // LEADER
{
SendClientMessage(playerid, COLOR_LIGHTRED, "It Works - Welcome Homicide Detective Leader!");
SetSpawnInfo(playerid, gTeam[playerid], 240,-204.0065,1153.0325,19.7422,23,51,0,0,0,0,0);
SpawnPlayer(playerid);
}

return 1;
}

Are you nuts? you are spawning someone in OnPlayerSpawn, you're making an un-endless loop, that's not crazy you will be flooded.


Re: OnPlayerSpawn Problem - ICECOLDKILLAK8 - 20.05.2009

The problem is that you copy and pasted.


Re: OnPlayerSpawn Problem - Franjdea - 20.05.2009

Quote:
Originally Posted by JeNkStAX
The problem is that you copy and pasted.
Why are you such a douchebag? Your obviously not helping anyone.

Anyway thanks Andom.