SpawnPlayer only works when pressing arrows/spawn
#1

Hello,

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(GetPVarInt(playerid,"IsLogged") == 0)
    {
        new ip[16],string[128],Playername[MAX_PLAYER_NAME];
        GetPlayerIp(playerid,ip,sizeof(ip));
        GetPlayerRPName(playerid,Playername,sizeof(Playername));
        format(string,sizeof(string),"JOIN: {008000}%s (ID: %d). {008000}IP: %s. Country: %s",Playername,playerid,ip,GetPlayerCountryName(playerid));
        SendAdminMessage(COLOR_GREEN,string);
        format(string,sizeof(string),"INGAME JOIN: %s (ID: %d).",Playername,playerid);
        IRC_Say(IrcBot,"#GTAProductions",string);
    }
    SpawnPlayer(playerid);
    return 1;
}
With this code I got a weird problem. The player only spawns when I press one of the arrows, so that would mean OnPlayerRequestClass is not called when you go to the class request. What is the problem?

Note: OnPlayerRequestSpawn returns 1.

Jochem
Reply
#2

First, you have to use
pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
before you can use SpawnPlayer, so do that
Reply
#3

It fixed it, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)