i need help by MySQL CarOwner
#1

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
Reply


Forum Jump:


Users browsing this thread: