17.03.2011, 20:59
This tells me "You is not on amy gas startion" when i am ON the gas station
This tells me "You left the gas startion" when i am ON the gas station (Mayb other bugs there too?)
I think there is something wrong here then =/
pawn Код:
dcmd_refill(playerid, params[])
{
#pragma unused params
if(!IsPlayerOnGasStation(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You is not on amy gas startion");
{
RefillingTimer[playerid] = SetTimerEx("ReFuelTimer", 1000, true, "u", playerid);
return 1;
}
}
pawn Код:
public ReFuelTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(i);
if(GetPlayerVehicleSeat(i) == 0)
{
if(IsPlayerOnGasStation(i))
{
if(Fuel[vehicleid] > 0)
{
new lights, alarm, doors, bonnet, boot, objective;
SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
}
else
{
if(Fuel[vehicleid] == 100)
{
KillTimer(RefillingTimer[i]);
GameTextForPlayer(i,"~r~Tank Refilled", 5000, 4);
return 1;
}
else
{
Fuel[vehicleid] ++;
return 1;
}
}
}
else
{
SendClientMessage(i, 0xFF0000FF, "You left the gas startion");
KillTimer(RefillingTimer[i]);
return 1;
}
}
}
return 1;
}
pawn Код:
stock IsPlayerOnGasStation(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 2115.5422, 919.5186, 10.8203)) return 0; //Gas Station 1
return 1;
}