SA-MP Forums Archive
Velocity help pls - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Velocity help pls (/showthread.php?tid=154346)



Velocity help pls - Abraham2nd - 13.06.2010

ok i try to add velocity and well it has to functions: 1 a boost and 2 a jump.
the jump works and the boost doesnt this is what i get when compile:

Код:
C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\Velocity.pwn(41) : warning 217: loose indentation
C:\Documents and Settings\Abraham2\My Documents\SAMP SERVERS\ser 0.3\filterscripts\Velocity.pwn(46) : warning 203: symbol is never used: "OnPlayerUpdate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
and all i have in the filterscript is:


Код:
#include <a_samp>

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

new Tick[MAX_PLAYERS];

OnPlayerUpdate(playerid)
{
	Tick[playerid]++;
	if(Tick[playerid] != 3) return 1;
	Tick[playerid] = 0;
 	new Keys,up,down;
    	GetPlayerKeys(playerid,Keys,up,down);
	new Float:x,Float:y,Float:z;
	if(Keys &= 1024)
	{
  		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
		{

			GetPlayerVelocity(playerid,x,y,z);
			SetPlayerVelocity(playerid,x*1.2,y*1.2,z*1.2);
		}
	}
 	else if(Keys &= 4)
   	{
    	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
			GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
			SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.2,y*1.2,z*1.2);
		}
	}
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (PRESSED(KEY_HANDBRAKE)) // Change KEY_HANDBRAKE to your choice of PlayerKeys
	{
    new Float:x, Float:y, Float:z;
	GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
	SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
	}
	return 1;
}
Please help me get boost working thx

Sry for double topic internet screwed up that time
Anyone??


Re: Velocity help pls - MadeMan - 14.06.2010

pawn Код:
#pragma tabsize 0
pawn Код:
public OnPlayerUpdate(playerid)