Spawn problem
#1

------------------<<<<<<<<<<<<<< Fixed
Reply
#2

try and use
pawn Код:
else if(//bla bla bla
Try this (UnTested)

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,1);
    if(gPlayerLogged[playerid] == 0) {
        Kiri(playerid,HELEPUNANE,">> Sul on vaja ennem sisse logida, kui sa tahad mдngida!");
        Kick(playerid);
    }
    SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
    if(GetPlayerSkin(playerid) == 0 || GetPlayerSkin(playerid) == 3 || GetPlayerSkin(playerid) == 4 || GetPlayerSkin(playerid) == 5 || GetPlayerSkin(playerid) == 6 || GetPlayerSkin(playerid) == 8 || GetPlayerSkin(playerid) == 42 || GetPlayerSkin(playerid) == 65 || GetPlayerSkin(playerid) == 74 || GetPlayerSkin(playerid) == 86 || GetPlayerSkin(playerid) == 119 || GetPlayerSkin(playerid) == 208 || GetPlayerSkin(playerid) == 268 || GetPlayerSkin(playerid) == 273 || GetPlayerSkin(playerid) == 289) {
        if(PlayerInfo[playerid][pSex] == 1) { // Meessoost
            SetPlayerSkin(playerid, 184); // Tavaline mehevдlimus
            PlayerInfo[playerid][pChar] = 184;
        } else { // Naissoost
            SetPlayerSkin(playerid, 2); // Tavaline naistevдlimus
            PlayerInfo[playerid][pChar] = 2;
        }
        Kiri(playerid,PUNANE,">> Sьsteem vahetas automaatselt sinu vдlimuse, kuna sul oli keelatud vдlimus.");
    }
    new rand;
    new house = PlayerInfo[playerid][pPhousekey];
    if(PlayerInfo[playerid][pJailed] == 1)
    {
        SetPlayerInterior(playerid, 10);
        new rand1 = random(sizeof(ArrestJail));
        SetPlayerPos(playerid,ArrestJail[rand1][0],ArrestJail[rand1][1],ArrestJail[rand1][2]);
        SetPlayerFacingAngle(playerid, 250);
        SendClientMessage(playerid, HELEPUNANE, "Te ei ole veel oma karistust lхpuni kandnud, kahjuks lдhete tagasi vangi.");
        return 1;
    }else if(PlayerInfo[playerid][pJailed] == 2)
    {
        SetPlayerInterior(playerid, 0);
        PlayerInfo[playerid][pInt] = 0;
        SetPlayerPos(playerid,268.5777,1857.9351,9.8133);
        SetPlayerWorldBounds(playerid, 337.5694,101.5826,1940.9759,1798.7453);
        return 1;
    }else if(MedicBill[playerid] == 1) {
        //if(PlayerInfo[playerid][pJailed] == 0) {
            if(FirstSpawn[playerid] != 1) {
                PlayerInfo[playerid][pDeaths] += 1;
                SetPlayerHealth(playerid, 100.0);
                SetPlayerInterior(playerid, 3);
                PlayerInfo[playerid][pInt] = 3;
                rand = random(sizeof(gMedicSpawns));
            SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
            SetPlayerFacingAngle(playerid, 0);
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Sa pead puhkama.", 30000, 3);
                JustDied[playerid] = 1;
                MedicTime[playerid] = 1;
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                if(PlayerInfo[playerid][pDonateRank] > 0) {
                NeedMedicTime[playerid] = 30;
                }else{
                    NeedMedicTime[playerid] = 40;
                }
                return 1;
            }
        //}
    }else if(JustDied[playerid] == 1) {
        if(GetPlayerVirtualWorld(playerid) != 0 || PlayerInfo[playerid][pVirWorld] != 0) {
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVirWorld] = 0;
        }
        SetPlayerPos(playerid,-321.8470,1056.4661,19.7422);
        SetPlayerInterior(playerid,0);
        PlayerInfo[playerid][pInt] = 0;
        return 1;
    }
    if(house != 255)
    {
        if(SpawnChange[playerid])
        {
            SetPlayerColor(playerid,0xFFFFFF00);
            SetPlayerInterior(playerid,0);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirWorld]);
            SetPlayerPos(playerid, HouseInfo[house][hEntrancex], HouseInfo[house][hEntrancey],HouseInfo[house][hEntrancez]); // Warp the player
            return 1;
        }
    }
    if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // Politsei
    {
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerInterior(playerid,6);
        SetPlayerPos(playerid, 254.8334,65.5046,1003.6406);
        SetPlayerFacingAngle(playerid, 270.0);
        PlayerInfo[playerid][pInt] = 6;
        return 1;
       }
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) // Pддsteamet
    {
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 1231.2582,306.5133,19.7578);
        SetPlayerFacingAngle(playerid, 90);
        PlayerInfo[playerid][pInt] = 0;
        GivePlayerWeapon(playerid, 42, 5000);
        return 1;
    }
    else { // Tavakodaniku spawn (Motell)
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerPos(playerid, 2221.1958,-1152.4873,1025.7969);
        SetPlayerFacingAngle(playerid, 0);
        SetPlayerInterior(playerid, 15);
        PlayerInfo[playerid][pInt] = 15;
    }
    return 1;
}
Reply
#3

Still doens't work. :S
Reply
#4

