Jump to content
  • 0

Ownership problema


Scott_Williams

Question

Salut , am si eu o problema. Am un sistem ownership si cand dau /buycar masina in care sunt nu pe accea o cumpara ci spawneaza masina intrun alt loc. SI din aceasta cauza id-urile mele se dau peste cap cand cumperi o masina.Si as vrea sa ma ajutati ca atunci cand dau /buycar sa o cumpere pe loc masina in care sunt.

	else if (strcmp("/buycar", cmd, true, 10) == 0)
	{
	    if (Spectating[playerid][0]!=-1)
	    {
	        if (Carlist[playerid][Typ]==-1)
	        {
	            new price = Buylist[Spectating[playerid][0]][Price];
	            if (price <= GetPlayerMoney(playerid))
	            {
	                new autohaus=Buylist[Spectating[playerid][0]][Autohaus];
   	        		GivePlayerMoney(playerid, - price);
   	        		Carlist[playerid][Typ]=Spectating[playerid][0]; Carlist[playerid][X]=Carspawns[autohaus][X]; Carlist[playerid][Y]=Carspawns[autohaus][Y];
					Carlist[playerid][Z]=Carspawns[autohaus][Z]; Carlist[playerid][Rotation]=Carspawns[autohaus][Rotation]; Carlist[playerid][Status]=1; Carlist[playerid][Lock]=0;
					Carlist[playerid][Carid]=CreateVehicle(Buylist[Spectating[playerid][0]][Modelid],Carlist[playerid][X],Carlist[playerid][Y],Carlist[playerid][Z],Carlist[playerid][Rotation],-1,-1,-1);
			        SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
			        TogglePlayerControllable(playerid,1);
			        Spectating[playerid][0]=-1;
			        RemovePlayerFromVehicle(playerid);
					format(string,128,"Congratulations! You bought yourself a/an $%s for %i!",Buylist[Carlist[playerid][Typ]][Name],price);
					SendClientMessage(playerid, COLOR_RED, string);
					SendClientMessage(playerid, COLOR_GREEN, "If your car is broken, type /fixcar to fix it.");
					SendClientMessage(playerid, COLOR_GREEN, "You can lock/unlock your car for other players with /lock.");
					SendClientMessage(playerid, COLOR_GREEN, "Look for more commands with /carhelp.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Your car is ready at the release point. Have fun!");
                    SetPlayerCheckpoint(playerid,1659.0558,-1136.7689,23.9063,3.0);
				}
                else { format(string, 128, "Insufficent money to buy the car (need: $%i)!", price); SendClientMessage(playerid, COLOR_LIGHTRED, string); }
			}
			else { SendClientMessage(playerid, COLOR_GREY, "You already have a car!"); }
	    }
	    else { SendClientMessage(playerid, COLOR_GREY, "You are not visiting a demonstration car!"); }
	    return 1;
	}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.