Portal SAMP
[Ajuda] Alfa Numerico - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP Mobile (https://portalsamp.com/forumdisplay.php?fid=11)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=12)
+--- Tópico: [Ajuda] Alfa Numerico (/showthread.php?tid=2956)



Alfa Numerico - AztecaJr - 02/11/2022

Tenho um sistema de troca de nick na gm, e percebi que quem joga no android consegue colocar qualquer fonte, por exemplo esse cidadão kkk:
ZICRACK

E claro que isso acaba bugando o sistema de contas, então a minha dúvida é se teria alguma forma de barrar isso e permitir somente a fonte comum do jogo


RE: Alfa Numerico - xbruno1000x - 02/11/2022

Manda o código do sistema de troca de nick.


RE: Alfa Numerico - AztecaJr - 02/11/2022

(02/11/2022 17:54)xbruno1000x Escreveu: Manda o código do sistema de troca de nick.

Código PHP:
CMD:mudarnick(playeridparams[])
{
    if (APlayerData[playerid][LoggedIn] != true) return SendClientMessage(playerid, -1"{FFFF00}[ERRO]: {009D4F}Você não está logado!");
    if (MudarNick[playerid] != 1) return SendClientMessage(playerid, -1"{FF0000}[ERRO] Peça para um administrador lhe autorizar a mudar seu nick");
    if (APlayerData[playerid][PlayerScore] < 500) return SendClientMessage(playerid0xFFFFFFFF"{FF0000}Você precisa ter mais de 500 pontos para trocar de nick!");
    new File[90], NovoNick[24], str[150];
    GetPlayerName(playeridNovoNicksizeof(NovoNick));
    if(sscanf(params,"s[24]"NovoNick)) return SendClientMessage(playerid0x00FF99AA"{FFFF00}[INFO]: {FF0000}/mudarnick [novo nick]"), SendClientMessage(playerid0x00FF99AA"{FF0000}Obs: Isso lhe custará R$ 3.000.000");
    new Name[50], del[128];
    GetPlayerName(playeridNamesizeof(Name));
    if(strlen(params) < 3) return SendClientMessage(playerid,-1,"{FF0000}[ERRO]: Tamanho incorreto (Muito pequeno)");
    if(strlen(params) > 20) return SendClientMessage(playerid,-1,"{FF0000}[ERRO]: Tamanho incorreto (Muito grande)");
    for(new asdasd sizeof(badnames); ++asd)
    {
        if(strfind(NovoNick,badnames[asd]) != -1)
        {
            return SendClientMessage(playerid,-1,"{FF0000}[ERRO] Nick Invalido!");
        }
    }

    format(Filesizeof(File), "ServerData/Players/%s.ini"NovoNick);
    format(strsizeof(str), "ServerData/Players/%s.ini"Name);
    if(fexist(File)) return SendClientMessage(playerid, -1"{FF0000}[ERRO] Este nick ja está sendo usado!");
    SendClientMessage(playerid, -1" ");
    format(del,sizeof(del),"Nick trocado com sucesso para: {FFFF00}%s "NovoNick);
    SendClientMessage(playerid0xFF0000AAdel);
    SendClientMessage(playerid, -1"{FFFF00}Não esqueça seu nick novo.");
    SendClientMessage(playerid, -1"{FF0000}O SERVIDOR NÃO SE REPONSABILIZA PELO MAL USO DO COMANDO!");
    SendClientMessage(playerid, -1" ");
    new fp[50],sip[20];
    GetPlayerIp(playeridsip,20);
    format(fp,sizeof(fp),"IPLogger/%s.ini",sip);
    DOF2_SetString(fp,"Nick"NovoNick);
    DOF2_SaveFile();
    new parq2[50],acv[80],acn[80];
    format(parq,sizeof(parq),"playerspos/%s.ini",Name);
    format(parq2,sizeof(parq2),"playerspos/%s.ini",NovoNick);
    DOF2_RenameFile(parqparq2);
        format(acv,sizeof(acv),"Player Objects/%s.ini",Name);
    format(acn,sizeof(acn),"Player Objects/%s.ini",NovoNick);
    DOF2_RenameFile(acvacn);
    DOF2_RenameFile(strFile);

    CallRemoteFunction("trocarnickclan","ds",playerid,NovoNick);

    SetPlayerName(playeridNovoNick);
    APlayerData[playerid][PlayerName] = NovoNick;
    if(APlayerData[playerid][PlayerLevel] >= 1)
    {
    RemoveVagaAdmin(Name);
    SetVagaAdmin(NovoNickAPlayerData[playerid][PlayerLevel]);
    }
    PlayerFile_Save(playerid);
    format(Filesizeof(File), PlayerFileName);
    if (fexist(File))
        fremove(File);
    format(Filesizeof(File), BankFileName);
    if (fexist(File))
    {
        BankFile_Save(playerid);
        fremove(File);
    }
    BankFile_Load(playerid);
                        //----------------------[Casa do Jogador]------------------------------------------//
    new HouseIDBusID;
    for (new HouseSlotHouseSlot MAX_HOUSESPERPLAYERHouseSlot++)
    {
        HouseID APlayerData[playerid][Houses][HouseSlot];
        if (HouseID != 0)
        {
            AHouseData[HouseID][Owned] = true;
            format(AHouseData[HouseID][Owner], 24NovoNick);
            HouseFile_Save(HouseID);
            House_UpdateEntrance(HouseID);
            House_RemoveVehicles(HouseID);
            HouseFile_Load(HouseIDtrue);
        }
    }
                        //----------------------[Empresa do Jogador]--------------------------------------------//
    for (new BusSlotBusSlot MAX_BUSINESSPERPLAYERBusSlot++)
    {
        BusID APlayerData[playerid][Business][BusSlot];
        if (BusID != 0)
        {
            ABusinessData[BusID][Owned] = true;
            format(ABusinessData[BusID][Owner], 24NovoNick);
            BusinessFile_Save(BusID);
            Business_UpdateEntrance(BusID);
        }
    }

    new diamesanohorasminutossegundos;
    getdate(diamesano);
    gettime(horasminutossegundos);
    for (new 
iMAX_PLAYERSi++)
    {
        if (
APlayerData[i][PlayerLevel] >= 1)
        {
        
    new Msg[128];
            
format(Msg128"{FFFF00}[ATENÇÃO] {33CCFF}%s (id: %i) mudou seu nick para %s"NameplayeridNovoNick);
            
SendClientMessage(i0xFFFFFFFFMsg);
        }
    }
    format(del200"Player %s mudou seu nick para %s, DATA: %d/%d/%d HORA: %d:%d:%d"NameNovoNickanomesdiahorasminutossegundos);
    EscreverLog("Logs/MudaramNick.log"del);
    SetPlayerName(playeridNovoNick);
    new pStr2[60], String7[50] ;
    if (APlayerData[playerid][PlayerLevel] >= 1)
        {
    format(String7sizeof(String7), "ServerData/Admins/%s.ini"Name);
    format(pStr245"ServerData/Admins/%s.ini"NovoNick);
    DOF2_RenameFile(String7pStr2);
    DOF2_SaveFile();
}

    PlayerFile_Save(playerid);
    MudarNick[playerid] = 0;

    return 
true;