Help Locking Cars to Name
#1

I have code for when a person enters a vehicle it checks the name to see if it is correct. If it is it does nothing.
If it isnt it kicks the person out of the car.
This is the code I have that doesnt work.....

Код:
new lead1;
new lead2;
Код:
lead1 = AddStaticVehicle(562,2581.9116,2275.4424,10.4320,269.7394,92,1); // banshee
lead2 = AddStaticVehicle(429,2653.3506,2342.1892,10.2868,36.4066,11,1); // nissanskyline
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if (vehicleid == lead1)
  {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "Jacob_Harrison", true) != 0)
{

}
else
{
RemovePlayerFromVehicle(playerid);
}
return 1;
	}

if (vehicleid == lead2)
  {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "Jacob_Harrison", true) != 0)
{

}
else
{
RemovePlayerFromVehicle(playerid);
		}
	}
	return 1;
}
There are no errors or warnings...
Please help =/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)