Getting kicked When spawned from a function?
#1

Alright, So i got this function to House all the stuff for a class (soldier) and it has SpawnPlayer In it, When i join, selected Soldier, it kicks me..?

pawn Код:
public Soldier(playerid)
{
    pSoldier[playerid] = 1;
    new Team = GetPlayerTeam(playerid);
    new pname[MAX_PLAYER_NAME], cstring[60];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(cstring, sizeof(cstring),"info: %s Became a soldier! (TEAM: %d)" , pname, Team);
    SendClientMessage(playerid, COLOR_TAN, cstring);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 25, 500);
    GivePlayerWeapon(playerid, 30, 500);
    SetPlayerSkin(playerid, 287);
    SpawnPlayer(playerid);
    return 1;
}
Anyone got a conclusion to why this is happening? or a solution?
Reply
#2

This subject of this topic has been created probably 100 times already. It's a new bug. You must use SetSpawnInfo before SpawnPlayer.

** I'm going off of memory. I do not know if this is 100% correct. **
Reply
#3

Ah, Didn't know, thanks steven.
Reply
#4

Your welcome, hopefully it works.
Reply
#5

Yeah it worked perfectly. Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)