SA-MP Forums Archive
[Ajuda] Criar - funзвo - 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] Criar - funзвo (/showthread.php?tid=506354)



Criar - funзвo - TheLove - 12.04.2014

Olб forum sa-mp
tipo eu criei esse comando agora quero criar um
que pega os crash.
Exemplo:
eu libero o cуdigo 136A-F945-A241 ai vo la na
DIALOG_STYLE_INPUT digito o cуdigo e recebo os Crash
PlayerInfo[playerid][pCrash] += 100;
Agradeзo desde ja



Код:
if(strcmp(cmd, "/liberarcodigo", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new Crash[128];
            new Crash1[128];
            Crash = strtok(cmdtext,idx);
            if(!strlen(Crash))
            {
                SendClientMessage(playerid,COLOR_WHITE,"USE: /liberarcodigo [CУDIGO]");
                return true;
            }
            if (PlayerInfo[playerid][pAdmin] >= 8)
            {
                new string3[100];
                format(string3, sizeof(string3), "CodigosCrash/%s.ini", Crash);
                if(dini_Exists(string3))
                {
                    SendClientMessage(playerid,COLOR_GRAD1,"Este cуdigo jб estб liberado!");
                    return true;
                }
                else
                {
                    format(Crash1,sizeof(Crash1),"CodigosCrash/%s.ini",Crash);
                    dini_Create(Crash1);
                    format(string, sizeof(string), "Vocк liberou o cуdigo: %s", Crash);
                    SendClientMessage(playerid, COLOR_LIGHTRED, string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб autorizado a usar este comando!");
            }
        }
        return true;
    }