Quote:
Originally Posted by damage220
Hi. There are IN_ATTACK and IN_ATTACK2 flags.
PHP Code:
public client_PreThink(cid) { new btn;
if(!is_user_alive(cid)) return; btn = get_user_button(cid); if(!(btn & IN_ATTACK)) return; /* do some things */ }
|
PreThink is more effective than cmd start? i mean for the cpu
PHP Code:
public @ClientCommand_Instant( Client, Handle )
{
if(!is_user_alive( Client ))
{
return 1;
}
else
{
if(!__int_Transformation[Client][5]) // Cant make an instant transformation
{
return 1;
}
else
{
if(__int_Transformation[Client][0]) // Is in a transformation
{
return 1;
}
else
{
if(get_user_weapon( Client ) != 1) // Not holding the correct weapon
{
return 1;
}
else
{
if(!get_pdata_int( Client, 198 )) // Not blocking
{
return 1;
}
else
{
static Control; Control = get_uc(Handle, UC_Buttons);
if((Control == IN_ATTACK))
{
fxChargeInstant( Client );
}
}
}
}
}
}
return 0;
}
im doing this in CMD_Start