I am currently working at naruto mod and i need to know if iam doing this correctly:
PHP Code:
public PlayerPreThink(id)
{
new button = pev(id, pev_button)
new oldbuttons = pev(id, pev_oldbuttons)
if(buttons & IN_ATTACK2 && !(oldbuttons & IN_ATTACK2)) // Press One Time In Attack2, start using chakra
{
Attack_With_Chakra[id] = true
set_task(3.0, "remove_attack_with_chakra", id)
}
if(buttons & IN_ATTACK && !(oldbuttons & IN_ATTACK)) // Press One Time Attack and if using chakra, send the kunai
{
if(Attack_With_Chakra[id])
pull_kunai(id)
}
if(buttons & IN_USE && oldbuttons & IN_USE) // Reload Chakra
{
if(Chakra[id] < Max_Chakra[id])
Chakra[id]++
else
client_print(id, print_center, "You Reached Max Chakra!")
}
return FMRES_IGNORED
}
public remove_attack_with_chakra(id)
{
Attack_With_Chakra[id] = false
}
Also i need to know if player is moving or not for reload chakra and i need to detect if is using chackra (Attack_With_Chakra[id]) and moving at same time (For make player faster)
__________________