else
{
quantia = MAX_GASOLINA_COMB - DOF2::GetInt(file, "Gasolina");
DOF2::SetInt(file, "Gasolina", MAX_GASOLINA_COMB);
format(string,60, "Tanque cheio, foram colocados %d Litros por %d$",pGasolinaZ,quantia);
}
#include <a_samp>
#include <DOF2>
#define VALOR_GASOLINA_COMB 2
#define MAX_GASOLINA_COMB 60
#define DIALOG_PGASOLINA 0
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/abastecer", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, DIALOG_PGASOLINA, DIALOG_STYLE_INPUT, "{C4C400}Gasolina", "Digite a Qunatia de gasolina \nO mбximo e 60 litros \nE custa 2$ o litro.", "Abastecer", "Cancelar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_PGASOLINA)
{
new aname[MAX_PLAYER_NAME],file[123];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new pGasolinaZ = strval(inputtext),
string[60],
quantia = pGasolinaZ*floatround(VALOR_GASOLINA_COMB);
if(DOF2::FileExists(file))
{
if(pGasolinaZ > MAX_GASOLINA_COMB || pGasolinaZ <= 0) return SendClientMessage(playerid, 0xFF0000AA, "Quantia Invбlida");
{
if(AreaPosto[playerid] == 1)
{
if(pGasolinaZ + DOF2::GetInt(file, "Gasolina") < MAX_GASOLINA_COMB)
{
DOF2::SetInt(file, "Gasolina", DOF2::GetInt(file, "Gasolina") + pGasolinaZ);
format(string,60, "* Vocк abastaceu %d Litros por %d$",pGasolinaZ,quantia);
}
else
{
quantia = MAX_GASOLINA_COMB - DOF2::GetInt(file, "Gasolina");
DOF2::SetInt(file, "Gasolina", MAX_GASOLINA_COMB);
format(string,60, "Tanque cheio, foram colocados %d Litros por %d$",pGasolinaZ,quantia);
}
GivePlayerGrana(playerid, - quantia);
SendClientMessage(playerid,Amarelo, string);
DOF2::SaveFile();
}
else SendClientMessageErro(playerid,Vermelho,"Vocк nгo esta em um posto de combustнvel.");
}
}
return 1;
}
return 1;
}
quantia = MAX_GASOLINA_COMB;
quantia = VALOR_GASOLINA_COMB
Vocк colocou a
pawn Код:
pawn Код:
|
GivePlayerGrana(playerid, - quantia * 2);
quantia = trunc(pGasolinaZ * VALOR_GASOLINA_COMB);
Nгo entendi muito bem seu problema, ele estб cobrando $1 por litro?
|
error: 017: undefined symbol "trunc"
quantia = pGasolinaZ * VALOR_GASOLINA_COMB;