07.12.2012, 21:00
Hey I did all what did you tell me in the last appeal and still bugged from this apply : https://sampforum.blast.hk/showthread.php?tid=397770
This is the code of that if something here is wrong reply that please ! :
So this is the code of cmd :
This is the code of that if something here is wrong reply that please ! :
Код:
stock StopRefueling(playerid, vehicleslot) { GivePlayerCash(playerid, -RefuelingVehiclePrice[playerid]); new string[128]; format(string, sizeof(string), "Your vehicle's tank has been refilled for $%d.", RefuelingVehiclePrice[playerid]); SendClientMessageEx(playerid, COLOR_WHITE,string); new mypoint = -1; for (new i=0; i<MAX_POINTS; i++) { if(strcmp(Points[i][Name], "Fossil Fuel Company", true) == 0) { mypoint = i; } } for(new i = 0; i < sizeof(FamilyInfo); i++) { if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0) { FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+(RefuelingVehiclePrice[playerid]/10); } } RefuelingVehicle[playerid] = 0; RefuelingVehiclePrice[playerid] = 0; KillTimer(RefuelingVehicleTimer[playerid]); return true; } IsAtFuelStation(playerid) { new Float:X, Float:Y, Float:Z; GetObjectPos(Carrier[0], X, Y, Z); if(IsPlayerInRangeOfPoint(playerid,10,1595.5406, 2198.0520, 10.3863) || IsPlayerInRangeOfPoint(playerid,10,2202.0649, 2472.6697, 10.5677) || IsPlayerInRangeOfPoint(playerid,10,2115.1929, 919.9908, 10.5266) || IsPlayerInRangeOfPoint(playerid,10,2640.7209, 1105.9565, 10.5274) || IsPlayerInRangeOfPoint(playerid,10,608.5971, 1699.6238, 6.9922) || IsPlayerInRangeOfPoint(playerid,10,618.4878, 1684.5792, 6.9922) || IsPlayerInRangeOfPoint(playerid,10,2146.3467, 2748.2893, 10.5245) || IsPlayerInRangeOfPoint(playerid,10,-1679.4595, 412.5129, 6.9973) || IsPlayerInRangeOfPoint(playerid,10,-1327.5607, 2677.4316, 49.8093) || IsPlayerInRangeOfPoint(playerid,10,-1470.0050, 1863.2375, 32.3521) || IsPlayerInRangeOfPoint(playerid,10,-2409.2200, 976.2798, 45.2969) || IsPlayerInRangeOfPoint(playerid,10,-2244.1396, -2560.5833, 31.9219) || IsPlayerInRangeOfPoint(playerid,10,-1606.0544, -2714.3083, 48.5335) || IsPlayerInRangeOfPoint(playerid,10,1937.4293, -1773.1865, 13.3828) || IsPlayerInRangeOfPoint(playerid,10,-91.3854, -1169.9175, 2.4213) || IsPlayerInRangeOfPoint(playerid,10,1383.4221, 462.5385, 20.1506) || IsPlayerInRangeOfPoint(playerid,10,660.4590, -565.0394, 16.3359) || IsPlayerInRangeOfPoint(playerid,10,1381.7206, 459.1907, 20.3452) || IsPlayerInRangeOfPoint(playerid,10,-1605.7156, -2714.4573, 48.5335) || IsPlayerInRangeOfPoint(playerid,20,1882.2546,-2393.9824,16.5144) || IsPlayerInRangeOfPoint(playerid,10,1386.5360,-271.5511,-0.4857) || IsPlayerInRangeOfPoint(playerid,10,2017.3016,-229.9219,-0.2183) || IsPlayerInRangeOfPoint(playerid,10,279.1325,1940.4025,17.6406) || IsPlayerInRangeOfPoint(playerid,250,X, Y, Z)) { return true; } return false; } forward ReFill(playerid); public ReFill(playerid) { if(!IsAtFuelStation(playerid) || !IsPlayerInAnyVehicle(playerid) || VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0 || GetPlayerCash(playerid) < 1) { StopRefueling(playerid); } else { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); if(engine == VEHICLE_PARAMS_ON) return StopRefueling(playerid); VehicleFuel[GetPlayerVehicleID(playerid)] += 1.0; RefuelingVehiclePrice[playerid] += 30; if(VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0) VehicleFuel[GetPlayerVehicleID(playerid)] = 100.0; } return true; }
Код:
CMD:refuel(playerid, params[]) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == VEHICLE_PARAMS_ON) return SendClientMessageEx(playerid, COLOR_RED, "You need to shut off the engine before filling up (/car engine)."); if(!IsAtFuelStation(playerid)) return SendClientMessageEx(playerid, COLOR_RED, "You're not at a fuel station."); if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel."); if(VehicleFuel[vehicleid] >= 100.0) return SendClientMessageEx(playerid, COLOR_RED, "This vehicle's tank is already full."); if(RefuelingVehicle[playerid] == 1) return SendClientMessageEx(playerid, COLOR_RED, "You are refilling your vehicle's tank."); SendClientMessageEx(playerid, COLOR_WHITE, "Refueling your vehicle's tank, please wait."); RefuelingVehicle[playerid] = 1; RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill", 1000, true, "i", playerid); } return 1; }