SA-MP Forums Archive
Help Locking Cars to Name - 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: Help Locking Cars to Name (/showthread.php?tid=81052)



Help Locking Cars to Name - Yoyoyo - 07.06.2009

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 =/