[Ajuda] 2 Bugs do Nada --'
#1

vomo logo ao assunto. o gm estava ocorrendo tudo bem do nada cmз a buga o combustivel, eo cmd /trocarnick & /liberarnick.

tipo o Combustivel, eu vo no posto uso /abastecer [quantia] ai aparecer que abasteceu.. mais quando entro em um carro fala que nгo tenho Combustivel qual problema?

Cmd Combostivel.
pawn Code:
if(strcmp(cmd, "/abastecer", true) == 0) {
new tmp[256];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new quantidade;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Uso: /abastecer [litros]");
return 1;
}
quantidade = strval(tmp);
if(quantidade <= 0 || GetPlayerGrana(playerid) < quantidade){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente para pagar o frentista.");
return 1;
}
if(AreaPosto[playerid] == 1){
if(quantidade + DOF2_GetInt(file, "Combustivel") < 100){
DOF2_SetInt(file, "Combustivel", DOF2_GetInt(file, "Combustivel") + quantidade);
format(string, sizeof(string), "(INFO) Vocк completou seu tanque com %d litros de combustнvel.", quantidade);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerGrana(playerid, - quantidade);
return 1;
}
if(quantidade + DOF2_GetInt(file, "Combustivel")){
new quantia;
quantia = 100 - DOF2_GetInt(file, "Combustivel");
DOF2_SetInt(file, "Combustivel", 100);
format(string, sizeof(string), "(INFO) Pronto tanque cheio foram colocados %d litros.", quantia);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerGrana(playerid, - quantia);
return 1;
}
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб no posto.");
return 1;
}
}
o trocar nick tbm ocorria tudo bem.. ai ontem fui usa o cmd /liberarnick [ID] ai fala que libero talz.. mais quando o player usa /trocarnick dps que jah tб liberado continua falando que ele nгo tem permiзгo.. sendo que eu jah liberei ele.

cmd /trocarnick & /liberarnick

/liberarnick
pawn Code:
if(strcmp(cmd, "/liberarnick", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /liberarnick [id]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
DOF2_SetInt(file2, "MN", 1);
format(string, sizeof(string), "(INFO) Vocк liberou o jogador %s mudar de nick!", aname, playerid, pname);
SendClientMessage(playerid, Blue, string);
format(string, sizeof(string), "(INFO) O administrador %s (ID: %d) liberou vocк mudar de nick!", aname, playerid);
SendClientMessage(plid, Amarelo, string);
GameTextForPlayer(plid, "~r~/trocarnick", 8000, 3);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido");
return 1;
}
}
}
/trocarnick
pawn Code:
if(strcmp(cmdtext, "/trocarnick", true) == 0){
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, GetName(playerid));
    if(PlayerInfo[playerid][Logged] == 0){
        SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб logado(a).");
        return 1;
    }
    if(DOF2_GetInt(file, "MN") == 1){
        ShowPlayerDialog(playerid,mudarnick , DIALOG_STYLE_INPUT, "Trocando de Nick", "Digite seu novo nick e clique em  \"Mudar\". \n\n~ BCL RPG!.", "Mudar", "Sair");
    }else{
        SendClientMessage(playerid, Vermelho, "(ERRO) Pessa a um admin para te liberar a mudar de nick!");
    }
    return 1;
}
tava indo td bem.. do nd paro.
vii o code nгo vi nd de erro talz, quem pode ajuda agradeзo! .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)