AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem passing info (https://forums.alliedmods.net/showthread.php?t=94498)

xtcp 06-12-2009 00:31

Problem passing info
 
Code:

public plugin_init()
{
    register_srvcmd("eplay_select", "cmdSelMenu", -1, "<gid> - displays select menu")
    register_menucmd(register_menuid("select menu"), 1023, "actionSelMenu")
}


public cmdSelMenu(id, level, cid)
{
    new gid[192], steamid[33], victim

    read_argv(1, steamid, 32)

    read_args(gid, 191)

    remove_quotes(gid)

    parse(gid, steamid, 32)

    victim = cmd_target(id, steamid)
       
        if (!victim)
            return PLUGIN_HANDLED

    display_selectmenu(victim, g_menuposition[id] = 0, gid)

    return PLUGIN_HANDLED
}



display_selectmenu(id, pos, gid)
{
    if(pos < 0) 
        return
       
    new gidx = gid

            log_message("GID: ^"%s - %s^"", gidx, gid)
      new start = pos * 8
      if(start >= 10)
            start = pos = g_menuposition[id]

      new end = start + 8
    if(end > 10)
            end = 10
   
    static menubody[512]   
      new len = format(menubody, 511, "\wEscolhe um jogador para a tua equipa^n^n")

    new b = 0
    new keys = MENU_KEY_0

    new Sql:dbc
      dbc = init_sql()
    if (dbc == SQL_FAILED) {
    client_print(id,print_chat,"error.")   
    return
    }

    new Result:result
    new cnd = 0
    new auth[32]

    result = dbi_query(dbc,"SELECT auth FROM `players` WHERE `gid` = '%s' AND `don` = '0'", gidx)

    while(dbi_nextrow(result)>0)
    {

        dbi_result(result,"auth",auth, 31)
        len += format(menubody[len], 511 - len, "%i: %s\w^n", b, auth)
        g_menuplayers[id][cnd] = auth[31]
        keys |= (1<<b)
        ++cnd
        ++b
    }
    dbi_free_result(result)
    dbi_close(dbc)


/*
      if(end != cnd)
      {
            format(menubody[len], 511 - len, "^n9. %s...^n0. %s", "More", pos ? "Back" : "Exit")
            keys |= MENU_KEY_9
      }
      else
        format(menubody[len], 511-len, "^n0. %s", pos ? "Back" : "Exit")
    */

      show_menu(id, keys, menubody, -1, "select menu")
}

I get the error 035 argument type mismatch, how can I pass that gid to the other function?

Thank you in advance

Arkshine 06-12-2009 04:26

Re: Problem passing info
 
gid is a string. So it should be display_selectmenu(id, pos, gid[] )


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

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