Easy question (CarOwnership...)
#1

This is under OnPlayerEnterVehicle

Код:
	if(ConvertVehIDtoDYID(vehicleid) != -1)
	{
    	new Float:PEnterPos[3][MAX_PLAYERS];
 	GetPlayerPos(playerid,PEnterPos[0][playerid],PEnterPos[1][playerid],PEnterPos[2][playerid]);
   	new i;
	new string[126];
	i = ConvertVehIDtoDYID(vehicleid);
 		if(MyVehicle[i][MyVehSlot] == 1 && (MyVehicle[i][MyVehCar] != -1 || MyVehicle[i][MyVehBike] != -1 || MyVehicle[i][MyVehBoat] != -1 || MyVehicle[i][MyVehPlane] != -1) && MyVehicle[i][MyVehFsale] < 1)
		{
     	   		if(MyVehicle[i][MyVehLock] == 1 && !IsPlayerAdmin(playerid) && MyVehicle[i][MyVehOwner] != playerid)
   		  	{
 				GetPlayerPos(playerid,PEnterPos[0][playerid],PEnterPos[1][playerid],PEnterPos[2][playerid]);
				SetPlayerPos(playerid,PEnterPos[0][playerid],PEnterPos[1][playerid],PEnterPos[2][playerid]);
				format(string, sizeof(string), "~g~~h~Sopstvenik:~y~ %s",MyVehicle[i][MyVehOwner]);
				GameTextForPlayer(playerid,string,2000,3);
				TogglePlayerControllable(playerid, 0);
				TogglePlayerControllable(playerid, 1);
	   		}
		}
	}
I want to make when vehicle is locked (MyVehicle[i][MyVehLock] == 1) the owner on that vehicle can enter (only the owner of that vehicle !)
Function for car owner is MyVehicle[i][MyVehOwner]

I tried to make something but still when car is locked the owner cant enter...
Reply


Messages In This Thread
Easy question (CarOwnership...) - by NeroX98 - 30.11.2012, 11:58
Re: Easy question (CarOwnership...) - by [D]ry[D]esert - 30.11.2012, 12:20
Re: Easy question (CarOwnership...) - by NeroX98 - 30.11.2012, 12:48

Forum Jump:


Users browsing this thread: 3 Guest(s)