AlliedModders

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

kramesa 11-20-2011 17:42

Help
 
Where can I get the Steamid from selected User?

PHP Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init() 
{
    
register_clcmd("say .eac","Show_Menu")
}
    
public 
Show_Menu(id
{    
    new 
menu menu_create("Selecione o Jogador" "menu_handle");
    
    new 
i,Nr[3],Name[32]
    for (
i=1i<=32i++)
    {
        
        if(
is_user_connected(i))
        {
            
format(Nr,2,"%i",i)
            
get_user_name(i,Name,31)
            
menu_additem(menu ,NameNr 0);
        }
        
    }
    
menu_setprop(menu MPROP_EXIT MEXIT_ALL);
    
menu_display(id menu 0);
    return 
PLUGIN_CONTINUE
}

public 
menu_handle(id menu item
{
    if(
item == MENU_EXIT
        
menu_destroy(menu);
        
        
    new 
szCommand[6] , szName[64];
    new 
Access callback;
    
    
menu_item_getinfo(menu item Access szCommand szName 63 callback);
    
    new 
szText[100], name[32], ip[32], port[32], steam[32], day[32]
    
    
get_user_name(idname31)
    
get_user_authid(idsteam31)
    
get_cvar_string("ip"ip31)
    
get_cvar_string("port"port31)
    
get_time("%d.%m.%Y"day31)
    
    
client_print(idprint_chat"Jogador escolhido: %s [%s]"namesteam)
    
    
formatex(szTextcharsmax(szText), "<iframe height=^"511^" width=^"1022^" src=^"http://eac.turbogames.com.br/shots/cstrike/%s_%s/%s/%s^"></iframe>", ip, port, day, steam)
    
    
show_motd(idszText"EAC Shot")
    
    
menu_destroy(menu);
    return 
PLUGIN_CONTINUE



Erox902 11-21-2011 07:05

Re: Help
 
http://forums.alliedmods.net/showthr...364#PlayerMenu
Check this and also notice the "szTempid", and stop hardcoding every value (use charsmax or sizeof).
Also I belive steamid atleast needs 35 bytes not 32.


All times are GMT -4. The time now is 08:24.

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