SA-MP Forums Archive
Vehicle Ownership Problem - 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: Vehicle Ownership Problem (/showthread.php?tid=93818)



Vehicle Ownership Problem - CJ101 - 26.08.2009

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
	
		new v = GetPlayerVehicleID(playerid);
		if(v == BC1 && !IsVehicleOwner(playerid))
 			{
			SendClientMessage(playerid,COLOR_GREY,"This vehicle is owned. You may be arrested for theft.");
  			}
  			
    if(v == BC2 && !IsVehicleOwner(playerid))
 			{
			SendClientMessage(playerid,COLOR_GREY,"This vehicle is owned. You may be arrested for theft.");
  			}

return 1;
}

public IsVehicleOwner(playerid)
{
new name[128];
GetPlayerName(playerid,name,sizeof(name));
if(GetPlayerVehicleID(playerid) == BC1 && strcmp(name,ServerInfo[BC1Owner],true)) return true;
if(GetPlayerVehicleID(playerid) == BC2 && strcmp(name,ServerInfo[BC2Owner],true)) return true;
return false;
}
i set it so i own the vehicle... but when i enter the car it says i dont own.


Re: Vehicle Ownership Problem - coole210 - 26.08.2009

This vehicle ownership is completely wrong, to make 100 cars you have to keep making variables that sucks. I would restart if i were you !


Re: Vehicle Ownership Problem - CJ101 - 26.08.2009

im not selling every vehicle im having 10 of them at a car shop...