07.11.2011, 01:27
pawn Код:
if(strcmp(cmd, "/abastecer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtGasStation(playerid))
{
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Abastecendo, Aguarde!",2000,3);
SetTimer("Fillup",RefuelWait,0);
TogglePlayerControllable(playerid, 0);
Refueling[playerid] = 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY," Vocк nгo estб em um posto de Gasolina");
}
}
return 1;
}
pawn Код:
public Fillup(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new VID;
new FillUp;
VID = GetPlayerVehicleID(i);
FillUp = GasMax - Gas[VID];
if(Refueling[i] == 1)
{
if(GetPlayerMoney(i) >= FillUp+4)
{
Gas[VID] += FillUp;
FillUp = FillUp * 50;
format(gstring,sizeof(gstring)," Veiculo Reabastecido, Por: R$%d.",FillUp);
PlayerPlaySound(i, 1149, 0.0, 0.0, 0.0);
SendClientMessage(i,COLOR_LIGHTBLUE,gstring);
GivePlayerMoney(i, - FillUp);
SBizzInfo[3][sbTill] += FillUp;
ExtortionSBiz(3, FillUp);
Refueling[i] = 0;
TogglePlayerControllable(i, 1);
}
else
{
format(gstring,sizeof(gstring)," Vocк nгo tem grana para reabastecer, vocк precisa de R$%d para reabastecer.",FillUp);
SendClientMessage(i,COLOR_LIGHTBLUE,gstring);
}
}
}
}
return 1;
}