[Ajuda]/abastecer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]/abastecer (
/showthread.php?tid=261694)
[Ajuda]/abastecer -
[Dk]TuReTOo - 14.06.2011
Boas, eu ao fazer /abastecer tipo ao abastecer 100% ele paga 10k como diminuo? nao consigo encontrar vejam
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/abastecer", cmdtext, true) == 0)
{
new Boolean:found = false;
for(new i=0; i < sizeof(FuelStationCoords); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 6.5, FuelStationCoords[i][0], FuelStationCoords[i][1], FuelStationCoords[i][2]))
{
found = true;
}
}
if(!found) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um posto de combustivel!");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo!");
else
{
new Float:cost = ((100.00 - VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]) * 100);
if(GetPlayerMoney(playerid) < cost)
{
new szOutput[128]; format(szOutput, sizeof(szOutput), "Vocк nгo tem dinheiro suficiente para abastecer o seu veiculo ($%i).", floatround(cost));
SendClientMessage(playerid, COLOR_RED, szOutput);
}
else
{
GivePlayerMoney(playerid, -(floatround(cost)));
VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL] = 100.00;
SendClientMessage(playerid, COLOR_BLUE, "Seu veнculo foi abastecido!");
}
}
return 1;
}
return 0;
}
agradeзo
Re: [Ajuda]/abastecer -
KevinsL - 14.06.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/abastecer", cmdtext, true) == 0)
{
new Boolean:found = false;
for(new i=0; i < sizeof(FuelStationCoords); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 6.5, FuelStationCoords[i][0], FuelStationCoords[i][1], FuelStationCoords[i][2]))
{
found = true;
}
}
if(!found) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um posto de combustivel!");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo!");
else
{
new Float:cost = ((100.00 - VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]) * 20); // diminui esse ultimo "100" coloquei pra 20
if(GetPlayerMoney(playerid) < cost)
{
new szOutput[128]; format(szOutput, sizeof(szOutput), "Vocк nгo tem dinheiro suficiente para abastecer o seu veiculo ($%i).", floatround(cost));
SendClientMessage(playerid, COLOR_RED, szOutput);
}
else
{
GivePlayerMoney(playerid, -(floatround(cost)));
VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL] = 100.00;
SendClientMessage(playerid, COLOR_BLUE, "Seu veнculo foi abastecido!");
}
}
return 1;
}
return 0;
}