[AJUDA] Passar estes 2 comandos para Zcmd sscanf2
#1

Bom to trabalhando com gf, mas nгo gosto de usar strcmp entao vou comeзar a usar zcmd e sscanf2..
Alguem pode passar estes comandos para zcmd e sscanf2?

PHP код:
    if(!strcmp(cmd"/logar"true))
    {
        if(
IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
        {
            new 
tmppass[64];
            if(
Logado[playerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY" Vocк jб estб logado.");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCINZA1"USE: /logar [Senha]");
                return 
1;
            }
            
strmid(tmppasstmp0strlen(cmdtext), 255);
            
LogarPlayer(playerid,tmppass);
        }
        return 
1;
    }
    if(!
strcmp(cmd"/registrar"true))
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
Logado[playerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY" Vocк jб estб logado.");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(string64"Players/%s.ini"sendername);
            new 
FilehFile fopen(stringio_read);
            if (
hFile)
            {
                
SendClientMessage(playeridAMARELO"Este Nick jб existe, use outro.");
                
fclose(hFile);
                return 
1;
            }
            new 
tmppass[64];
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCINZA1"USE: /registrar [Senha]");
                
SendClientMessage(playeridAMARELO"-==> Use Nome_Sobrenome ( Ex: Guru_Josh ) <==-");
                return 
1;
            }
            
strmid(tmppasstmp0strlen(cmdtext), 255);
            
RegistrarPlayer(playerid,tmppass);
        }
        return 
1;
    } 
Reply
#2

alguem?
Reply
#3

Quote:
Originally Posted by tonisantolia
Посмотреть сообщение
alguem?
tenta:

pawn Код:
CMD:logar(playerid, params[])
    {
        if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
        {
            new tmppass[64];
            if(Logado[playerid] == 1) return  SendClientMessage(playerid, COLOR_GREY, " Vocк jб estб logado.");
            if(sscanf(params,"s",tmppass)) return SendClientMessage(playerid, CINZA1, "USE: /logar [Senha]");
            LogarPlayer(playerid,tmppass);
        }
        return 1;
    }
   
    CMD:registrar(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(Logado[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, " Vocк jб estб logado.");

            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 64, "Players/%s.ini", sendername);
            new File: hFile = fopen(string, io_read);
            if (hFile)
            {
                SendClientMessage(playerid, AMARELO, "Este Nick jб existe, use outro.");
                fclose(hFile);
                return 1;
            }
            new tmppass[64];
            if(sscanf(params,"s",tmppass))
            {
                SendClientMessage(playerid, CINZA1, "USE: /registrar [Senha]");
                SendClientMessage(playerid, AMARELO, "-==> Use Nome_Sobrenome ( Ex: Guru_Josh ) <==-");
                return 1;
            }
            RegistrarPlayer(playerid,tmppass);
        }
        return 1;
    }
Reply
#4

4 erros..
PHP код:
C:\Documents and Settings\Rodrigues Іє№І\Desktop\RPG\gamemodes\BCS.pwn(157) : error 029invalid expressionassumed zero
C
:\Documents and Settings\Rodrigues Іє№І\Desktop\RPG\gamemodes\BCS.pwn(157) : error 017undefined symbol "cmd_logar"
C:\Documents and Settings\Rodrigues Іє№І\Desktop\RPG\gamemodes\BCS.pwn(157) : error 029invalid expressionassumed zero
C
:\Documents and Settings\Rodrigues Іє№І\Desktop\RPG\gamemodes\BCS.pwn(157) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors

PHP код:
    CMD:logar(playeridparams[]) 
Reply
#5

Vc с tб pondo isso dentro da public OnPlayerCommandText nao nй?
Reply
#6

fail meu... sou iniciante em zcmd '-'
Reply
#7

Coloque o comando de ZCMD em qualquer lugar do gamemode,
menos dentro de alguma public ou funзгo.
Reply
#8

Mas agora o problema e que quando inicio o samp server aparece isso nele
PHP код:
Script[gamemodes/BCS.amx]: Run time error 19"File or function is not found"
[01:38:27Number of vehicle models
alguem sabe porque?
Reply
#9

Colocou o plugin sscanf no server.cfg?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)