SA-MP Forums Archive
A little problem with /rentcar. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A little problem with /rentcar. (/showthread.php?tid=169609)



A little problem with /rentcar. - Gabb0411 - 20.08.2010

Hello everyone .. i have a little problem , i think you can help me..
I've just made a /rentboat command a few days ago , with DIALOG. You go on a pickup and you type /rentboat. It will appear a menu , which boat you want to rent. So i want to make something. If a boat is rented and if someone tries to rent the same boat , say : "Someone already rents this boat."
Look my code :
Код:
if(listitem == 0)
	        {
					if(SBizzInfo[16][sbProducts] == 0)
					{
						GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
						return 1;
					}
					if(PlayerInfo[playerid][pPbiskey] == 12)
					{
						GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
						TogglePlayerControllable(playerid, 1);
						return 1;
					}
					if (GetPlayerMoney(playerid) <  35000)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
						return 1;
					}
					if(HireCar[playerid] != 299)
					{
						gCarLock[HireCar[playerid]] = 0;
						UnLockCar(HireCar[playerid]);
					}
 ---I think here is the problem	              for(new i=0; i<MAX_PLAYERS; i++) 
---- it doesn't work					{
   						if(HireCar[i] != GetPlayerVehicleID(playerid))
			    		{
       						SendClientMessage(playerid, COLOR_GREY, "    Someone already rents this yacht !");
			        		return 1;
			    		}
					}
					GivePlayerMoney(playerid,-35000);
					PutPlayerInVehicle(playerid, 228, 0);
					SBizzInfo[16][sbTill] += 35000;
					ExtortionSBiz(16, 35000);
					SBizzInfo[16][sbProducts]--;
					HireCar[playerid] = GetPlayerVehicleID(playerid);
					OnPropUpdate();
					GameTextForPlayer(playerid, "We hope you enjoy this yacht", 5000, 3);
			}



Re: A little problem with /rentcar. - Gabb0411 - 20.08.2010

Sorry for double post , can someone help me ?


Re: A little problem with /rentcar. - xxxDunecatxxx - 20.08.2010

You made it so if there's anyone on the server who DOESN'T own that boat, return "Somone already owns this yacht"

In the loop, change

if(HireCar[i] != GetPlayerVehicleID(playerid))

to

if(HireCar[i] == GetPlayerVehicleID(playerid))


Re: A little problem with /rentcar. - Gabb0411 - 20.08.2010

I've made this but it don't works.
The GetPlayerVehicleID(playerid) doesn't have effect , because i'm not in the boat. When i write /rentboat.. I'm on foot not in a vehicle.
If i want to rent a boat i'm typing /rentboat at biz entrance !


Re: A little problem with /rentcar. - Gabb0411 - 20.08.2010

Lol , anyone doesn't know ?


Re: A little problem with /rentcar. - Gabb0411 - 21.08.2010

Omg , no one ? I need help with this..