[Ajuda] Bug no comando
#1

Alguйm desbuga este comando aqui pra mim, o erro dele й que quando vou fazer /darcomb [id] [quantia], o combustivel ele vem pra mim e nгo pro id selecionado.

PHP код:
if(strcmp(cmd"/darcomb"true) == 0){
new 
tmp[256];
new 
msg[256];
new 
petroleo;
new 
plidcomb;
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
format(filesizeof(file), PASTA_CONTASaname);
tmp strtok(cmdtextidx);
if(
dini_Int(file"Profissao") == Frentista || IsPlayerAdmin(playerid) || pAdmin[playerid] > 3){
if(!
strlen(tmp)){
SendClientMessage(playeridVermelho"[ERRO] Use: /darcomb [id] [litros]");
return 
1;
}
plid strval(tmp);
tmp strtok(cmdtextidx);
if(!
strlen(tmp)) {
SendClientMessage(playeridVermelho"[ERRO] Use: /darcomb [id] [litros]");
return 
1;
}
comb strval(tmp);
if(
comb 100 || comb <= 0){
SendClientMessage(playeridVermelho"[ERRO] Quantidade invбlida. Os valores devem ser de 1 а 100.");
return 
1;
}
if(
IsPlayerConnected(plid)){
new 
pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
format(file2sizeof(file2), PASTA_CONTASpname);
if((
dini_Int(file2"Combustivel") + comb) < 100){
format(msg,sizeof(msg),"(INFO) Um frentista abasteceu %d litros de combustнvel em seu tanque, totalizando %d litros",comb,petroleo);
SendClientMessage(plid,COLOR_GREEN,msg);
petroleo dini_Int(file2"Combustivel") + comb;
dini_IntSet(file2"Combustivel"petroleo);
SendClientMessage(plid,COLOR_GREEN,"(INFO) Agora nгo gaste atoa!")FOAgora nгo gaste atoa!");
SendClientMessage(playerid,COLOR_GREEN,"
(INFOCombustнvel fornecido.");
return 1;
}
else if((dini_Int(file2, "
Combustivel") + comb) >= 100){
dini_IntSet(file2, "
Combustivel", 100);
format(msg,sizeof(msg),"
(INFOUm Frentista completou seu tanquecolocando %d litros",petroleo);
petroleo = 100 - dini_Int(file2, "
Combustivel");
SendClientMessage(plid,COLOR_GREEN,msg);
SendClientMessage(plid,COLOR_GREEN,"
(INFOEconomize se nгo vai ficar a pй");
SendClientMessage(playerid,COLOR_GREEN,"
(INFOCombustivel fornecido.");
return 1;
}
}else{
SendClientMessage(playerid, Vermelho, "
[ERROJogador nгo conectado/logado.");
return 1;
}
}else{
SendClientMessage(playerid, Vermelho, "
[ERROVocк nгo tem permissгo!");
return 1;
}

Reply


Messages In This Thread
Bug no comando - by ZaturN - 15.12.2013, 19:57
Re: Bug no comando - by PT - 15.12.2013, 20:09
Re: Bug no comando - by bruxo00 - 15.12.2013, 20:16
Re: Bug no comando - by ZaturN - 15.12.2013, 20:30
Re: Bug no comando - by Petrick™ - 15.12.2013, 20:35
Re: Bug no comando - by ZaturN - 15.12.2013, 20:37
Re: Bug no comando - by PT - 15.12.2013, 20:46
Re: Bug no comando - by Petrick™ - 15.12.2013, 20:48
Re: Bug no comando - by bruxo00 - 15.12.2013, 21:06
Re: Bug no comando - by ZaturN - 15.12.2013, 21:07

Forum Jump:


Users browsing this thread: 1 Guest(s)