30.12.2009, 18:05
#include <a_samp>
new PlayerUsingBug[MAX_PLAYERS];
new PlayerBugTimer[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsBugWeapon(playerid) && newkeys & KEY_FIRE) { PlayerUsingBug[playerid] = 1, PlayerBugTimer[playerid] = SetTimerEx("BugTimeOut",1000,0,"i",playerid); }
if(PlayerUsingBug[playerid]==1 && newkeys & KEY_CROUCH) { ApplyAnimation(playerid,"PED","getup",4.1,0,0,0,0, 0), PlayerUsingBug[playerid] = 0, KillTimer(PlayerBugTimer[playerid]); }
return 1;
}
forward BugTimeOut(playerid); public BugTimeOut(playerid) { PlayerUsingBug[playerid]=0; }
stock IsBugWeapon(playerid)
{
switch(GetPlayerWeapon(playerid)) { case 24,25,27,34: return true; }
return false;
}
new PlayerUsingBug[MAX_PLAYERS];
new PlayerBugTimer[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsBugWeapon(playerid) && newkeys & KEY_FIRE) { PlayerUsingBug[playerid] = 1, PlayerBugTimer[playerid] = SetTimerEx("BugTimeOut",1000,0,"i",playerid); }
if(PlayerUsingBug[playerid]==1 && newkeys & KEY_CROUCH) { ApplyAnimation(playerid,"PED","getup",4.1,0,0,0,0, 0), PlayerUsingBug[playerid] = 0, KillTimer(PlayerBugTimer[playerid]); }
return 1;
}
forward BugTimeOut(playerid); public BugTimeOut(playerid) { PlayerUsingBug[playerid]=0; }
stock IsBugWeapon(playerid)
{
switch(GetPlayerWeapon(playerid)) { case 24,25,27,34: return true; }
return false;
}