Weapon And cordinants not placing on spawn.
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)