[ Ajuda ] Spawn Moradores
#1

Queria ajuda, й o seguinte.
Fiz este cуdigo sу que na hora do spawn ( marcado no codigo : //spawn aqui )
ele Spawn normal se nгo tiver casa , mas se tiver ele vai direto pra seleзгo de classes
alguem pode me ajudar?
pawn Код:
if (dialogid == LOGIN)
    {
        if (response)
        {
            if (strlen(inputtext))
            {
                new conta[80];
                format(conta, sizeof(conta), P_CONTAS, pName(playerid)); //
                confirmado = dini_Get(conta, "Senha");
                if (strcmp(inputtext, confirmado, true) == 0)
                {
                    PlayerInfo[playerid][Logado] = 1;
                    //SendClientMessage(playerid, 0xFFFFFFAA, "* Sua conta foi carregada com sucesso!");
                    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
                    SetPlayerSkin(playerid, dini_Int(conta, "Skin"));
                    Gasolina[playerid] = dini_Int(conta, "Gasolina");
                    GivePlayerGrana(playerid, dini_Int(conta, "Dinheiro"));
                    SetPlayerWantedLevel(playerid, dini_Int(conta, "Procurado"));
                    Experiencia[playerid] = dini_Int(conta, "Experiencia");
                    SetPlayerSkin(playerid, dini_Int(conta, "Skin"));
                    Preso[playerid] = dini_Int(conta, "Preso");
                    Level[playerid] = dini_Int(conta, "Level");
                    minUP[playerid] = dini_Int(conta, "Relogioupm");
                    segUP[playerid] = dini_Int(conta, "Relogioups");
                    Profissao[playerid] = dini_Int(conta, "Profissao");
                    Habilitacoes[playerid][HAB_TERRESTRE] = bool: dini_Bool(conta, "Terrestre");
                    Habilitacoes[playerid][HAB_AEREA] = bool: dini_Bool(conta, "Aerea");
                    Habilitacoes[playerid][HAB_NAUTICA] = bool: dini_Bool(conta, "Nautica");
                    TextDrawHideForPlayer(playerid, ImagemConnect);
                    //SetSpawnInfo(playerid, 1, dini_Int(conta, "Skin"), dini_Int(conta, "CasaX"), dini_Int(conta, "CasaY"), dini_Int(conta, "CasaZ"), 354.1657, 0, 0, 0, 0, 0, 0);
                    ResetPlayerWeapons(playerid);
                    aviso[playerid] = 0;
                    Cargas[playerid] = 0;
                    if (CheckCasas(playerid) > 0)// || IsMorador(playerid) == 1) // Spawn Aqui!
                    {
                        //SendClientMessage(playerid, 0xC0C0C0AA, "*  Sua casa foi carregada com sucesso!");
                        //CasaX[playerid] = dini_Int(conta, "CasaX");
                        //CasaY[playerid] = dini_Int(conta, "CasaY");
                        //CasaZ[playerid] = dini_Int(conta, "CasaZ");
                        SpawnPlayer(playerid);
                        SetSpawnInfo(playerid, 1, dini_Int(conta, "Skin"), dini_Int(conta, "CasaX"), dini_Int(conta, "CasaY"), dini_Int(conta, "CasaZ"), 354.1657, 0, 0, 0, 0, 0, 0);
                    }
                    else {
                    SetSpawnInfo(playerid, 1, 23, 17.4856, 1187.0035, 19.2845, 359.6447, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                    }
                }
                else
                {
                    Incorreta[playerid]++;
                    if (Incorreta[playerid] >= 3)
                    {
                        format(string, sizeof(string), "[ INFO ] Vocк digitou a senha errada 3 vezes e foi kickado do servidor.");
                        SendClientMessage(playerid, 0x00FF7FAA, string);
                        Kick(playerid);
                    }
                    else
                    {
                        SendClientMessage(playerid, 0xFF0000AA, "[ ERRO ] Senha Incorreta!");
                        Login(playerid);
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "[ ERRO ] Nгo deixe o campo vazio, preencha-o com sua senha!");
                SendClientMessage(playerid, 0xFFFFFFAA, string);
                format(string, sizeof(string), "Digite sua senha!\n\nNome de usuбrio: %s\n\nInsira sua senha:", pName(playerid));
                ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Conta", string, "Logar", "Sair");
            }
        }
        else
        {
            Kick(playerid);
        }
    }
Reply
#2

Poste a callback "OnPlayerSpawn" e "SetSpawnInfo".
Reply
#3

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
Poste a callback "OnPlayerSpawn" e "SetSpawnInfo".
ІІІІ

@off

Dini Ainda Feto ? :<
Reply
#4

Dini й so por enquanto '-'

OnPlayerSpawn: // SetSpawnInfo nгo й uma callback O_O'
pawn Код:
public OnPlayerSpawn(playerid)
{
    LogarProf(playerid);
    TextDrawShowForPlayer(playerid,UPRelogio[playerid]);
    TextDrawHideForPlayer(playerid, TEXT0);
    TextDrawHideForPlayer(playerid, TEXT1);
    TextDrawHideForPlayer(playerid, TEXT2);
    TextDrawHideForPlayer(playerid, TEXT3);
    TextDrawHideForPlayer(playerid, TEXT4);
    TextDrawHideForPlayer(playerid, ImagemConnect);
    GangZoneShowForPlayer(playerid, favela, Amarelo);
    GangZoneShowForPlayer(playerid, areadmlv, Branco);
    emcasa[playerid] = 0;
    minUP[playerid] = dini_Int(file, "Relogioupm");
    segUP[playerid] = dini_Int(file, "Relogioups");
    TempoExp[playerid] = 0;
    if (Preso[playerid] == 0)
    {
        Preso[playerid] = 0;
    }
    if (Preso[playerid] == 1)
    {
        if (IsAdmin[playerid] > 0)
        {
            Preso[playerid] = 0;
        }
        if (GetPlayerWantedLevel(playerid) == 1)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 120000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 2)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 240000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 3)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 480000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 4)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 600000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 5)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 720000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 6)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 840000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by [LF]PlaYer
