Raised This Month: $ Target: $400
 0% 

Whats the problem here?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Udi
Junior Member
Join Date: Aug 2009
Old 12-24-2009 , 10:06   Whats the problem here?
Reply With Quote #1

Ive tried to make on menu to activate another plugin with the server_cmd command. while the compile he gave me error: Error: Invalid function call, not a valid address on line 435
The errors with bold and underline
Code:
public submenu5(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 tempid = str_to_num(data);
    strip_user_weapons(tempid);
    server_cmd("molotov_give %d",id())
    fm_set_rendering(tempid, kRenderFxGlowShell, 0, 0, 250, kRenderNormal, 20)
    
    strip_user_weapons(id)
    set_user_health(id, 250)
    server_cmd("molotov_give %d",id())
    fm_set_rendering(id, kRenderFxGlowShell, 250, 0, 0, kRenderNormal, 20)
            
    new szName[32], szName2[32]
    get_user_name(id, szName, 31);
    get_user_name(tempid, szName2, 31);
    set_hudmessage( 0, 255, 0, -1.0, 0.40, 2, 5.0, 8.0, 0.0, 0.0, 10)
    show_hudmessage(0, "%s vs %s^n Molotov Duel",szName, szName2)   

    if( is_user_alive(tempid) )
        set_user_health(tempid, 250);
    
    menu_destroy(menu);
    return PLUGIN_HANDLED;
 }
Udi is offline
jackpf
Senior Member
Join Date: Dec 2009
Location: Uhm...
Old 12-24-2009 , 10:20   Re: Whats the problem here?
Reply With Quote #2

Unless you've defined the function yourself, server_cmd() doesn't exist. Do you mean ServerCommand()?
jackpf is offline
Udi
Junior Member
Join Date: Aug 2009
Old 12-24-2009 , 10:32   Re: Whats the problem here?
Reply With Quote #3

I searched at google how to and it found server_cmd and at the studio it shows too..
so how do i fix it?
Udi is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 12-24-2009 , 12:02   Re: Whats the problem here?
Reply With Quote #4

That aint SourcePawn code. Looks like AMX, might get more help over there.
pheadxdll is offline
Udi
Junior Member
Join Date: Aug 2009
Old 12-24-2009 , 12:23   Re: Whats the problem here?
Reply With Quote #5

oh wrong place,, srry
Udi is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-24-2009 , 12:53   Re: Whats the problem here?
Reply With Quote #6

Moved to the proper forum.
bl4nk is offline
Indig0
Junior Member
Join Date: Dec 2009
Old 12-24-2009 , 14:13   Re: Whats the problem here?
Reply With Quote #7

I think where is no function id()... remove (). id is a variable. Sorry if I'm wrong.
Indig0 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 04:13.


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