Ok what about this
Becouse the player is not pMember & pLeader it would run the Motell code even if MedicBill[ is set to 1

So can you pls try it like this again
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,1);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,1);
    if(gPlayerLogged[playerid] == 0) {
        Kiri(playerid,HELEPUNANE,">> Sul on vaja ennem sisse logida, kui sa tahad ma"ngida!");
        Kick(playerid);
    }
    SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
    if(GetPlayerSkin(playerid) == 0 || GetPlayerSkin(playerid) == 3 || GetPlayerSkin(playerid) == 4 || GetPlayerSkin(playerid) == 5 || GetPlayerSkin(playerid) == 6 || GetPlayerSkin(playerid) == 8 || GetPlayerSkin(playerid) == 42 || GetPlayerSkin(playerid) == 65 || GetPlayerSkin(playerid) == 74 || GetPlayerSkin(playerid) == 86 || GetPlayerSkin(playerid) == 119 || GetPlayerSkin(playerid) == 208 || GetPlayerSkin(playerid) == 268 || GetPlayerSkin(playerid) == 273 || GetPlayerSkin(playerid) == 289) {
        if(PlayerInfo[playerid][pSex] == 1) { // Meessoost
            SetPlayerSkin(playerid, 184); // Tavaline meheva"
limus
            PlayerInfo[playerid][pChar] = 184;
        } else { // Naissoost
            SetPlayerSkin(playerid, 2); // Tavaline naisteva"limus
            PlayerInfo[playerid][pChar] = 2;
        }
        Kiri(playerid,PUNANE,">> Su"steem vahetas automaatselt sinu va"limuse, kuna sul oli keelatud va"limus.");
    }
    new rand;
    new house = PlayerInfo[playerid][pPhousekey];
    if(PlayerInfo[playerid][pJailed] == 1)
    {
        SetPlayerInterior(playerid, 10);
        new rand1 = random(sizeof(ArrestJail));
        SetPlayerPos(playerid,ArrestJail[rand1][0],ArrestJail[rand1][1],ArrestJail[rand1][2]);
        SetPlayerFacingAngle(playerid, 250);
        SendClientMessage(playerid, HELEPUNANE, "
Te ei ole veel oma karistust lo~puni kandnud, kahjuks la"hete tagasi vangi.");
        return 1;
    }
    if(PlayerInfo[playerid][pJailed] == 2)
    {
        SetPlayerInterior(playerid, 0);
        PlayerInfo[playerid][pInt] = 0;
        SetPlayerPos(playerid,268.5777,1857.9351,9.8133);
        SetPlayerWorldBounds(playerid, 337.5694,101.5826,1940.9759,1798.7453);
        return 1;
    }
    if(MedicBill[playerid] == 1) {
        //if(PlayerInfo[playerid][pJailed] == 0) {
            if(FirstSpawn[playerid] != 1) {
                PlayerInfo[playerid][pDeaths] += 1;
                SetPlayerHealth(playerid, 100.0);
                SetPlayerInterior(playerid, 3);
                PlayerInfo[playerid][pInt] = 3;
                rand = random(sizeof(gMedicSpawns));
                SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
                SetPlayerFacingAngle(playerid, 0);
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Sa pead puhkama.", 30000, 3);
                JustDied[playerid] = 1;
                MedicTime[playerid] = 1;
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                if(PlayerInfo[playerid][pDonateRank] > 0) {
                    NeedMedicTime[playerid] = 30;
                } else {
                    NeedMedicTime[playerid] = 40;
                }
                return 1;
            }
    //}
    }else if(JustDied[playerid] == 1) {
        if(GetPlayerVirtualWorld(playerid) != 0 || PlayerInfo[playerid][pVirWorld] != 0) {
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVirWorld] = 0;
        }
        SetPlayerPos(playerid,-321.8470,1056.4661,19.7422);
        SetPlayerInterior(playerid,0);
        PlayerInfo[playerid][pInt] = 0;
        return 1;
    }else if(house != 255)
    {
        if(SpawnChange[playerid])
        {
            SetPlayerColor(playerid,0xFFFFFF00);
            SetPlayerInterior(playerid,0);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirWorld]);
            SetPlayerPos(playerid, HouseInfo[house][hEntrancex], HouseInfo[house][hEntrancey],HouseInfo[house][hEntrancez]); // Warp the player
            return 1;
        }
    }else if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // Politsei
    {
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerInterior(playerid,6);
        SetPlayerPos(playerid, 254.8334,65.5046,1003.6406);
        SetPlayerFacingAngle(playerid, 270.0);
        PlayerInfo[playerid][pInt] = 6;
        return 1;
       }else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) // Pa"a"steamet
    {
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 1231.2582,306.5133,19.7578);
        SetPlayerFacingAngle(playerid, 90);
        PlayerInfo[playerid][pInt] = 0;
        GivePlayerWeapon(playerid, 42, 5000);
        return 1;
    }
    else{ // Tavakodaniku spawn (Motell)
        SetPlayerColor(playerid,0xFFFFFF00);
        SetPlayerPos(playerid, 2221.1958,-1152.4873,1025.7969);
        SetPlayerFacingAngle(playerid, 0);
        SetPlayerInterior(playerid, 15);
        PlayerInfo[playerid][pInt] = 15;
    }
    return 1;
}
Reply
#5

Ugh.. still doens't work. :S
Reply
#6

Still the same probblem ?
Reply
#7

Yes, still spawning to motel.

// I fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)