Raised This Month: $51 Target: $400
 12% 

[Request] Revive Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desperons
Junior Member
Join Date: Dec 2018
Old 01-04-2019 , 14:44   [Request] Revive Menu
Reply With Quote #1

Hi! I need a plugin in which only the CT players can access the Revive Menu by typing the command "/revive" and they can revive only the T players! Thanks in advance!
Desperons is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-05-2019 , 09:06   Re: [Request] Revive Menu
Reply With Quote #2

Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

 public plugin_init()
 {
    register_clcmd( "say /revive","ReviveMenu" );
 }

 public ReviveMenu( id )
 {
    new menu = menu_create( "\rRevive Menu", "revive_menu_handler" );

    new players[32], pnum, tempid;

    new szName[32], szUserId[32], nameu[92];

    formatex(nameu,charsmax(nameu), "\yRefresh");
    menu_additem(menu, nameu,"rf_c", 0);
    menu_addblank(menu,0)

    get_players( players, pnum, "c" ); 

    for ( new i; i<pnum; i++ )
    {
        tempid = players[i];

        if(get_user_team(tempid) == 1)
        {
            get_user_name( tempid, szName, charsmax( szName ) );

            formatex( szUserId, charsmax( szUserId ), "%d", get_user_userid( tempid ) );

            menu_additem( menu, szName, szUserId, 0 );
        }
    }
    if(get_user_team(id) == 1 || get_user_team(id) == 3 )
    {
        client_print(id,print_chat,"Only CT have access to this command")
        return PLUGIN_HANDLED
    }
    else if(get_user_team(id) == 2)
    {
        menu_display( id, menu, 0 );
    }
    return PLUGIN_HANDLED
 }

 public revive_menu_handler( id, menu, item )
 {
    if ( item == MENU_EXIT )
    {
        menu_destroy( menu );
        return PLUGIN_HANDLED;
    }

    new szData[6], szName[64];
    new _access, item_callback;

    menu_item_getinfo( menu, item, _access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );

    if(equali(szData,"rf_c"))
    {
        menu_destroy( menu );
        ReviveMenu(id)
        return PLUGIN_CONTINUE
    }

    new userid = str_to_num( szData );

    new player = find_player( "k", userid );

    if(is_user_alive(player))
    {
        client_print(id,print_chat,"Only Death players you can revive")
        return PLUGIN_HANDLED
    }

    ExecuteHamB(Ham_CS_RoundRespawn, player) 

    menu_destroy( menu );
    return PLUGIN_HANDLED;
 }

Last edited by raizo11; 01-07-2019 at 13:42.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Desperons
Junior Member
Join Date: Dec 2018
Old 01-06-2019 , 10:08   Re: [Request] Revive Menu
Reply With Quote #3

Sorry man, your plugin didn't meet the terms that I wanted so I decided to create one by myself. Problem solved!
Desperons is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-06-2019 , 12:10   Re: [Request] Revive Menu
Reply With Quote #4

Quote:
Originally Posted by Desperons View Post
Hi! I need a plugin in which only the CT players can access the Revive Menu by typing the command "/revive" and they can revive only the T players! Thanks in advance!
I think that's what you asked for... any way..I do not win anything if i help you..this is a last post..now must to pay for this!
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-06-2019 , 13:53   Re: [Request] Revive Menu
Reply With Quote #5

Desperons try solution from post #2 after the edit.

Btw raizo11 optimize your code its bad coded spectators or unassigned can open the menu.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-06-2019 at 13:55.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Desperons
Junior Member
Join Date: Dec 2018
Old 01-06-2019 , 14:14   Re: [Request] Revive Menu
Reply With Quote #6

Guys, thank you for helping me, seriously! But I just made one by myself and it's working as I wanted, I'll let you see the code here, only the CT can open it and they can revive only the T, that's what I wanted:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PREFIX "[Revive]"

