[AJUDA]Comando
#1

Alguem sabe como faзo para aprender as drogas ex do geito q esta ai ta tirando -5 ok mais c o jogador tiver 4 vai tirar -5 do msm geito tipo vai ficar negativo tipo tinha q ser um dini_Remove nem sei c da mais c alguem souber ai me ajuda

Код:
if(strcmp(cmd, "/pdrogas", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, " Digite /pdrogas [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, " Alguem estб dentro de um carro.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "| INFO | Jogador nгo conectado.");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "| INFO | O policial %s apreendeu suas Drogas.", aname);
SendClientMessage(plid, Vermelho, string);
dini_IntSet(file, "Maconha", dini_Int(file, "Maconha")-5);
dini_IntSet(file, "Crack", dini_Int(file, "Crack")-5);
dini_IntSet(file, "Cocaina", dini_Int(file, "Cocaina")-5);
SendClientMessage(playerid, COLOR_GREEN, "| INFO | Drogas Apreendidas.");
return 1;
} else {
SendClientMessage(playerid,Vermelho," Chegue mais perto para apreender As Drogas.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"| INFO | Vocк nгo й um policial!");
return 1;
}
}
Reply
#2

pawn Код:
dini_IntSet(file, "Maconha", 0);
dini_IntSet(file, "Crack", 0);
dini_IntSet(file, "Cocaina", 0);
Assim irб resetar as drogas, x)
Reply
#3

Ricop Grato pela atencao mais ja tentei colocar ,0) mais da erros

: warning 202: number of arguments does not match definition
: error 001: expected token: ",", but found ";"
: warning 202: number of arguments does not match definition
: warning 202: number of arguments does not match definition
: error 001: expected token: ",", but found ";"

2 Errors.

Sabe oq й ?
Reply
#4

Poste as linhas dos erros.
Reply
#5

Testa ae
pawn Код:
if(!strcmp(cmd, "/pdrogas", true))
{
    new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[0x80], plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, " Digite /pdrogas [id]");
        plid = strval(tmp);
        if(IsPlayerInAnyVehicle(plid) || IsPlayerInAnyVehicle(playerid) == 1) return SendClientMessage(playerid, Vermelho, " Alguem estб dentro de um carro.");
        if(!IsPlayerConnected(plid)) return SendClientMessage(playerid, Vermelho, "| INFO | Jogador nгo conectado.");
        if(GetDistanceBetweenPlayers(plid,playerid) > 10) return SendClientMessage(playerid,Vermelho," Chegue mais perto para apreender As Drogas.");
        format(string, sizeof(string), "| INFO | O policial %s apreendeu suas Drogas.", aname);
        SendClientMessage(plid, Vermelho, string);
        dini_IntSet(file, "Maconha", 0);
        dini_IntSet(file, "Crack", 0);
        dini_IntSet(file, "Cocaina", 0);
        SendClientMessage(playerid, COLOR_GREEN, "| INFO | Drogas Apreendidas.");
        return 0x01;
    }
    else return SendClientMessage(playerid,Vermelho,"| INFO | Vocк nгo й um policial!");
    return 0x01;
}
Reply
#6

й pq estб faltando ";" mostra as linhas
Reply
#7

Ops falta de atenзao nao fiz como Ricop falo dini_IntSet(file, "Maconha", 0); fiz de outro geito por isso nao funfo
Agora copilo certinho valeu Ricop e a td ai Obrigado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)