More than 3 cars owned? Please Help! - GTA:RP
#1

ok, i have GTA:RP.

and car dealership/ ownership is you can't have more than 3 cars. but i want to have around 20.

how can i edit my gm to do this?
Reply
#2

1.Reason why a lot of people aren't responding to this - no-one nowdays like another RP edited script.
2.You are just making it as a cloud whitch you want in different color.
3.This may cause problems and is adviced to not be done, but well look for place where is if, and "<" "3" together (without anything between) and post them all, lets see if we can help.
Reply
#3

Код:
  if(GetPlayerMoney(playerid) >= OwnableCarPrice[playerid])
			    {
						if(IsPlayerConnected(OwnableCarOffer[playerid]))
						{
						  GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
						  GetPlayerName(playerid, sendername, sizeof(sendername));
						  if(PlayerInfo[playerid][pPcarkey] == 999)
							{
								if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
								{
									PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
								{
									PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
								{
									PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
								}
								else
								{
								  SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
									return 1;
								}
								format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
								SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
						  	RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
						  	SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
						  	SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
						  	strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
							}
						  else if(PlayerInfo[playerid][pPcarkey2] == 999)
							{
							  if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
								{
									PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
								{
									PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
								{
									PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
								}
								else
								{
								  SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
									return 1;
								}
								format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
								SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
						  	RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
						  	SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
						  	SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
						  	strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
							}
						  else if(PlayerInfo[playerid][pPcarkey3] == 999)
							{
							  if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
								{
									PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
								{
									PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
								}
								else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
								{
									PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
								}
								
								else
								{
								  SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
									return 1;
								}
								format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
								SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
						  	RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
						  	SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
						  	SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
						  	strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
							}
						  else
						  {
						    SendClientMessage(playerid, COLOR_GREY, " You already have 3 cars ! ");
						    return 1;
							}
						  DateProp(playerid);
							DateProp(OwnableCarOffer[playerid]);
							OnPropUpdate();
							OnPlayerUpdate(playerid);
							OnPlayerUpdate(OwnableCarOffer[playerid]);
						  OwnableCarOffer[playerid] = 999;
							OwnableCarID[playerid] = 0;
							OwnableCarPrice[playerid] = 0;
							GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);
							SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
							SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclemanual to view the vehicle manual!");
							return 1;
						}
						else
						{
						  SendClientMessage(playerid, COLOR_GREY, "  Car seller is Offline !");
			    		return 1;
						}
			    }
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_GREY, "  No-one offerd you any Ownable Car !");
			    return 1;
			  }
			}
Reply
#4

Thats the buying car proccess, so maybe its in there?
Reply
#5

It's asinged to 3, live with it or learn the code good enough to edit it. (yes it will cause problems if you will just try to put it between, if you know what code even is needed).
Reply
#6

Код:
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4])
								{
									PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4] = 999;
								}
that maybe?

and a else statment also
then add the code above. and shud be done? obv close the {'s
Reply
#7

Quote:
Originally Posted by campkz
Код:
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4])
								{
									PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4];
						  		PlayerInfo[OwnableCarOffer[playerid]][pPcarkey4] = 999;
								}
that maybe?

and a else statment also
then add the code above. and shud be done? obv close the {'s
Close, but if you do that you will need to create that fourth key variable, make it save to accounts, and edit all the other functions with the cars to add a fourth slot to everything. That is a lot to do and if you want 20 cars have fun you have a lot to do and you have to consider the car limit and 50 people with 20 cars is 1000 cars which will start causing more and more lag and hit the car limit quite easily.
Reply
#8

Ok, just im creating a mafia base, and some cars for the leader. or can i just pLeader = 6 or w.e?

and you have to remember, i started coding 'Today'

(although i've done java and seems simular.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)