[Ajuda] Comando nгo estб 100% /multar
#1

Eu multo o player, mas nгo aparece o "MOTIVO" , a grana й cobrada do player, mas ela nгo vem pra mim. Quero que apareзa o MOTIVO, e eu ganha a grana. NГO Й GM DE ORGS. Me ajudem por favor.
PHP код:
if(strcmp(cmd"/multar"true) == 0

    new 
aname[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridanameMAX_PLAYER_NAME); 
    
format(filesizeof(file), P_CONTASaname); 
    if(
dini_Int(file"Profissao") == Policial_C || dini_Int(file"Profissao") == Policial_F || dini_Int(file"Profissao") == Marinha || dini_Int(file"Profissao") == Terrestre || dini_Int(file"Profissao") == Bope || dini_Int(file"Profissao") == Swat || dini_Int(file"Profissao") == Rotam || dini_Int(file"Profissao") == Policial_M || dini_Int(file"Profissao") == FBI || dini_Int(file"Profissao") == Interpol || IsPlayerAdmin(playerid)) 
 { 
        new 
plid
        new 
quant
        
tmp strtok(cmdtextidx); 
        if(!
strlen(tmp)) { 
            
SendClientMessage(playeridVermelho"* /multar [id] [quantidade] [motivo]"); 
            return 
1
        } 
        
plid strval(tmp); 
        
tmp strtok(cmdtextidx); 
        if(!
strlen(tmp)) { 
            
SendClientMessage(playeridVermelho"/multar [id] [quantidade][motivo]"); 
            return 
1
        } 
        
quant strval(tmp); 
        if(
quant 1000 || quant <= 0) { 
            
SendClientMessage(playeridVermelho"| ERRO | Valor de 0 б 1000R$."); 
            return 
1
        } 
        if(
IsPlayerConnected(plid)) { 
            if( 
GetPVarIntplayerid"TempoMultar" ) > GetTickCount() ) return SendClientMessageplayerid0xFF0000AA"| ERRO | Vocк sу pode multar a cada 1 minuto." ); 
            
SetPVarIntplayerid"TempoMultar"GetTickCount() + 60000 ); 
            new 
pname[MAX_PLAYER_NAME]; 
            
GetPlayerName(plidpnameMAX_PLAYER_NAME); 
            
format(filesizeof(file), P_CONTASpname); 
            
format(stringsizeof(string), "| INFO | Vocк recebeu uma multa de '%dR$'. Por '%s'."quantaname); 
            
SendClientMessage(plidCOLOR_GREENstring); 
            
SendClientMessage(playeridCOLOR_GREEN"| INFO | Multa aplicada com sucesso."); 
            new 
crg[256]; 
            
format(crgsizeof(crg), "| Policial | O(a) policial '%s' multou o jogador '%s'. Quantia: %dR$. Motivo: %s"anamepnamequant); 
            
Corregedor(0xC0C0C0AA,crg,1); 
            
dini_IntSet(file"SaldoBancario"dini_Int(file"SaldoBancario")- quant); 
            return 
1
        } 
        else { 
            
SendClientMessage(playeridVermelho"* O jogador nгo estб conectado!"); 
            return 
1
        } 
    } 

Reply
#2

testa ai pra ver
PHP код:
if(strcmp(cmd"/multar"true) == 0)
{
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridanameMAX_PLAYER_NAME);
    
format(filesizeof(file), P_CONTASaname);
    if(
dini_Int(file"Profissao") == Policial_C || dini_Int(file"Profissao") == Policial_F || dini_Int(file"Profissao") == Marinha || dini_Int(file"Profissao") == Terrestre || dini_Int(file"Profissao") == Bope || dini_Int(file"Profissao") == Swat || dini_Int(file"Profissao") == Rotam || dini_Int(file"Profissao") == Policial_M || dini_Int(file"Profissao") == FBI || dini_Int(file"Profissao") == Interpol || IsPlayerAdmin(playerid))
     {
        new 
plid;
        new 
quant;
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridVermelho"* /multar [id] [quantidade] [motivo]");
            return 
1;
        }
        
