AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Whats the problem here? (https://forums.alliedmods.net/showthread.php?t=113195)

Udi 12-24-2009 10:06

Whats the problem here?
 
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;
 }


jackpf 12-24-2009 10:20

Re: Whats the problem here?
 
Unless you've defined the function yourself, server_cmd() doesn't exist. Do you mean ServerCommand()?

Udi 12-24-2009 10:32

Re: Whats the problem here?
 
I searched at google how to and it found server_cmd and at the studio it shows too..
so how do i fix it?

pheadxdll 12-24-2009 12:02

Re: Whats the problem here?
 
That aint SourcePawn code. Looks like AMX, might get more help over there. :wink:

Udi 12-24-2009 12:23

Re: Whats the problem here?
 
oh wrong place,, srry

bl4nk 12-24-2009 12:53

Re: Whats the problem here?
 
Moved to the proper forum. :up:

Indig0 12-24-2009 14:13

Re: Whats the problem here?
 
I think where is no function id()... remove (). id is a variable. Sorry if I'm wrong.


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

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