02.02.2014, 01:28
(
Последний раз редактировалось 0nur; 02.02.2014 в 13:02.
)
Hi guys,
I add this code;
And;
How to fix?
I add this code;
Код:
CMD:benzin(playerid, params[]) { new veh, string[128]; if(sscanf(params, "d", veh)) return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /refuel [car id]"); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { if(GetDistanceToVehicle(playerid,veh) > 20) { SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınıza benzin doldurmak iзin зok uzaktasınız!"); return 1; } if(!IsAtGasStation(playerid)) { SendClientMessageEx(playerid, COLOR_GRAD2, " Benzin istasyonunda değilsiniz!"); return 1; } if(PlayerInfo[playerid][pRefuel] == 1) { SendClientMessageEx(playerid, COLOR_GRAD2, " Zaten şuanda benzin dolduruyorsunuz, lьtfen bekleyin!"); return 1; } if(IsABicycle(veh)) { SendClientMessageEx(playerid, COLOR_GRAD2, " Bisikletlere benzin dolduramazsınız!"); return 1; } if(Gas[veh] == 100.0) { SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınızın benzini zaten dolu!"); return 1; } new Float:FillUp = 100.0 - Gas[veh]; new Float:FillUpPrice = FillUp * 100.0; if(GetPlayerMoney(playerid) < FillUpPrice) { format(string,sizeof(string)," Benzin doldurmak iзin yeterli paraya sahip değilsiniz!"); SendClientMessageEx(playerid, COLOR_GRAD2, string); } else { SetTimerEx("RefuelVehicle",10000,0,"id",playerid,veh); GameTextForPlayer(playerid, "~w~Benzin Dolduruluyor, lutfen bekleyin...",10000,3); format(string, sizeof(string), "* %s pompayı alır ve aracın benzinini doldurmaya başlar.",GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pRefuel] =1; } } else { SendClientMessageEx(playerid, COLOR_GRAD2, " Benzin doldurmak iзin araзtan inmelisiniz."); } return 1; }
Код:
ptask SpeedoCheck[1000](playerid) { new playerid; if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pSpeedoOn] == 1) { new veh = GetPlayerVehicleID(playerid); new Float:Speed = GetVehicleSpeed(veh, 0); new string[128]; if(!IsABicycle(veh)) { format(string,sizeof(string),"~b~HIZ:~n~~w~%d MPH~n~~g~BENZIN: ~w~%.2f",floatround(Speed/1.609),Gas[veh]); PlayerTextDrawSetString(playerid,SpeedoText0,string); } } return 1; } ptask CheckGas[5000](playerid) { new playerid; if(!IsPlayerNPC(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new Float:x,Float:y,Float:z; new vehicle = GetPlayerVehicleID(playerid); if(!IsABicycle(vehicle)) { GetPlayerPos(playerid, x, y, z); new Float:Speed = GetVehicleSpeed(vehicle, 0); if(IsAPlane2(vehicle)) { if(Gas[vehicle] >= 1) { if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) { Gas[vehicle]-=1.0; } if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) { Gas[vehicle]-=1.2; } if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) { Gas[vehicle]-=1.4; } if(floatround(Speed/1.609) > 120) { Gas[vehicle]-=1.6; } if(Gas[vehicle] < 0) { Gas[vehicle] =0.0; } } else { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == 1) { SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective); } } } else if(IsACDLTruck(vehicle)) { if(Gas[vehicle] >= 1) { if(floatround(Speed/1.609) > 0 && floatround(Speed/1.609) < 30) { Gas[vehicle]-=0.2; } if(floatround(Speed/1.609) >= 30 && floatround(Speed/1.609) < 40) { Gas[vehicle]-=0.4; } if(floatround(Speed/1.609) >= 40 && floatround(Speed/1.609) < 50) { Gas[vehicle]-=0.6; } if(floatround(Speed/1.609) >= 50) { Gas[vehicle]-=0.8; } if(Gas[vehicle] < 0) { Gas[vehicle] =0.0; } } else { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == 1) { SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective); SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınızın benzini bittiği iзin motor durduruldu!"); } } } else { if(Gas[vehicle] >= 1) { if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) { Gas[vehicle]-=0.2; } if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) { Gas[vehicle]-=0.4; } if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) { Gas[vehicle]-=0.6; } if(floatround(Speed/1.609) > 120) { Gas[vehicle]-=0.8; } if(Gas[vehicle] < 0) { Gas[vehicle] =0.0; } } else { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == 1) { SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective); SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınızın benzini bittiği iзin motor durduruldu!"); } } } } } } }[1000](playerid)
And;
How to fix?