Is it possible...
#1

Is it possible that the player skips OnPlayerSpawn(playerid)
Because he does. Here I show you my OnPlayerRequestClass, OnPlayerRequestSpawn, SetPlayerRespawnInfo
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(pS[Zone] != DeathmatchZone)
    {
        if(pS[Skin] != Negative)
        {
            SetPlayerSkin(playerid,pS[Skin]);
            pS[Skin] = Negative;
        }
        SetPlayerPos(playerid,-2339.9487,3230.6035,6.7526);
        SetPlayerFacingAngle(playerid, 321.2543);
        SetPlayerCameraPos(playerid,-2336.0176,3235.2327,7.8718);
        SetPlayerCameraLookAt(playerid,-2339.9487,3230.6035,6.7526);
        ApplyAnimation(playerid,"CRACK","crckidle1",4.1,0,1,1,1,0);
        if(pS[ClassObjShow] == 0)
        {
            new ObjNum = 0;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,18267, -2339.58203125, 3227.8737792969, 5.6744909286499, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,16780, -2339.166015625, 3230.5021972656, 9.0540523529053, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,15037, -2342.5856933594, 3228.7062988281, 6.1177687644958, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1709, -2338.2404785156, 3223.6782226563, 5.7526159286499, 0, 0, 178.60021972656);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1710, -2335.4326171875, 3226.208984375, 5.7526159286499, 0, 0, 239.80981445313);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1753, -2343.6977539063, 3229.9743652344, 5.7526159286499, 0, 0, 87.654907226563);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2080, -2341.6743164063, 3231.8579101563, 5.4437780380249, 0, 0, 266.39038085938);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2112, -2338.0617675781, 3227.9362792969, 6.1448454856873, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2204, -2344.1081542969, 3225.3657226563, 5.7526159286499, 0, 0, 91.714965820313);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2985, -2336.2385253906, 3229.1057128906, 5.7412161827087, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1951, -2337.7678222656, 3228.6125488281, 6.8097677230835, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1667, -2338.0798339844, 3228.4165039063, 6.7101793289185, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2096, -2339.3669433594, 3227.9931640625, 5.7526159286499, 0, 0, 97.624877929688);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1728, -2342.0419921875, 3233.3950195313, 5.7526159286499, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,1762, -2336.7448730469, 3232.3444824219, 5.7526159286499, 0, 0, 274.33020019531);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2264, -2343.7622070313, 3230.1606445313, 7.3442726135254, 0, 0, 90.628509521484);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2261, -2339.4826660156, 3221.6909179688, 7.4709911346436, 0, 0, 192.54040527344);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2194, -2341.5930175781, 3231.5031738281, 6.5720748901367, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2241, -2335.2141113281, 3227.0949707031, 6.2564163208008, 0, 0, 0);
            ObjNum++;
            pS[sClassSelObj ][ObjNum] = CreatePlayerObject( playerid,2244, -2343.98828125, 3226.5727539063, 7.818995475769, 0, 0, 0);
            pS[ClassObjShow] = 1;
        }
    }
    else if(pS[Zone] == DeathmatchZone)
    {
        if(pS[Team] == Ballas)
        {
            SetPlayerPos(playerid,-2339.9487,3230.6035,6.7526);
            SetPlayerFacingAngle(playerid, 321.2543);
            SetPlayerCameraPos(playerid,-2336.0176,3235.2327,7.8718);
            SetPlayerCameraLookAt(playerid,-2339.9487,3230.6035,6.7526);
            switch(CurrentSkin)
            {
                case 0: SetPlayerSkin(playerid,102);
                case 1: SetPlayerSkin(playerid,103);
                case 2: SetPlayerSkin(playerid,104);
            }
            if(CurrentSkin < 2) CurrentSkin++;
            else CurrentSkin = 0;
        }
    }
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    SetPlayerRespawnInfo(playerid);
    return 1;
}

public SetPlayerRespawnInfo(playerid)
{
    if(pS[Zone] == DeathmatchZone)
    {
        switch(pS[Team])
        {
            case Ballas: SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),1204.9883,10.3033,1000.9219,178.6017, 0, 0, 0, 0, 0, 0) && SetPlayerInterior(playerid,2);
            case Vagos: SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),2495.8682,-1701.3007,1014.7422,0.1683, 0, 0, 0, 0, 0, 0);
            case Grove: SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),2495.8682,-1701.3007,1014.7422,0.1683, 0, 0, 0, 0, 0, 0) && SetPlayerInterior(playerid,3);
            case Varrios: SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),2495.8682,-1701.3007,1014.7422,0.1683, 0, 0, 0, 0, 0, 0);
            case Rifa: SetSpawnInfo(playerid,0,GetPlayerSkin(playerid),2495.8682,-1701.3007,1014.7422,0.1683, 0, 0, 0, 0, 0, 0);
        }
    }
    if(pS[Zone] == Normal)
    {
        if(pS[Clan] != Negative)
        {
            new ClanId = pS[Clan];
            if(pS[UseClanSkin] == 1 && ClanInfo[ClanId][fUseSkins] == 1)
            {
                SetSpawnInfo(playerid,0,GetPlayerClanSkin(playerid), ClanInfo[ClanId][fX],ClanInfo[ClanId][fY],ClanInfo[ClanId][fZ],360, 0, 0, 0, 0, 0, 0);
            }
            else
            {
                SetSpawnInfo(playerid,0,pS[Skin], ClanInfo[ClanId][fX],ClanInfo[ClanId][fY],ClanInfo[ClanId][fZ],360, 0, 0, 0, 0, 0, 0);
            }
        }
        else
        {
            pS[Skin] = GetPlayerSkin(playerid);
            new rand = random(sizeof(RandomStuntSpawns));
            SetSpawnInfo(playerid,0,pS[Skin], RandomStuntSpawns[rand][0],RandomStuntSpawns[rand][1],RandomStuntSpawns[rand][2],RandomStuntSpawns[rand][3], 0, 0, 0, 0, 0, 0);
            SetPlayerInterior(playerid,0);
        }
    }
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(pS[Zone] == DeathmatchZone)
    {
        SetPlayerHealth(playerid,99.99999);
    }
    if(pS[Zone] == Normal)
    {
        if(pS[Clan] != Negative)
        {
            if(ClanInfo[pS[Clan]][SpawnWep1] != 0)
            {
                GivePlayerGun(playerid,ClanInfo[pS[Clan]][SpawnWep1]);
            }
            if(ClanInfo[pS[Clan]][SpawnWep2] != 0)
            {
                GivePlayerGun(playerid,ClanInfo[pS[Clan]][SpawnWep2]);
            }
            if(ClanInfo[pS[Clan]][fArmor] != 0)
            {
                SetPlayerArmour(playerid,ClanInfo[pS[Clan]][fArmor]);
            }
            SetPlayerToClanColor(playerid);
            SetPlayerInterior(playerid,ClanInfo[pS[Clan]][fInt]);
        }
    }
    pS[Spawned] = 1;
    return 1;
}
My player is in Normal zone, and in a faction.
This problem came up when I made the Faction parts at OnPlayerSpawn and SetPlayerRespawnInfo.
I have no idea why it comes up, but it's fucking annoying, I already tried some things but didn't work.
Reply
#2

OMG, already sloved, it seems that pS[Skin] was on -1. Lol sorry
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)