Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <hamsandwich>
- #define PLUGIN "Respawn Status"
- #define VERSION "1.0"
- new g_bStatus;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, "ma-ta")
- RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled", 0);
- register_clcmd("say /respawn","cmdSayRespawn")
- register_clcmd("say_team /respawn","cmdSayRespawn")
- }
- public cmdSayRespawn(id)
- {
- if(!(get_user_flags(id) & ADMIN_IMMUNITY))
- {
- client_print(id, print_chat, "Nu ai acces la comanda !");
- return PLUGIN_HANDLED;
- }
- new szText[192];
- new menu = menu_create("Change RESPAWN status", "handlerMenu");
- switch(g_bStatus)
- {
- case true: formatex(szText, 191, "RESPAWN - yON")
- case false: formatex(szText, 191, "RESPAWN - dOFF")
- }
- menu_additem(menu, szText, "1", 0)
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- return PLUGIN_HANDLED;
- }
- public handlerMenu(id, menu, item)
- {
- if( item == MENU_EXIT )
- {
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- new data[6], iName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
- new key = str_to_num(data);
- switch(key)
- {
- case 1:
- {
- switch(g_bStatus)
- {
- case true:
- {
- g_bStatus = false;
- client_print(id, print_chat, "Respawnul a fost dezactivat !");
- }
- case false:
- {
- g_bStatus = true;
- client_print(id, print_chat, "Respawnul a fost activat !");
- }
- }
- cmdSayRespawn(id);
- }
- }
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- public Ham_PlayerKilled(victim, attacker, shouldgib)
- {
- if(g_bStatus)
- set_task(1.0,"Respawn_Player", victim);
- }
- public Respawn_Player(id)
- {
- ExecuteHam(Ham_CS_RoundRespawn, id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement