Event yang sm lebih baik di panggil melalu 1 function.
Code
register_event("ResetHud", "admin_weapons", "b")
register_event("ResetHud", "bot_weapons", "b")
->
Code
register_event("ResetHUD", "Event_ResetHUD", "b")
Code
public admin_weapons(id)
{
if(is_user_alive(id))
{
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
give_item(id, "weapon_scout")
give_item(id, "ammo_762nato")
give_item(id, "ammo_762nato")
}
}
public bot_weapons(id)
{
if(is_user_bot(id))
{
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
give_item(id, "weapon_scout")
give_item(id, "ammo_762nato")
give_item(id, "ammo_762nato")
}
}
->
Code
public Event_ResetHUD(id)
{
if(is_user_alive(id) || is_user_bot(id))
{
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
give_item(id, "weapon_scout")
give_item(id, "ammo_762nato")
give_item(id, "ammo_762nato")
}
}
Lebih hemat memory.
Unapproved.