OnPlayerSpawn Problem
#1

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

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

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

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

The problem is that you copy and pasted.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)