SA-MP Forums Archive
i need help by MySQL CarOwner - 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: i need help by MySQL CarOwner (/showthread.php?tid=140618)



i need help by MySQL CarOwner - [GRG]Linux - 09.04.2010

Hi,

i have a big problem.

my problem is
i climb in any car than come
"You are not in this Fraktion"

here the code

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new Query[256];
	new VehiclesCount = strval(GetMySQLResult("SELECT COUNT(`ModelID`) FROM `vehicle`"));
	for(new Vehicle = 0; Vehicle < VehiclesCount; Vehicle++)
	{
//------------------// Vehicle Owner //--------------------//
		format(Query,sizeof(Query),"SELECT `FraktionsID` FROM `vehicle` LIMIT %d,1",Vehicle);
		new FraktionsID=strval(GetMySQLResult(Query));
		if (FraktionsID == LeaderLevel[playerid] || FraktionsID == MemberLevel[playerid] || !FraktionsID)
		{
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED,"You are not in this Fraktion!");
			RemovePlayerFromVehicle(playerid);
			return 1;
		}
//------------------// CarOwner //-------------------------//
		format(Query,sizeof(Query),"SELECT `Car` FROM `vehicle` LIMIT %d,1",Vehicle);
		new CarOwner=strval(GetMySQLResult(Query));
		if(CarOwner >= 1)
		{
		  SendClientMessage(playerid,COLOR_LIGHTBLUE,"This car cost $50000");
		  SendClientMessage(playerid,COLOR_LIGHTBLUE,"give: /buycar to buy this car!");
		  SendClientMessage(playerid,COLOR_LIGHTBLUE,"who not /exit");
		  TogglePlayerControllable(playerid,0);
			return 1;
		}
		else
		{
			print("CarOwner ID 0");
		}
	}
 	return 1;
}
i hope your kann help me