AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   last request (https://forums.alliedmods.net/showthread.php?t=113744)

Toastt 12-29-2009 18:35

last request
 
i made this /lr
but during the event, they can "re use it"
like they'll type /lr again during an event and they get the menu and they can choose something else.
is there a code i can put in ?

fysiks 12-29-2009 19:03

Re: last request
 
Most likely you would be removing code. Post it here.

DarkGod 12-29-2009 20:03

Re: last request
 
use a bool

new bool:IsInLR

or whatever.

Toastt 12-29-2009 21:31

Re: last request
 
whats a bool?

Toastt 12-29-2009 21:33

Re: last request
 
Quote:

Originally Posted by DarkGod (Post 1035901)
use a bool

new bool:IsInLR

or whatever.

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta_util>

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
register_clcmd("say /lr""duelo_menu");
    
register_clcmd("say !lr""duelo_menu");
    
register_clcmd("say_team /lr""duelo_menu");
    
register_clcmd("say_team !lr""duelo_menu");
    
g_iMaxPlayers get_maxplayers()
}

public 
event_round_start()
{
    for (new 
idid <= g_iMaxPlayersid++)
    {    
    
fm_set_rendering(idkRenderFxGlowShell000kRenderNormal20)
    }
}

public 
duelo_menu(id)
{    
    if (
cs_get_user_team(id) != CS_TEAM_T || !is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    }

    new 
ctCounttrCount;
    
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_alive(i))
        {
            continue;
        }
        
        switch (
cs_get_user_team(i))
        {
            case 
CS_TEAM_CT:
            {
                
ctCount++;
            }
            
            case 
CS_TEAM_T:
            {
                
trCount++;
            }
        }
    }

    if (
trCount 1)
    {
        return 
PLUGIN_HANDLED;
    }
    
    if (
ctCount == 0)
    {
        return 
PLUGIN_HANDLED;
    }
    if(
get_user_team(id) == )
    {
        new 
duelomenu menu_create("\yLast Request:""sub_duelo_menu")
        
        
menu_additem(duelomenu"\w1on1 Knife""1"0);
        
menu_additem(duelomenu"\wGun Toss""2"0);
        
menu_additem(duelomenu"\wGrenades Duel""3"0);
        
menu_additem(duelomenu"\wScout Duel""4"0);
        
        
menu_setprop(duelomenuMPROP_EXITMEXIT_ALL);
        
menu_display(idduelomenu0);
    }

    return 
PLUGIN_HANDLED;
}

public 
sub_duelo_menu(idduelomenuitem)
{
    
    if (
item == MENU_EXIT)
    {
        
menu_destroy(duelomenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[6], Name[64];
    new 
AccessCallback;
    
menu_item_getinfo(duelomenuitemAccessData,5Name63Callback);
        
    new 
Key str_to_num(Data);
    
    switch (
Key)
    {
        case 
1:
        {
            
menu(id)
        }
        case 
2
        {
            
menu2(id)
        }
        case 
3
        {
            
menu3(id)
        }
        case 
4
        {
            
menu4(id)
        }
    }

    
menu_destroy(duelomenu);

    return 
PLUGIN_HANDLED;
}

 public 
menu(id)
{

    new 
menu menu_create("\yChoose player to do request:""submenu");

     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
strip_user_weapons(tempid);
    
give_item(tempid"weapon_knife");
    
fm_set_rendering(tempidkRenderFxGlowShell00250kRenderNormal20);
    
    
strip_user_weapons(id);
    
set_user_health(id100);
    
give_item(id"weapon_knife");
    
fm_set_rendering(idkRenderFxGlowShell25000kRenderNormal20);        
            
    new 
szName[32], szName2[32];
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage02550, -1.00.4025.08.00.00.010);
    
show_hudmessage(0"%s vs %s^n Knife Duel"szNameszName2);
        
    if( 
is_user_alive(tempid) )
        
set_user_health(tempid100);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 }
 
 public 
menu2(id)
{
    new 
menu menu_create("\yChoose player to fight:""submenu2");
    
     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu2(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
strip_user_weapons(tempid);
    
give_item(tempid"weapon_deagle");
    
cs_set_user_bpammo(tempid,CSW_DEAGLE,0)
    
fm_set_rendering(tempidkRenderFxGlowShell00250kRenderNormal20)
    
    
strip_user_weapons(id)
    
set_user_health(id100)
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_DEAGLE,0)
    
fm_set_rendering(idkRenderFxGlowShell25000kRenderNormal20)
            
    new 
szName[32], szName2[32]
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage02550, -1.00.4025.08.00.00.010)
    
show_hudmessage(0"%s vs %s^n Gun Toss",szNameszName2)   

    if( 
is_user_alive(tempid) )
        
set_user_health(tempid100);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 }
 
 public 
