what is the id on sprint?
#1

what is the id on the sprint button?
Reply
#2

You mean Key ID? It is KEY_SPRINT...
Reply
#3

yea, thanks also one more thing so i have this

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_SPRINT)
    {
		if(IsPlayerInAnyVehicle(playerid)}
		{
		    ModifyVehicleSpeed(-1);
		}
	}
	return 1;
}




stock ModifyVehicleSpeed(mph)
{
	new Float:Vx,Float:Vy,Float:Vz,Float:DV,Float:multiple;
	for( new c = 1; c <= MAX_VEHICLES; c ++ )
	{
		GetVehicleVelocity(c,Vx,Vy,Vz);
		DV = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
		if(DV > 0)
		{
			multiple = ((mph + DV * 100) / (DV * 100));
			return SetVehicleVelocity(c,Vx*multiple,Vy*multiple,Vz*multiple);
		}
	}
	return 0;
}
and i have these errors

Код:
C:\Users\Andrei\Desktop\Andrei\zPlague -v2-\filterscripts\slowmotion.pwn(174) : error 029: invalid expression, assumed zero
C:\Users\Andrei\Desktop\Andrei\zPlague -v2-\filterscripts\slowmotion.pwn(175) : error 001: expected token: ")", but found "}"
C:\Users\Andrei\Desktop\Andrei\zPlague -v2-\filterscripts\slowmotion.pwn(175) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
can you please explain what i was doing wrong?
Reply
#4

Could you specify some line numbers on the script?
Reply
#5

Edit: Nvm, Finn already posted my question.
Reply
#6

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_SPRINT)
    {//line...
		if(IsPlayerInAnyVehicle(playerid))
		{
		    ModifyVehicleSpeed(-1);
		}
	}
	return 1;
}
i fixed other errors

Код:
C:\Users\Andrei\Desktop\Andrei\zPlague -v2-\filterscripts\slowmotion.pwn(169) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Additional bracket at (newkeys & KEY_SPPRINT), remove one of them before newkeys.
Also at this line you have a brace "}" instead of a bracket ")":
pawn Код:
if(IsPlayerInAnyVehicle(playerid)}
Reply
#8

pawn Код:
if(newkeys & KEY_SPRINT)
Instead of:
pawn Код:
if((newkeys & KEY_SPRINT)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)