So I got this menu where are 4 weapons and 1 of them is default(you spawn with it if you haven't taken another one), so I need some help with the spawn thing, so it would save the settings. I've made a menu based on the tutorial what Emp' had made. I think the spawn thing has something to do with the function, so that the WeaponName would change if the user chooses the other weapon.
PHP Code:
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1);
register_clcmd("say /weapons", "Weapons");
}
public FwdHamSpawn_Post(id)
{
SpawnedWeapon = WeaponName // Like the function SpawnedWeapon = true / false
}
public Weapons(id)
{
new menu = menu_create("\yWeapons", "menu_handler");
menu_additem(menu, "M4P1", "1", 0); // The Default weapon
menu_additem(menu, "AK47", "2", 0);
menu_additem(menu, "AWP", "3", 0);
menu_additem(menu, "Scout", "4", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
// Other stuff here, no point on writing the whole code here :)
}