SA-MP Forums Archive
Need help with Smart vehicle locking - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with Smart vehicle locking (/showthread.php?tid=132186)



Need help with Smart vehicle locking - graetz - 06.03.2010

Hello i have made my own car ownership but the problem is that i maed it to save car on player name and i dont know how to make vehicle lock system

Here is my script
Code:
if(strcmp(cmd, "/lockvehicle", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			for(new i; i != MAX_VEHICLES; i++)
  			{
   			new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
	    	if(dist)
		    {
		      new carid = GetPlayerVehicleID(playerid);
		      if(strcmp(DynamicCars[carid][vOwnerName],GetPlayerNameEx(playerid),true)) return SendClientMessage(playerid, COLOR_GREY, "[Error:] This vehicle does not belong to you.");
     			if(VehicleLocked[carid] == 0)
			 		{
		 			if(PlayerInfo[playerid][pSex] == 1)
					{
						PlayerActionMessage(playerid,15.0,"1111");
					}
					else
					{
						PlayerActionMessage(playerid,15.0,"2222");
					}
					SendClientMessage(playerid,COLOR_WHITE,"[INFO:] 111222");
					VehicleLocked[carid] = 1;
					VehicleLockedPlayer[playerid] = carid;
					}
	    	}
  			}
		}
		return 1;
	}*/
And i think this part is wrong
Code:
if(strcmp(DynamicCars[carid][vOwnerName],GetPlayerNameEx(playerid),true)) return SendClientMessage(playerid, COLOR_GREY, "[Error:] This vehicle does not belong to you.");
Help please


Re: Need help with Smart vehicle locking - graetz - 07.03.2010

Come on someone
How to make if that car vOwner... is Right player name then car get locked or unlocked and if not then This is not your veh


Re: Need help with Smart vehicle locking - adsy - 07.03.2010

would this help?

Quote:

SetVehicleParamsForPlayer

Set the parameters of a vehicle for a player.

Parameters:
(vehicleid,playerid,objective,doorslocked)
vehicle The ID of the vehicle to set the parameters of.
playerid The ID of the player to set the vehiclle's parameters for.
objective 0 to disable the objective or 1 to show it.
doorslocked 0 to unlock the doors or 1 to lock them.




Re: Need help with Smart vehicle locking - graetz - 07.03.2010

Sry nop i alredy know that but Thanks for helping