16.03.2013, 07:15
pawn Код:
public Gasup(vehicleid,curgass,kof,mokejo,playerid)
{
if(playerDB[playerid][pila])
{
if(GetPlayerMoneyA(playerid) >= kof)
{
if(vehicleDB[vehicleid][gas] < aBakai[GetVehicleModel(vehicleid)-400])
{
SetTimerEx("Gasup",1000,false,"iiiii",vehicleid,curgass+1,kof,mokejo+kof,playerid);
vehicleDB[vehicleid][gas]++;
GivePlayerMoneyA(playerid,-kof);
new msg[150];
new degalai[20];
if(vehicleDB[vehicleid][dujos] == 1) degalai = "Benzin/Dujos";
else if(vehicleDB[vehicleid][dyzelis] == 1 ) degalai = "Dyzelinas";
else if(vehicleDB[vehicleid][benzinas] == 1 ) degalai = "Benzinas";
new model = GetVehicleModel(vehicleid);
format(msg,156,"~b~Masina:~y~%s~n~~b~Tarifas:~y~%iLT/L~n~~b~Ipilta:~g~%iL~n~~b~Suma:~r~%iLT~n~~b~Kuras:~g~%s~n~~b~Baikti su ~r~Enter",aVehicleNames[model-400],kof,curgass,mokejo,degalai);
TextDrawSetString(Degaline2, msg);
TextDrawShowForPlayer(playerid, Degaline1);
TextDrawShowForPlayer(playerid, Degaline2);
}else{
TogglePlayerControllable(playerid,true);
GameTextForPlayer(playerid,"Bakas pilnas",2000,5);
playerDB[playerid][pila]=false;
TextDrawHideForPlayer(playerid, Degaline1);
TextDrawHideForPlayer(playerid, Degaline2);
EndGasup(playerid,vehicleid,curgass,kof,mokejo);
}
}else{
TogglePlayerControllable(playerid,true);
GameTextForPlayer(playerid,"Jums nebeuztenka pinigu",2000,5);
playerDB[playerid][pila]=false;
TextDrawHideForPlayer(playerid, Degaline1);
TextDrawHideForPlayer(playerid, Degaline2);
EndGasup(playerid,vehicleid,curgass,kof,mokejo);
}
}else{
TogglePlayerControllable(playerid,true);
EndGasup(playerid,vehicleid,curgass,kof,mokejo);
}
}