[Ayuda] Al loguearse y spawnear se mueren...
#1

Buenas, acabo de abrir mi servidor RP y tengo un problema con mi Gm, no se como arreglarlo, lo que pasa es que A VECES cuando alguien loguea y al spawnear se muere aparece en el hospital, pero solo pasa a veces, Alguien me podria como solucionarlo?
Aqui os dejo el OnplayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
    new Float:phealth;
    GetPlayerHealth(playerid, phealth);

    if(phealth > 100) { SetPlayerHealthEx(playerid, 100); }
    if(IsPlayerNPC(playerid)) { Check_Avion_Login(playerid); }
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, DEFAULT_WEAPON_SKILL); // 9M
    UpdatePlayerScore(playerid); ClearPlayerSound(playerid, -1); SetPlayerColor(playerid, COLOR_INVISIBLE);
    if(GetPlayerData[playerid][P_Jailed] == 1 && GetPlayerData[playerid][P_JailedTime] > 0) // Admin Jail
    {
        KickReason[playerid] = false;
        LimpiarChat(playerid, DEFAULT_CHAT_CLEAR);
        SendErrorMessage(playerid, "0133", "Aъn estбs Encarcelado desde tu ъltima desconexiуn");
        SetPlayerPosEx(playerid, 198.2186, 162.4141, 1003.0300); // POS JAIL
        SetPlayerInteriorEx(playerid, 3);
        SetPlayerHealthEx(playerid, 60);
        return 1;
    }
    else if(GetPlayerData[playerid][P_Jailed] == 2 && GetPlayerData[playerid][P_JailedTime] > 0) // Arrestado LSPD
    {
        KickReason[playerid] = false;
        LimpiarChat(playerid, DEFAULT_CHAT_CLEAR);
        SendErrorMessage(playerid, "0133", "Aъn estбs Encarcelado desde tu ъltima desconexiуn");
        SetPlayerPosEx(playerid, 264.52, 77.46, 1001.04);
        SetPlayerInteriorEx(playerid, 6);
        SetPlayerHealthEx(playerid, 60);
        return 1;
    }
    if(IsPlayerConnectedEx(playerid))
    {
            if(PJMurio[playerid] == true)
        {
            new Player_Faccion = FACTION_TYPE_CIVIL;
            SetPlayerHealthEx(playerid, MAX_PLAYER_SPAWN_HEALTH);
            SetPlayerSkinEx(playerid, GetPlayerData[playerid][P_Skin]);
            SetPlayerVirtualWorldEx(playerid, FaccionesDatos[Player_Faccion][fWorld]);
            SetPlayerInteriorEx(playerid, FaccionesDatos[Player_Faccion][fInterior]);
            FijarPosJugador(playerid, FaccionesDatos[Player_Faccion][fSpawn_X], FaccionesDatos[Player_Faccion][fSpawn_Y], FaccionesDatos[Player_Faccion][fSpawn_Z], FaccionesDatos[Player_Faccion][fSpawn_AN]);
            SendClientMessage(playerid, COLOR_AZUL_CLARO, "Mйdico: {FFFFFF}Usted ha sufrнdo un accidente y ha sido trasladado al Hospital. Te han dado el alta, bienvenido a Casa.");
            GivePlayerMoneyEx(playerid, -10), GiveThatPlayerMoneyBM(playerid);
            GameTextForPlayer(playerid, "~r~-$10!", 5000, 1);
            PJMurio[playerid] = false;
          }
             else if(MurioViendoTV[playerid])
        {
             MurioViendoTV[playerid] = false;
             SetPlayerPosEx(playerid, PosAntesMirarTV[playerid][0], PosAntesMirarTV[playerid][1], PosAntesMirarTV[playerid][2]);
             SetPlayerHealthEx(playerid, PosAntesMirarTV[playerid][3]);
             SetPlayerArmourEx(playerid, PosAntesMirarTV[playerid][4]);
             SetPlayerVirtualWorldEx(playerid, VoIAntesMirarTV[playerid][0]);
             SetPlayerInteriorEx(playerid, VoIAntesMirarTV[playerid][1]);
             SetPlayerSkinEx(playerid, GetPlayerData[playerid][P_Skin]);
        }
             else if(!GetPlayerData[playerid][P_Registred] && !YPPV[playerid])     { LoadPlayerSpawn(playerid, false); }
            else if(GetPlayerData[playerid][P_Registred] && !YPPV[playerid])     { LoadPlayerSpawn(playerid, true);     }
            else if(SelectingClothes[playerid]) { SetPlayerSkinEx(playerid, GetPlayerData[playerid][P_Skin]); SelectingClothes[playerid] = false; }
        }
            else { SetPlayerWelcomeType(playerid, WELCOME_TYPE_NORMAL); }
    return 0;
}
Reply
#2

Tal vez te falta reiniciarle la variable al jugador al entrar al sv o loguearse prueba poniendo PJMurio[playerid] = false;
Reply
#3

Quote:
Originally Posted by GraviTyh
Посмотреть сообщение
Tal vez te falta reiniciarle la variable al jugador al entrar al sv o loguearse prueba poniendo PJMurio[playerid] = false;
Solo cambiando eso tu crees que funcionarб?
Reply
#4

Quote:
Originally Posted by GraviTyh
Посмотреть сообщение
Tal vez te falta reiniciarle la variable al jugador al entrar al sv o loguearse prueba poniendo PJMurio[playerid] = false;
Ya lo hice y me salen estos errores
PHP код:
C:\Users\Sifdin\Downloads\BioGamesRP\gamemodes\WP-RP.pwn(2804) : error 001expected token")"but found ";"
C:\Users\Sifdin\Downloads\BioGamesRP\gamemodes\WP-RP.pwn(2804) : error 036: empty statement
C
:\Users\Sifdin\Downloads\BioGamesRP\gamemodes\WP-RP.pwn(2817) : error 029invalid expressionassumed zero
C
:\Users\Sifdin\Downloads\BioGamesRP\gamemodes\WP-RP.pwn(2817) : warning 215expression has no effect
C
:\Users\Sifdin\Downloads\BioGamesRP\gamemodes\WP-RP.pwn(2817) : error 001expected token";"but found "if"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Y estas son las lineas
Код:
2804: if(PJMurio[playerid] == false;
2817: else if(MurioViendoTV[playerid])
Reply
#5

Quote:
Originally Posted by sifdin
Посмотреть сообщение
Ya lo hice y me salen estos errores
Quote:

error 001: expected token: ")", but found ";"

Код:
if(PJMurio[playerid] == false;
Es ingles bбsico.
Reply
#6

El if(PJMurio[playerid] == false; cбmbialo por if(PJMurio[playerid] == false) y lo que te dije anteriormente agrйgalo al callback onplayerconnect como en el ejemplo de enseguida;
pawn Код:
public OnPlayerConnect(playerid)
{
PJMurio[playerid] = false;
return 1;
}
Reply
#7

Quote:
Originally Posted by GraviTyh
Посмотреть сообщение
El if(PJMurio[playerid] == false; cбmbialo por if(PJMurio[playerid] == false) y lo que te dije anteriormente agrйgalo al callback onplayerconnect como en el ejemplo de enseguida;
pawn Код:
public OnPlayerConnect(playerid)
{
PJMurio[playerid] = false;
return 1;
}
Lo hice, ya no da ningun error, pero al entrar al sv no te mata pero ya apareces en el hospital y te salta el mensaje de que te moriste y no se quita el textdrawde bienvenidad
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)