Ejecting a player if he dosent own
#1

Okay, I need help with this one. I have a mysql script and am running some cars of it and some static cars not off it. So far I've managed to allow player to access the unlocked AddStaticVehicle cars in the script. But now if a vehicle if for sale it ejects the person before they can /buyvehicle it and also it ejects a player from his own vehicle. Heres what I have so far:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new string[128];
		new vehicle = GetPlayerVehicleID(playerid);
		new vid;
		if(vehicle >= 44)
		{
			if(vInfo[vid][vOwnerId] != PlayerInfo[playerid][pSQLId])
  			{
				SendClientMessage(playerid, COLOR_RED, "This Isent Your Vehicle");
				RemovePlayerFromVehicle(playerid);
			}
	  		if(vInfo[vehicle][vBuyAble] == 1)
			{
	  			format(string,sizeof(string),"This vehicle is for sale, you can buy it for %d$ (/buyvehicle)",vInfo[vehicle][vPrice]);
	    		SendClientMessage(playerid,0x33CCFFFF,string);
	  		}
	  		else if(vInfo[vehicle][vBuyAble] == 2 && PlayerInfo[playerid][pSQLId] == vInfo[vehicle][vOwnerId])
	  		{
	    		SendClientMessage(playerid,0x33CCFFFF,"Welcome to your vehicle.");
	  		}
		}
	}
	return 1;
}
I think vInfo[vid][vBuyAble]=2 defines if the vehicle is buyable...

any help is much appricated
Reply


Messages In This Thread
Ejecting a player if he dosent own - by jamesb93 - 12.11.2009, 20:37
Re: Ejecting a player if he dosent own - by Calix - 12.11.2009, 21:59
Re: Ejecting a player if he dosent own - by jamesb93 - 13.11.2009, 20:25

Forum Jump:


Users browsing this thread: 1 Guest(s)