plid ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridVermelho"/multar [id] [quantidade] [motivo]");
            return 
1;
        }
        
quant strval(tmp);
        if(
quant 1000 || quant <= 0)
        {
            
SendClientMessage(playeridVermelho"| ERRO | Valor de 0 б 1000R$.");
            return 
1;
        }
        if(
IsPlayerConnected(plid))
        {
            if( 
GetPVarIntplayerid"TempoMultar" ) > GetTickCount() ) return SendClientMessageplayerid0xFF0000AA"| ERRO | Vocк sу pode multar a cada 1 minuto." );
            
SetPVarIntplayerid"TempoMultar"GetTickCount() + 60000 );
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /multar [id] [quantidade] [motivo]");
                return 
1;
            }
            new 
pname[MAX_PLAYER_NAME];
            
GetPlayerName(plidpnameMAX_PLAYER_NAME);
            
format(filesizeof(file), P_CONTASpname);
            
format(stringsizeof(string), "| INFO | Vocк recebeu uma multa de '%s'. Quantia: 'R$%s'. Motivo: %s."quantaname, (result));
            
SendClientMessage(plidCOLOR_GREENstring);
            
SendClientMessage(playeridCOLOR_GREEN"| INFO | Multa aplicada com sucesso.");
            new 
crg[256];
            
format(crgsizeof(crg), "| Policial | O(a) policial '%s' multou o jogador '%s'. Quantia: 'R$%s'. Motivo: %s."anamepnamequant, (result));
            
Corregedor(0xC0C0C0AA,crg,1);
            
dini_IntSet(file"SaldoBancario"dini_Int(file"SaldoBancario")- quant);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridVermelho"* O jogador nгo estб conectado!");
            return 
1;
        }
    }
    return 
1;

Reply
#3

@edit
Reply
#4

26 Erros.
Reply
#5

Quote:
Originally Posted by GabrielFerreira
Посмотреть сообщение
26 Erros.
pawn Код:
if(strcmp(cmd, "/multar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Marinha || dini_Int(file, "Profissao") == Terrestre || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || IsPlayerAdmin(playerid))
 {
        new plid;
        new quant;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, Vermelho, "* /multar [id] [quantidade] [motivo]");
            return 1;
        }
        plid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade][motivo]");
            return 1;
        }
        quant = strval(tmp);
        if(quant > 1000 || quant <= 0) {
            SendClientMessage(playerid, Vermelho, "| ERRO | Valor de 0 б 1000R$.");
            return 1;
        }
        if(IsPlayerConnected(plid)) {
            if( GetPVarInt( playerid, "TempoMultar" ) > GetTickCount() ) return SendClientMessage( playerid, 0xFF0000AA, "| ERRO | Vocк sу pode multar a cada 1 minuto." );
            SetPVarInt( playerid, "TempoMultar", GetTickCount() + 60000 );
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(plid, pname, MAX_PLAYER_NAME);
            format(file, sizeof(file), P_CONTAS, pname);
            format(string, sizeof(string), "| INFO | Vocк recebeu uma multa de '%dR$'. Por '%s'.", quant, aname);
            SendClientMessage(plid, COLOR_GREEN, string);
            SendClientMessage(playerid, COLOR_GREEN, "| INFO | Multa aplicada com sucesso.");
            new crg[256];
            format(crg, sizeof(crg), "| Policial | O(a) policial '%s' multou o jogador '%s'. Quantia: %dR$. Motivo: %s", aname, pname, quant);
            Corregedor(0xC0C0C0AA,crg,1);
            dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")- quant);
            GivePlayerMoney(plid, quant);
            return 1;
        }
        else {
            SendClientMessage(playerid, Vermelho, "* O jogador nгo estб conectado!");
            return 1;
        }
    }
}
Reply
#6

26 Erros ? isso й problemas em chaves, poste a linha do erro.
Reply
#7

olha o meu COD nгo retira o return da penъltima chave nгo e poste os erros pra nos vermos
Reply
#8

Ainda estб do mesmo jeito. Sem motivo... A grana conta, mais nгo vem pra mim.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)