Weapon And cordinants not placing on spawn. - 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: Weapon And cordinants not placing on spawn. (
/showthread.php?tid=305832)
Weapon And cordinants not placing on spawn. -
-Rebel Son- - 24.12.2011
Alright, So i got a wierd way of spawning my players with weapons and such.
It goes from : Select team > Select Class > Select Skin > spawn.
But it wont spawn the class's guns, Nor the right location.
Code:
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
new Team = GetPlayerTeam(playerid);
new Skin = GetPlayerSkin(playerid);
TextDrawShowForPlayer(playerid, countdown);
TextDrawShowForPlayer(playerid, timeleft);
TextDrawShowForPlayer(playerid, website);
SetPlayerInterior(playerid, 0);
if(pSoldier[playerid] == 1) return SetSpawnInfo(playerid, Team, Skin, -1689.67, -95.16, 3.57, 0.0, 22, 500, 25, 500, 30, 500);
else if(pMedic[playerid] == 1) return SetSpawnInfo(playerid, Team, Skin, -1689.67, -95.16, 3.57, 0.0, 22, 500, 25, 500, 30, 500);
else if(pSniper[playerid] == 1) return SetSpawnInfo(playerid, Team, Skin, -1689.67, -95.16, 3.57, 0.0, 22, 500, 25, 500, 30, 500);
return 1;
}
And one of the class's function.
pawn Код:
public Soldier(playerid)
{
new classid;
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);
OnPlayerRequestClass(playerid, classid);
return 1;
}
I May be missing something? or Am i doing something incorrectly?
-Dakota
Re: Weapon And cordinants not placing on spawn. -
Mini` - 24.12.2011
https://sampwiki.blast.hk/wiki/SpawnPlayer
I believe you have to do.
Код:
SpawnPlayer(playerid);
After setting the spawn info...
Maybe... Now I'm second guessing myself, as I see you have your code in OnPlayerSpawn...