10.11.2014, 18:10
Galera Estava Codando Meu Gm E Quando Fiz Um Comando /abastecer Prestei atenзгo que estava Bugado tipo: Eu Vou Com O Meu Character(Player) No Posto Sem Carro E digito / abastecer Eu Consigo abastecer mas sem estar com nenhum veiculo o meu Pawn Code й Esse
Pawn Code
Se Alguem Poder me Ajudar . Grato Desde Jб
Pawn Code
Quote:
|
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, "** Uso: /abastecer [litros]"); return 1; } quantidade = strval(tmp); if(quantidade <= 0 || GetPlayerGrana(playerid) < quantidade){ SendClientMessage(playerid, Vermelho, "** Vocк nгo tem dinheiro suficiente para pagar o frentista."); return 1; } if(AreaPosto[playerid] == 1){ if(quantidade + dini_Int(file, "Combustivel") < 100){ dini_IntSet(file, "Combustivel", dini_Int(file, "Combustivel") + quantidade); format(string, sizeof(string), "* Vocк completou seu tanque com %d litros de combustнvel.", quantidade); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerGrana(playerid, - quantidade); return 1; } if(quantidade + dini_Int(file, "Combustivel")){ new quantia; quantia = 100 - dini_Int(file, "Combustivel"); dini_IntSet(file, "Combustivel", 100); format(string, sizeof(string), "* Pronto, tanque cheio foram colocados %d litros.", quantia); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerGrana(playerid, - quantia); return 1; } }else{ SendClientMessage(playerid, Vermelho, "** Vocк nгo estб no posto."); return 1; } } |


