Getting kicked When spawned from a function? - 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)
+--- Thread: Getting kicked When spawned from a function? (
/showthread.php?tid=305019)
Getting kicked When spawned from a function? -
-Rebel Son- - 20.12.2011
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?
Re: Getting kicked When spawned from a function? -
Steven82 - 20.12.2011
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. **
Re: Getting kicked When spawned from a function? -
-Rebel Son- - 20.12.2011
Ah, Didn't know, thanks steven.
Re: Getting kicked When spawned from a function? -
Steven82 - 20.12.2011
Your welcome, hopefully it works.
Re: Getting kicked When spawned from a function? -
-Rebel Son- - 21.12.2011
Yeah it worked perfectly. Rep+