public plugin_init()
{
    
register_clcmd("say /revive","players_menu")
}

public 
players_menu(id)
{
    if(
cs_get_user_team(id)!=CS_TEAM_CT)    return PLUGIN_HANDLED
    
    
new plmenu menu_create("Choose the player to revive:""plmenu_handler");

    new 
s_Players[32], i_Numi_Player,s_Name[32], s_Player[10];
    
get_players(s_Playersi_Num"bce""TERRORIST");
    
    for (new 
ii_Numi++)
    {
        
i_Player s_Players[i];
        if(
is_user_bot(i_Player)||is_user_alive(i_Player)||cs_get_user_team(i_Player)!=CS_TEAM_T)    continue
        
get_user_name(i_Players_Namecharsmax(s_Name));
        
num_to_str(i_Players_Playercharsmax(s_Player));
        
menu_additem(plmenus_Names_Player0);
    }

    
menu_setprop(plmenuMPROP_EXITMEXIT_ALL);
    
menu_display(idplmenu0);

    return 
PLUGIN_HANDLED;
}
public 
plmenu_handler(idplmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;
    
menu_item_getinfo(plmenuitemaccesscommandsizeof command 1namesizeof name 1callback);

    new 
i_Player str_to_num(command),reviver_name[64], revived_name[64];
    
get_user_name(idreviver_namecharsmax(reviver_name));
    
get_user_name(i_Playerrevived_namecharsmax(revived_name));
    
    if (!
is_user_alive(i_Player) && cs_get_user_team(i_Player)==CS_TEAM_T&&!is_user_bot(i_Player))
    {
        
ExecuteHamB(Ham_CS_RoundRespawni_Player);
        
players_menu(id);
    
    
menu_destroy(plmenu);
    return 
PLUGIN_HANDLED;

Desperons is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-06-2019 , 14:43   Re: [Request] Revive Menu
Reply With Quote #7

Quote:
Originally Posted by Desperons View Post
I just made one by myself
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PREFIX "[Revive]"

public plugin_init()
{
    
register_clcmd("say /revive","players_menu")
}

public 
players_menu(id)
{
    if(
cs_get_user_team(id)!=CS_TEAM_CT)    return PLUGIN_HANDLED
    
    
new plmenu menu_create("Choose the player to revive:""plmenu_handler");

    new 
s_Players[32], i_Numi_Player,s_Name[32], s_Player[10];
    
get_players(s_Playersi_Num"bce""TERRORIST");
    
    for (new 
ii_Numi++)
    {
        
i_Player s_Players[i];
        if(
is_user_bot(i_Player)||is_user_alive(i_Player)||cs_get_user_team(i_Player)!=CS_TEAM_T)    continue
        
get_user_name(i_Players_Namecharsmax(s_Name));
        
num_to_str(i_Players_Playercharsmax(s_Player));
        
menu_additem(plmenus_Names_Player0);
    }

    
menu_setprop(plmenuMPROP_EXITMEXIT_ALL);
    
menu_display(idplmenu0);

    return 
PLUGIN_HANDLED;
}
public 
plmenu_handler(idplmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;
    
menu_item_getinfo(plmenuitemaccesscommandsizeof command 1namesizeof name 1callback);

    new 
i_Player str_to_num(command),reviver_name[64], revived_name[64];
    
get_user_name(idreviver_namecharsmax(reviver_name));
    
get_user_name(i_Playerrevived_namecharsmax(revived_name));
    
    if (!
is_user_alive(i_Player) && cs_get_user_team(i_Player)==CS_TEAM_T&&!is_user_bot(i_Player))
    {
        
ExecuteHamB(Ham_CS_RoundRespawni_Player);
        
players_menu(id);
    
    
menu_destroy(plmenu);
    return 
PLUGIN_HANDLED;

https://www.extreamcs.com/forum/cere...cd565f79766ba8
no, you haven't made it by yourself
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode