Need help with Smart vehicle locking
#1

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
Reply
#2

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
Reply
#3

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.

Reply
#4

Sry nop i alredy know that but Thanks for helping
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)