menu3(id)
{
    
    new 
menu menu_create("\yChoose player to fight:""submenu3");

     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu3(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
strip_user_weapons(tempid);
    
give_item(tempid"weapon_hegrenade");
    
cs_set_user_bpammo(tempid,CSW_HEGRENADE,8)
    
fm_set_rendering(tempidkRenderFxGlowShell00250kRenderNormal20)
    
    
strip_user_weapons(id)
    
set_user_health(id100)
    
give_item(id"weapon_hegrenade")
    
cs_set_user_bpammo(id,CSW_HEGRENADE,8)
    
fm_set_rendering(idkRenderFxGlowShell25000kRenderNormal20)

    new 
szName[32], szName2[32]
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage02550, -1.00.4025.08.00.00.010)
    
show_hudmessage(0"%s vs %s^n Grenades Duel",szNameszName2


    if( 
is_user_alive(tempid) )
        
set_user_health(tempid100);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 }
 
 public 
menu4(id)
{
    new 
menu menu_create("\yChoose player to fight:""submenu4");

     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu4(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
strip_user_weapons(tempid);
    
give_item(tempid"weapon_scout");
    
cs_set_user_bpammo(tempid,CSW_SCOUT,10)
    
fm_set_rendering(tempidkRenderFxGlowShell00250kRenderNormal20)
    
    
strip_user_weapons(id)
    
set_user_health(id100)
    
give_item(id"weapon_scout")
    
cs_set_user_bpammo(id,CSW_SCOUT,10)
    
fm_set_rendering(idkRenderFxGlowShell25000kRenderNormal20)            
            
    new 
szName[32], szName2[32]
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage02550, -1.00.4025.08.00.00.010)
    
show_hudmessage(0"%s vs %s^n Scout Duel",szNameszName2)    

    if( 
is_user_alive(tempid) )
        
set_user_health(tempid100);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;



fysiks 12-29-2009 22:03

Re: last request
 
Quote:

Originally Posted by DarkGod (Post 1035901)
use a bool

new bool:IsInLR

or whatever.

Well, technically we shouldn't be giving him any advice since he does not ask a question. I interpreted it exactly opposite from what you did :|.

Quote:

Originally Posted by Toastt (Post 1035999)
whats a bool?

Learn to edit your freaking post.

shuttle_wave 12-29-2009 22:16

Re: last request
 
wow toast did u really make it. Nop u didnt u stole it again :( !!!

Toastt 12-29-2009 22:31

Re: last request
 
Quote:

Originally Posted by shuttle_wave (Post 1036025)
wow toast did u really make it. Nop u didnt u stole it again :( !!!

well mines basically the same thing, with more events
i just didnt want to give them out.

platzpatrone 12-29-2009 23:42

Re: last request
 
Quote:

Originally Posted by Toastt (Post 1036035)
well mines basically the same thing, with more events
i just didnt want to give them out.

if u created ur own, why not posting those code then ?
u need help for things and not posted the right code, why ?
thought that u dont created your own on scratch, did u ?

and well, u didnt answer fysiks question

MouseSplash! 12-29-2009 23:44

Re: last request
 
the REAL AUTOR is RUBEEN!!! shit...
he is furios because all peaplo change the autor and dont go update this lr...

http://forums.alliedmods.net/showthr...=ultimo+pedido


All times are GMT -4. The time now is 04:14.

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