Anti run + shoot
#3

Quote:
Originally Posted by CyNiC
Посмотреть сообщение
Knowing if the player is running(velocity higher than 15~20, make test for confirm):
pawn Код:
stock GetPlayerSpeed(playerid) // by misco
{
  new Float:Vel[3], Float:rtn;
  if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vel[0], Vel[1], Vel[2]); else GetPlayerVelocity(playerid,Vel[0], Vel[1], Vel[2]);
  rtn = floatsqroot(floatabs(floatpower(Vel[0] + Vel[1] + Vel[2], 2)));
  return floatround(rtn * 100 * 1.61);
}
The function returns the player velocity in KM/H.

You can set a timer for check if the players are sprinting and pressing the keys combination, using this method is need to stay aware that key combinations can give diferent keys return, for example press KEY_SPRINT + SUB_MISSION gives diferent keys.

https://sampwiki.blast.hk/wiki/GetPlayerKeys
https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex
Reply


Messages In This Thread
Anti run + shoot - by KeeDee - 22.03.2012, 01:00
Re: Anti run + shoot - by CyNiC - 22.03.2012, 01:17
Re: Anti run + shoot - by [ABK]Antonio - 22.03.2012, 02:55

Forum Jump:


Users browsing this thread: 1 Guest(s)