[Ajuda] Como coloca o motivo ?
#1

Ae queria colocar tipo /multar (id) (quantia) (motivo) Falta so o motivo, alguem min ajuda porfavor ?

Quote:

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") == Recruta || 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 || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "pAdm01") == 1 || IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
new quant;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Branco, "({FF0000}ERRO{FFFFFF}) Use: /multar [id] [quantidade]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Branco, "({FF0000}ERRO{FFFFFF}) Use: /multar [id] [quantidade]");
return 1;
}
quant = strval(tmp);
if(quant > 1000 || quant <= 0){
SendClientMessage(playerid, Vermelho, "» Valor de 0 a 1000 R$.");
return 1;
}
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), P_CONTAS, pname);
format(string, sizeof(string), "» Vocк recebeu uma multa de R$%d Pelo policial %s . O dinheiro foi retirado do banco.", quant, aname);
SendClientMessage(plid, COLOR_GREEN, string);
SendClientMessage(playerid, COLOR_GREEN, "» Multa dada.");
dini_IntSet(file2, "SaldoBancario", dini_Int(file2, "SaldoBancario")- quant);
return 1;
}
else{
SendClientMessage(playerid, Vermelho, "» O jogador nгo estб conectado!");
return 1;
}
}
}

Reply
#2

Ajuda ae porvafor ?
Reply
#3

pawn Код:
CMD:multar(playerid, params[])
{
    if(!PlayerPolicial(playerid)) return SendClientMessage(playerid,COR_RED,"Vocк nгo й um policial!");
    new id,motivo,quantia;
    if(sscanf(params,"us[50]d",id,motivo,quantia)) return SendClientMessage(playerid,ERRO,"Use: /multar [id] [motivo] [quantia]");
    if(id == playerid) return SendClientMessage(playerid,ERRO,"Vocк nгo pode usar esse comando em vocк mesmo!");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,C_MSG,"Jogador nгo conectado!");
    if(PlayerInfo[id][Algemado] == 0) return SendClientMessage(playerid,C_MSG,"O jogador precisa estб algemado para vocк multб-lo!");
    GivePlayerMoney(id, -quantia);
    new msg1[200], msg2[200], msg3[200];
    GameTextForPlayer(id, "~b~MULTADO!", 3000, 0);
    format(msg1,sizeof(msg1),"(MULTADO) O policial %s multou vocк! Valor: R$ %d | Motivo: %s", getName(playerid),quantia,motivo);
    SendClientMessage(id,0x0000FFFF,msg1);
    format(msg2,sizeof(msg2),"(MULTA) Multa aplicada com sucesso!");
    SendClientMessage(playerid,0x0000FFFF,msg2);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][Admin] >=1)
        {
            format(msg3,sizeof(msg3),"(Admin) O policial %s multou %s! Valor: %d | Motivo: %s",getName(playerid),getName(id),quantia,motivo);
            SendClientMessage(i,LCLARO,msg3);
        }
    }
    return true;
}

forward PlayerPolicial(playerid); // Coloque essa forward no topo do gm
public PlayerPolicial(playerid)
{
    if(PlayerProf[playerid] == PROFISSAO_QUE_VAI_USAR_O_CMD|| ROTAM|| Militar || PlayerInfo[playerid][Admin] >= 1)
    {
            return true;
    }
    return false;
}
Isto acima й em SII, se quiser veja oque no seu nгo tem e no que o cуdigo tem e modifique ao seu gosto.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)