/veh Bug [Help me] - 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)
+--- Thread: /veh Bug [Help me] (
/showthread.php?tid=560220)
/veh Bug [Help me] -
Alpay0098 - 27.01.2015
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;
}
Re: /veh Bug [Help me] -
xX4m4zingXx - 27.01.2015
There is probably a group "FBI" that can only use the cheetah.
Can you show us your whole gamemode?
Re: /veh Bug [Help me] -
CalvinC - 27.01.2015
Looks fine, the part that's wrong is probably with your OnPlayerEnterVehicle public function.
Re: /veh Bug [Help me] -
JaydenJason - 27.01.2015
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.
Re: /veh Bug [Help me] -
PowerPC603 - 27.01.2015
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.
Re: /veh Bug [Help me] -
Alpay0098 - 28.01.2015
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.