SA-MP Forums Archive
Car Dealership - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car Dealership (/showthread.php?tid=480066)



Car Dealership - TonyNames - 08.12.2013

when you create dealerships and make some cars for sale and everytime u buying the cars the script have to save and when it saves the server is kinda crashing like when u losing ur internet connection then u see all players tabbed. can u fix that so the script arent crashing? everytime u buying a car or deleting the car dealership and checking the server logs it says saving car dealership
can u fix it so it saving while its not crashing or something? i mean so players can play while it saving and not the server crashes while it saving and have to wait like 5-10 min.



And my other problem is when you type /refuel and when its done it keep taking 100$ it wont stop. I tried to relog it keep doing it. Even ban and unban it just wont stop. Can anyone help me with these?

Here is the /refuel cmd:

Код:
CMD:refuel(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
		new RefuelingVehicleSlot = -1;
	    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;

		for(new vehicleslot = 0; vehicleslot < MAX_PLAYERVEHICLES; vehicleslot++)
		{
			if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][vehicleslot][pvId]))
			{
				RefuelingVehicleSlot = vehicleslot;
			}
		}
       	RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill", 1000, true, "ii", playerid, RefuelingVehicleSlot);
	}
	return 1;
}



Re: Car Dealership - TonyNames - 08.12.2013

I dont know its the right command


Re: Car Dealership - TonyNames - 09.12.2013

Anyone i have been waited 1 day to avoid Bump but noone answered.


Re: Car Dealership - newbie scripter - 09.12.2013

Can u show us the timer code?


Re: Car Dealership - TonyNames - 09.12.2013

Ehm which one should i search for ?


Re: Car Dealership - TonyNames - 09.12.2013

i mean in ctrl + f etc...


Re: Car Dealership - TonyNames - 09.12.2013

Found anything?