Velocity switch Key Grrrrrrr
#1

Dear All

this is something a bit stupid
but I'm obstinate and not to do
my admins use the Control key
to increase the speed of any vehicle in which going
when I'm driving really bothers me to press that key
and when we run a race
I have to threaten to degrade their status if they use
when we go on Hydra's can not shoot
because that increase the speed: S
this can be done only administrators level 1 +

I need it sooner, the better off
I'll be crazy if they continue to do: S

I'm use the v9 ​​SATDM gamemode
greatly appreciate if any of you help

thanks
Reply
#2

Well, find the code that uses the cntrl key and put before it, "if(Race[playerid] == 1) return 0;", change Race to the variable you use to store if the player is in a race or not. for the hydra, find the ID of the hydra and put something like, "if(IsPlayerInVehicle(HYDRA_ID_HERE)) return 0;"
Reply
#3

Well Cale i cant find into the code cntrl key or something like it, =/
Reply
#4

It would be under OnPlayerKeyStateChange callback.
Reply
#5

What do you think about this code?

Код:
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Reply
#6

No that doesn't Set vehicles speed. Search for SetVehicleVelocity under OnPlayerKeyStateChange
Reply
#7

i found this but its between /* */ but should not work

Код:
	/*if(newkeys & KEY_SPRINT) {
	    if(PlayerInfo[playerid][Level] >=1) {
			if (IsPlayerInAnyVehicle(playerid))
			{
				new Float:vx, Float:vy, Float:vz;
				GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
				SetVehicleVelocity(GetPlayerVehicleID(playerid) ,vx/1.7,vy/1.7 ,vz/1.7);
			}
		}
	}*/
Reply
#8

hahahahahahaha thanks very much dude, You gave me great joy today

that is the code, i disable it

Код:
if(newkeys & KEY_ACTION)
	{
		if(PlayerInfo[playerid][Level] >=1) {
			if (IsPlayerInAnyVehicle(playerid))
			{
				if((GetPlayerVehicleID(playerid) == 520) || (GetPlayerVehicleID(playerid) == 425) || (GetPlayerVehicleID(playerid) == 464)) {
					return 1;
				}
				else {
					new Float:vx, Float:vy, Float:vz;
					GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
					SetVehicleVelocity(GetPlayerVehicleID(playerid) ,vx*2,vy*2 ,vz*2);
				}
			}
		}
	}
Reply
#9

Do that or change the admin level requirement so only your level of admin (probably higher then 1?) can use It,
and you can show them how to abuse it correctly :P
Reply
#10

already begun to be heard the cries of some hahahaha

I have another small problem
I hope you can guide me with this
I have created some new areas
these areas are a little above the sea
are quite large areas and this is where admins we live
and you can imagine the amount of vehicles that we have
the issue is with the refresh rate!
As we approach the area
vehicles first appear then
These fall into the water and then
houses and objects are displayed

I have a command called /rac
this command respawn all empty vehicles
and add it into the command we have to transport ("/az")
to that area, but this does not help much, since equally
As we approach another vehicle passes the same
what do you can think about it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)