SA-MP Forums Archive
[Ajuda] /q em Sequestro. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] /q em Sequestro. (/showthread.php?tid=444056)



/q em Sequestro. - DannielCooper - 14.06.2013

Olб galera do Fуrum Samp, eu gostaria de apelar pra ajuda de vocкs em uma um sistema, que eu estou criando, que quando o Player dб /q em Sequestro, quando ele volta ele vai altomaticamente pro Carandiru por 30 minutos.

Onde avisa que ele disconecta:
pawn Код:
if(Sequestrado[playerid] == 1)
        {
        GetPlayerName(playerid, nome, sizeof(nome));
        format(string, sizeof(string), "[AVISO]: O player %s deu /q em sequestro. Quando voltar serб punido.",nome);
        SendClientMessageToAll(COR_AZUL, string);
        Sequestrado[playerid] = 0;
        Amarrado[playerid] = 0;
        SaiuSeq[playerid] = 1;
        TogglePlayerControllable(playerid, 1);
        }
        return 1;
}
Onde ele conecta:

pawn Код:
if(SaiuSeq[playerid] == 1)
    {
        GetPlayerName(playerid, nome, sizeof(nome));
        format(string, sizeof(string), "[AVISO] A vitima %s ID:[%d] que deu /q no sequestro estб online e foi preso!",nome, playerid);
        SendClientMessageToAll(COR_VERMELHOCLARO, string);
        GameTextForPlayer(giveplayerid, "~b~Bem Vindo ao ~n~~r~Carandiru", 5000, 3);
        ResetPlayerWeaponsEx(giveplayerid);
        WantedPoints[giveplayerid] = 0;
        SetPlayerWantedLevel(giveplayerid, 0);
        PlayerInfo[giveplayerid][pJailed] = 2;
        PlayerInfo[giveplayerid][pJailTime] = 30;
        SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
        SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453);
        }
        return 1;
}
Eu sei que o erro estб no code de quando ele conecta, sу quero saber onde exatamente... :P

Obs: Nгo dб erro nenhum, o Pawno fecha.


Re: /q em Sequestro. - Delete_ - 14.06.2013

tira o return


Re: /q em Sequestro. - BielCOP - 14.06.2013

pawn Код:
// Topo do GM

new Sequestrado[MAX_PLAYERS];
new SaiuSequestro[MAX_PLAYERS];

new Fala[128];

// OnPlayerConnect

format(Fala,sizeof(Fala),"Sequestrados/%s.ini",PlayerName(playerid));

if(DOF2_FileExists(Fala))
{
    SaiuSequestro[playerid] = 1;
    DOF2_RemoveFile(Fala);
}

// OnPlayerDisconnect

if(Sequestrado[playerid] = 1)
{
    format(Fala,sizeof(Fala),"Sequestrados/%s.ini",PlayerName(playerid));
    DOF2_CreateFile(Fala);
}
Sequestrado[playerid] = 0;
SaiuSequestro[playerid] = 0;

// OnPlayerSpawn

if(SaiuSequestro[playerid] == 1)
{
    // Funcoes da cadeia aqui
   
    SaiuSequestro[playerid] = 0;
    return 1;
}

// OnPlayerDeath

if(Sequestrado[playerid] == 1)
{
    Sequestrado[playerid] = 0;
}

// Comando

Sequestrado[playerid] = 1;
Seu erro foi usar GIVEPLAYERID onde vocк ao menos definiu esta variбvel.

Espero ter ajudado


Re: /q em Sequestro. - Wellington1999 - 14.06.2013

#Edit
n prestei atenзao no post mais acho q й o return


Re: /q em Sequestro. - DannielCooper - 14.06.2013

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
Seu erro foi usar GIVEPLAYERID onde vocк ao menos definiu esta variбvel.

Espero ter ajudado
O problema nгo й as definiзхes, e no seu comando tem coisas de errado, revisa ele aн..


Re: /q em Sequestro. - BielCOP - 14.06.2013

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
O problema nгo й as definiзхes, e no seu comando tem coisas de errado, revisa ele aн..
Eu que estou te ajudando e eu que tenho que revisar cуdigo ?




Re: /q em Sequestro. - MonFiTy - 14.06.2013

tente
pawn Код:
if(SaiuSeq[playerid] == 1)
    {
        GetPlayerName(playerid, nome, sizeof(nome));
        format(string, sizeof(string), "[AVISO] A vitima %s ID:[%d] que deu /q no sequestro estб online e foi preso!",nome, playerid);
        SendClientMessageToAll(COR_VERMELHOCLARO, string);
        GameTextForPlayer(giveplayerid, "~b~Bem Vindo ao ~n~~r~Carandiru", 5000, 3);
        ResetPlayerWeaponsEx(giveplayerid);
        WantedPoints[giveplayerid] = 0;
        SetPlayerWantedLevel(giveplayerid, 0);
        PlayerInfo[giveplayerid][pJailed] = 2;
        PlayerInfo[giveplayerid][pJailTime] = 30;
        SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
        SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453);
        }
retire os
pawn Код:
return 1;
}



Re: /q em Sequestro. - DannielCooper - 14.06.2013

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
Eu que estou te ajudando e eu que tenho que revisar cуdigo ?

Vocк tem que revisar seus cуdigos e ler o tуpico. Nos meus codes nгo pedia nada de OnPlayerDeath. Nem de nada de comando. Seu code deu 16 errors ainda.


Re: /q em Sequestro. - BielCOP - 15.06.2013

Adapte ao teu gamemode, te dei uma base cara.


Re: /q em Sequestro. - DannielCooper - 15.06.2013

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
Adapte ao teu gamemode, te dei uma base cara.
Nгo й adaptar, й praticamente fazer nй? rs.