/veh Bug [Help me]
#1

Hello ,
This is /veh's CMD in my GM [RP].
But there's a problem.
When I respawn a vehicle like Cheetah, I want to get in them but it returns me and stops doing CMD with MSG : This Vehicle is restricted to the FBI.
What I have to do?

CMD: (/veh)
Код:
CMD:veh(playerid, params[])
{
	new vid[128], c1, c2;
	if(PlayerInfo[playerid][pAdmin] >= 3)
	{
	    if(!sscanf(params, "s[128]I(-1)I(-1)", vid, c1, c2))
	    {
			new car = ReturnVehicleModelID(vid);
			if(!car) {return SendClientMessage(playerid, COLOR_GREY, "   Invalid vehicle model name/ID.");}
			if(IsPlayerInAnyVehicle(playerid)) {RemovePlayerFromVehicle(playerid);}
			if(c1 != -1)
			{
			    if(c1 < 0 || c1 > 200) {return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");}
			    if(c2 == -1) {c2 = c1;}
			}
			if(c2 != -1)
			{
			    if(c2 < 0 || c2 > 200) {return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");}
			}
	 		new	Float:X, Float:Y, Float:Z, Float:A;
	        GetPlayerPos(playerid, X,Y,Z);
			GetPlayerFacingAngle(playerid,A);
			new carid = CreateStaticVehicle(car, X,Y,Z,A, c1, c2, -1);
		    if(strval(tmp) != 1)
		    {
		        gDestroyVehicle[carid] = 1;
			}
			gCarLock[carid] = 0;
			StartCar(carid);
			engineOn[carid] = 1;
			PutPlayerInVehicle(playerid,carid,0);
			LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
			UnLockCar(carid);
			for(new i = 0; i < sizeof(CreatedCars); i++)
			{
			    if(CreatedCars[i] == INVALID_VEHICLE_ID)
			    {
			        CreatedCars[i] = carid;
					break;
				}
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehicle name/ID] [color1(optional)] [color2(optional)] [respawnable(optional)]");
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
	}
	return 1;
}
Reply
#2

There is probably a group "FBI" that can only use the cheetah.
Can you show us your whole gamemode?
Reply
#3

Looks fine, the part that's wrong is probably with your OnPlayerEnterVehicle public function.
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Looks fine, the part that's wrong is probably with your OnPlayerEnterVehicle public function.
He's using the SARP gamemode, well it has tons of bugs in it and I suggest you /makeleader [yourid] fbi or whatever it is to enter it.
Reply
#5

Or add an exception to your OnPlayerStateChange (which would kick you out if you're not FBI) to NOT kick you out if the vehicle is spawned using this command.
Reply
#6

Thanks but I solved them.
I've just defined some CreateVehicle (FBI or Other Factions) and I used them in IsFBIVehicle that:
If vehicleid = FBI's vehicle return them and create new vehicle.
that's it
Thank you again.
#SOLVED.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)