[Ajuda] Comando /multar
#1

Preciso de ajuda, quando eu digito /multar [ID] [QUANTIDADE] [MOTIVO], eu nгo ganho o valor da multa, й cobrado do player, mas eu nгo ganho a grana.
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

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);
            
GivePlayerMoney(playeridquant);
            return 
1;
        }
        else {
            
SendClientMessage(playeridVermelho"* O jogador nгo estб conectado!");
            return 
1;
        }
    }

Reply
#3

O MOTIVO nгo estб aparecendo, e a grana conta , e some .
Reply
#4

й por que vocк tem algum ant money, procura pela variaval do seu money e troca .

geralmente й
PHP код:
GivePlayerGrana 
Reply
#5

Eu troquei tudo por GivePlayerMoney , e deu vбrios erros.
Qual o lugar exato pra mim mudar ?
Reply
#6

Amigo se o SV for rpg de bater cartao aqui os codigos
MULTA

PHP код:
    if(strcmp(cmd"/multar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(!
IsACop(playerid))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й um policial!");
                return 
1;
            }
            if(
OnDuty[playerid] != 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo Bateu o cartгo!");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /multar [ID] [Custo] [Razao]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /multar [ID] [Custo] [Razao]");
                return 
1;
            }
            
moneys strval(tmp);
            if(
moneys 1000 || moneys 30000) { SendClientMessage(playeridCOLOR_GREY"Custo entre 1000 e 30000 !"); return 1; }
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
IsACop(giveplayerid))
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode multar Policiais!");
                    return 
1;
                }
                if(
PlayerInfo[giveplayerid][pJailed] > 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode multar jogadores que estejam presos!");
                    return 
1;
                }
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    if (
ProxDetectorS(25.0playeridgiveplayerid))
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        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] [Custo] [Razao]");
                            return 
1;
                        }
                        
format(stringsizeof(string), "* Vocк multou %s por $%d, Razao: %s"giveplayermoneys, (result));
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "* Oficial %s lhe deu uma multa no valor de $%d, Razao: %s"sendernamemoneys, (result));
                        
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                        
SendClientMessage(giveplayeridCOLOR_LIGHTRED"* Use /aceitar multa, para aceita-la.");
                        
SendClientMessage(giveplayeridCOLOR_LIGHTRED"* Se em 5 minutos vocк nгo pagar, irб preso!");
                        
TicketOffer[giveplayerid] = playerid;
                        
TicketMoney[giveplayerid] = moneys;
                        
SetTimerEx("PresoMulta"300000false"i"giveplayerid);
                        return 
1;
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"O jogador estб longe !");
                        return 
1;
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"O jogador estб Offline !");
                return 
1;
            }
        }
        return 
1;
    } 
Se nгo tiver bater cartao adicione
PHP код:
    if(strcmp(cmd"/batercartao"true) == 0)
    {
        if(
PlayerInfo[playerid][pJailed] != 0)
        {
               
SendClientMessage(playerid,COLOR_YELLOW," voce nao esta em local de bater cartao!");//
            
return true;
        }
        if(
IsPlayerConnected(playerid))
        {
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsACop(playerid))
            {
                
//₢ORDENARDAS if (PlayerToPoint(2, playerid,255.2998,77.5604,1003.6406) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,232.1218,162.1216,1003.0234) || PlayerToPoint(2, playerid,-2620.0579,-26.4158,4.1744) ||  PlayerToPoint(2, playerid,-1162.0723,-126.3712,14.2418)
                
|| PlayerToPoint(2playerid,-2111.2493,-757.3846,32.2159) ||  PlayerToPoint(2,playerid,-2071.8071,-251.4861,35.3203) || PlayerToPoint(2,playerid,326.5193,307.0409,999.1484) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(
OnDuty[playerid]==0)
                    {
                        
format(stringsizeof(string), "Oficial %s bateu o cartгo e estб em serviзo,digite /servico policia."sendername);
                        
OOCNews(COLOR_DBLUE,string);
                        
//SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
                        
SetPlayerArmour(playerid100);
                        
SetPlayerHealth(playerid100);
                        
ShowPlayerDialog(playerid,18021,DIALOG_STYLE_INPUT,"{FFFFFF}Troca De Skins" "{FFFFFF}Digite O ID Da Sua\n{FFFFFF} Skin De Trabalho\n" "Ok" "Cancelar");
                        
OnPlayerCommandText(playerid,"/equipar");
                        
OnDuty[playerid] = 1;
                        
EmpregoDuty[playerid] = 2;
                        
Copsronda += 1;
                    }
                    else if(
OnDuty[playerid]==1)
                    {
                        
format(stringsizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados."sendername);
                        
OOCNews(COLOR_DBLUE,string);
                        
//RemovePlayerAttachedObject(playerid,3);
                        
OnDuty[playerid] = 0;
                        
EmpregoDuty[playerid] = 0;
                        
Copsronda -= 1;
                    }
                }
            
//    else
                
{
                    
SendClientMessage(playeridCOLOR_GRAD2"");
                    return 
true;
                }
            }
            }
        return 
true;
    } 
DEU ERROR ?ME CHAMA PRIVATO!

Sгo Paulo Style RPG : 74.63.198.171:6639 : San Fierro !
Reply
#7

Olha, o meu nгo й de ORGS, й de profissхes .
Reply
#8

Alguem ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)