Посмотреть сообщение
Dini й so por enquanto '-'

OnPlayerSpawn: // SetSpawnInfo nгo й uma callback O_O'
pawn Код:
public OnPlayerSpawn(playerid)
{
    LogarProf(playerid);
    TextDrawShowForPlayer(playerid,UPRelogio[playerid]);
    TextDrawHideForPlayer(playerid, TEXT0);
    TextDrawHideForPlayer(playerid, TEXT1);
    TextDrawHideForPlayer(playerid, TEXT2);
    TextDrawHideForPlayer(playerid, TEXT3);
    TextDrawHideForPlayer(playerid, TEXT4);
    TextDrawHideForPlayer(playerid, ImagemConnect);
    GangZoneShowForPlayer(playerid, favela, Amarelo);
    GangZoneShowForPlayer(playerid, areadmlv, Branco);
    emcasa[playerid] = 0;
    minUP[playerid] = dini_Int(file, "Relogioupm");
    segUP[playerid] = dini_Int(file, "Relogioups");
    TempoExp[playerid] = 0;
    if (Preso[playerid] == 0)
    {
        Preso[playerid] = 0;
    }
    if (Preso[playerid] == 1)
    {
        if (IsAdmin[playerid] > 0)
        {
            Preso[playerid] = 0;
        }
        if (GetPlayerWantedLevel(playerid) == 1)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 120000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 2)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 240000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 3)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 480000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 4)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 600000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 5)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 720000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 6)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 840000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
    }
    return 1;
}
Ah й, esqueci LOL;

Tenta:
pawn Код:
public OnPlayerSpawn(playerid)
{
    LogarProf(playerid);
    TextDrawShowForPlayer(playerid,UPRelogio[playerid]);
    TextDrawHideForPlayer(playerid, TEXT0);
    TextDrawHideForPlayer(playerid, TEXT1);
    TextDrawHideForPlayer(playerid, TEXT2);
    TextDrawHideForPlayer(playerid, TEXT3);
    TextDrawHideForPlayer(playerid, TEXT4);
    TextDrawHideForPlayer(playerid, ImagemConnect);
    GangZoneShowForPlayer(playerid, favela, Amarelo);
    GangZoneShowForPlayer(playerid, areadmlv, Branco);
    emcasa[playerid] = 0;
    minUP[playerid] = dini_Int(file, "Relogioupm");
    segUP[playerid] = dini_Int(file, "Relogioups");
    TempoExp[playerid] = 0;
    if (Preso[playerid] == 0)
    {
        Preso[playerid] = 0;
    }
    if (Preso[playerid] == 1)
    {
        if (IsAdmin[playerid] > 0)
        {
            Preso[playerid] = 0;
        }
        if (GetPlayerWantedLevel(playerid) == 1)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 120000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 2)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 240000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 3)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 480000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 4)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 600000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 5)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 720000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        else if (GetPlayerWantedLevel(playerid) == 6)
        {
            SetPlayerInterior(playerid, 6);
            Preso[playerid] = 1;
            GameTextForPlayer(playerid, "~w~PRESO!", 3000, 0);
            SetPlayerPos(playerid, 264.5996, 77.7367, 1001.0391);
            TempoPreso[playerid] = SetTimerEx("Liberar", 840000, false, "i", playerid);
            ResetPlayerWeapons(playerid);
        }
        if (CheckCasas(playerid) > 0)// || IsMorador(playerid) == 1)
        {
            CasaX[playerid] = dini_Int(conta, "CasaX");
            CasaY[playerid] = dini_Int(conta, "CasaY");
            CasaZ[playerid] = dini_Int(conta, "CasaZ");
            SetPlayerPos(playerid, CasaX[playerid], CasaY[playerid], CasaZ[playerid]);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)