SA-MP Forums Archive
Teleport - 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: Teleport (/showthread.php?tid=576368)



Teleport - Tony$$ - 03.06.2015

Hello,
I made a textdraw dealership system. Whenever i buy a vehicle it supposed to TP me into the new vehicle but instead is spawns me infront of the first business (Business ID ) in my MySQL.

Any ideas?

This is the code

Код:
if(playertextid == CarBuy[playerid][7])
    {

		new num = getNumOwnedCars(playerid);
		if(num >= GetPVarInt(playerid, "MaxCars"))
		{
			SendClientMessage(playerid, X11_TOMATO_2, "You cannot own any more cars");
			return 0;
		}
        if(GetPVarInt(playerid,"dealership_type") == 0)
        {
	        format(tempstr,sizeof(tempstr),"Congratulations! You are now the owner of a %s",VehiclesName[EBDNormalCars[Dealership_vehicle_list[playerid]][EBCarModelID]-400]);
			if(GetMoneyEx(playerid) >= EBDNormalCars[ Dealership_vehicle_list[playerid] ][EBCarPrice])
			{
				GiveMoneyEx(playerid, -EBDNormalCars[Dealership_vehicle_list[playerid]][EBCarPrice]);
				SendClientMessage(playerid, COLOR_LIGHTGREEN, tempstr);
				new Float:X,Float:Y,Float:Z,Float:A;
				GetPlayerPos(playerid, X, Y, Z);
				GetPlayerFacingAngle(playerid, A);
				new biz = GetPVarInt(playerid, "BuyingBiz");
				addToBusinessTill(biz, EBDNormalCars[Dealership_vehicle_list[playerid]][EBCarPrice]/4);
				addToBusinessProducts(biz, -25);
	            exitBiz(playerid, i);
				CreatePlayerCar(playerid, EBDNormalCars[Dealership_vehicle_list[playerid]][EBCarModelID], 0, 0, Business[biz][EBusinessExitX],Business[biz][EBusinessExitY],Business[biz][EBusinessExitZ], A, ELockType_Default,1);
			}
			else
			{
				SendClientMessage(playerid, X11_RED, "You don't have enough money");
			}
		}
        else if(GetPVarInt(playerid,"dealership_type") == 1)
        {
	        format(tempstr,sizeof(tempstr),"Congratulations! You are now the owner of a %s",VehiclesName[EBDFastCars[Dealership_vehicle_list[playerid]][EBCarModelID]-400]);
			if(GetMoneyEx(playerid) >= EBDFastCars[ Dealership_vehicle_list[playerid] ][EBCarPrice])
			{
				GiveMoneyEx(playerid, -EBDFastCars[Dealership_vehicle_list[playerid]][EBCarPrice]);
				SendClientMessage(playerid, COLOR_LIGHTGREEN, tempstr);
				new Float:X,Float:Y,Float:Z,Float:A;
				GetPlayerPos(playerid, X, Y, Z);
				GetPlayerFacingAngle(playerid, A);
				new biz = GetPVarInt(playerid, "BuyingBiz");
				addToBusinessTill(biz, EBDFastCars[Dealership_vehicle_list[playerid]][EBCarPrice]/4);
				addToBusinessProducts(biz, -25);
				CreatePlayerCar(playerid, EBDFastCars[Dealership_vehicle_list[playerid]][EBCarModelID], 0, 0, Business[biz][EBusinessExitX],Business[biz][EBusinessExitY],Business[biz][EBusinessExitZ], A, ELockType_Default,1);
			}
			else
			{
				SendClientMessage(playerid, X11_RED, "You don't have enough money");
			}
		}
        else if(GetPVarInt(playerid,"dealership_type") == 2)
        {
	        format(tempstr,sizeof(tempstr),"Congratulations! You are now the owner of a %s",VehiclesName[EBDBikes[Dealership_vehicle_list[playerid]][EBCarModelID]-400]);
			if(GetMoneyEx(playerid) >= EBDBikes[ Dealership_vehicle_list[playerid] ][EBCarPrice])
			{
				GiveMoneyEx(playerid, -EBDBikes[Dealership_vehicle_list[playerid]][EBCarPrice]);
				SendClientMessage(playerid, COLOR_LIGHTGREEN, tempstr);
				new Float:X,Float:Y,Float:Z,Float:A;
				GetPlayerPos(playerid, X, Y, Z);
				GetPlayerFacingAngle(playerid, A);
				new biz = GetPVarInt(playerid, "BuyingBiz");
				addToBusinessTill(biz, EBDBikes[Dealership_vehicle_list[playerid]][EBCarPrice]/4);
				addToBusinessProducts(biz, -25);
				CreatePlayerCar(playerid, EBDBikes[Dealership_vehicle_list[playerid]][EBCarModelID], 0, 0, Business[biz][EBusinessExitX],Business[biz][EBusinessExitY],Business[biz][EBusinessExitZ], A, ELockType_Default,1);
			}
			else
			{
				SendClientMessage(playerid, X11_RED, "You don't have enough money");
			}
		}



Re: Teleport - Tony$$ - 04.06.2015

Anyone?


Re: Teleport - Tony$$ - 09.06.2015

Anyone


AW: Teleport - Nero_3D - 09.06.2015

Well if you don't know the problem than you should ask the person who wrote this code
Also I don't see any PutPlayerInVehicle or SetPlayerPos in your code