View Single Post
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-26-2009 , 16:28   Re: [L4D] give player weapon
Reply With Quote #6

Code:
public TankBusterMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
{
    //Strip the CHEAT flag off of the "give" command
    new flags = GetCommandFlags("give");
    SetCommandFlags("give", flags & ~FCVAR_CHEAT);

    if ( action == MenuAction_Select ) {
        new String:info[32];

    if (strcmp(info,"option1") == 0 ) {
    {
        //Give the player a rifle
        FakeClientCommand(client, "give rifle");
    }
    else if ( strcmp(info,"option2") == 0 ) {
    {
        //Give the player a pipe_bomb
        FakeClientCommand(client, "give pipe_bomb");
    }

    //Add the CHEAT flag back to "give" command
    SetCommandFlags("give", flags|FCVAR_CHEAT);
}
__________________
CrimsonGT is offline