CG-RP Broken Vehicle System ..
#3

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
Can you show me the /pv command?
Here it's
Код:
if(strcmp(cmd, "/parkvehicle", true) == 0 || strcmp(cmd, "/parkcar", true) == 0) // Parking the car.
	{
		new vehicleid = GetPlayerVehicleID(playerid);
	 	if(IsPlayerConnected(playerid))
	    {
			if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
			{
				GetPlayerVehicleMods(playerid);
				if(PlayerVehicleID1[playerid] == vehicleid)
				{
					GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX1], PlayerInfo[playerid][PlayerVehiclePosY1], PlayerInfo[playerid][PlayerVehiclePosZ1]);
    				GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing1]);
					DestroyVehicle(PlayerVehicleID1[playerid]);
					PlayerInfo[playerid][PlayerVehicle1VirWorld] = GetPlayerVirtualWorld(playerid);
            		PlayerInfo[playerid][PlayerVehicle1Interior] = GetPlayerInterior(playerid);
				    CreatePlayerVehicle(playerid,1);
					PutPlayerInVehicle(playerid,PlayerVehicleID1[playerid],0);
				}
				else if(PlayerVehicleID2[playerid] == vehicleid)
				{
					GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX2], PlayerInfo[playerid][PlayerVehiclePosY2], PlayerInfo[playerid][PlayerVehiclePosZ2]);
			       	GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing2]);
					DestroyVehicle(PlayerVehicleID2[playerid]);
					PlayerInfo[playerid][PlayerVehicle2VirWorld] = GetPlayerVirtualWorld(playerid);
            		PlayerInfo[playerid][PlayerVehicle2Interior] = GetPlayerInterior(playerid);
				    CreatePlayerVehicle(playerid,2);
					PutPlayerInVehicle(playerid,PlayerVehicleID2[playerid],0);
				}
				else if(PlayerVehicleID3[playerid] == vehicleid)
				{
					GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX3], PlayerInfo[playerid][PlayerVehiclePosY3], PlayerInfo[playerid][PlayerVehiclePosZ3]);
			       	GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing3]);
					DestroyVehicle(PlayerVehicleID3[playerid]);
					PlayerInfo[playerid][PlayerVehicle3VirWorld] = GetPlayerVirtualWorld(playerid);
            		PlayerInfo[playerid][PlayerVehicle3Interior] = GetPlayerInterior(playerid);
				    CreatePlayerVehicle(playerid,3);
					PutPlayerInVehicle(playerid,PlayerVehicleID3[playerid],0);
				}
				else if(PlayerVehicleID4[playerid] == vehicleid)
				{
					GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX4], PlayerInfo[playerid][PlayerVehiclePosY4], PlayerInfo[playerid][PlayerVehiclePosZ4]);
			       	GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing4]);
					DestroyVehicle(PlayerVehicleID4[playerid]);
					PlayerInfo[playerid][PlayerVehicle4VirWorld] = GetPlayerVirtualWorld(playerid);
            		PlayerInfo[playerid][PlayerVehicle4Interior] = GetPlayerInterior(playerid);
					CreatePlayerVehicle(playerid,4);
					PutPlayerInVehicle(playerid,PlayerVehicleID4[playerid],0);
				}
				else if(PlayerVehicleID5[playerid] == vehicleid)
				{
					GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX5], PlayerInfo[playerid][PlayerVehiclePosY5], PlayerInfo[playerid][PlayerVehiclePosZ5]);
			      	GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing5]);
					DestroyVehicle(PlayerVehicleID5[playerid]);
					PlayerInfo[playerid][PlayerVehicle5VirWorld] = GetPlayerVirtualWorld(playerid);
            		PlayerInfo[playerid][PlayerVehicle5Interior] = GetPlayerInterior(playerid);
					CreatePlayerVehicle(playerid,5);
					PutPlayerInVehicle(playerid,PlayerVehicleID5[playerid],0);
				}
				else
				{
					SendClientMessage(playerid,COLOR_GREY,"	You are not in a vehicle that you own.");
				}
			}
			else
			{
				SendClientMessage(playerid,COLOR_GREY,"	You are not driving a vehicle.");
			}
		}
	    return 1;
	}
Reply


Messages In This Thread
CG-RP Broken Vehicle System .. - by BadScripter - 28.09.2016, 02:02
Re: CG-RP Broken Vehicle System .. - by Quinncell - 28.09.2016, 09:47
Re: CG-RP Broken Vehicle System .. - by BadScripter - 28.09.2016, 09:58

Forum Jump:


Users browsing this thread: 2 Guest(s)