View Single Post
mcpan313
Senior Member
Join Date: Mar 2010
Old 04-26-2013 , 15:11   Re: Slap with GetClientAimTarget
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)

do you really want slap 66 times in second ??
I guess he needs this

PHP Code:
new g_LastButtons[MAXPLAYERS];
public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
IsButtonPressed(clientbuttonsIN_USE))
    {
        
/* code */
    
}

    if (
IsButtonReleased(clientbuttonsIN_USE))
    {
        
/* code */
    
}

    
g_LastButtons[client] = buttons;
}

stock bool:IsButtonPressed(clientbuttonsbtn)
{
    return ((
buttons btn) == btn && (g_LastButtons[client] & btn) != btn);
}

stock bool:IsButtonReleased(clientbuttonsbtn)
{
    return ((
g_LastButtons[client] & btn) == btn && (buttons btn) != btn);

__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313