Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: self.name help

  1. #1
    ... connecting
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    self.name help

    Hi, I wanted to know if they can help. I need to press on the name of a player leaves the name selected by a iprintln.

    When you select any name from the list always comes in the name I'm using and not the one you selected it.

    Click image for larger version. 

Name:	1.jpg 
Views:	129 
Size:	39.2 KB 
ID:	757

    Always out, or if my change my name out which I use, not the one I select.

    Click image for larger version. 

Name:	2.jpg 
Views:	124 
Size:	20.9 KB 
ID:	758

    PHP Code:
    menuDef
        
    {
            
    name            "demoplayer"
            
    rect            0 0 640 480
            focuscolor        GLOBAL_FOCUSED_COLOR
            style            WINDOW_STYLE_EMPTY
            blurWorld        5.0
            onEsc 
            
    {
                
    close demoplayer;
            }

            
    // Gradient
            
    itemDef
            
    {
                
    style            WINDOW_STYLE_SHADER
                
    //rect            -107 0 554 480
                
    rect            0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
                background        
    "gradient"
                
    visible            1
                decoration
            
    }

            
    #include "ui/bars.menu"

            
    itemDef
            
    {
                
    type            ITEM_TYPE_TEXT
                visible            1
                origin            ORIGIN_TITLE
                forecolor        1 1 1 1
                text            
    "Peticion de demo"
                
    textfont        UI_FONT_NORMAL
                textscale        GLOBAL_HEADER_SIZE
                decoration
            
    }

    // DEMO PLAYER
            
    itemDef 
            
    {
                
    visible            1
                rect            0 0 192 270
                origin            73 80
                forecolor        GLOBAL_UNFOCUSED_COLOR
                style            WINDOW_STYLE_FILLED
                outlinecolor    .5 .5 .5 .5
                type            ITEM_TYPE_LISTBOX
                textscale        GLOBAL_TEXT_SIZE
                textstyle        ITEM_TEXTSTYLE_SHADOWED
                textfont        UI_FONT_NORMAL
                textaligny        
    -1
                elementtype        LISTBOX_TEXT
                elementwidth    120
                elementheight    24
                feeder            FEEDER_PLAYER_LIST
                columns            1 2 190 25
                mouseEnter
                
    {
                    
    fadein message_arena
                

                
    mouseExit
                
    {
                    
    fadeout message_arena
                
    }
            }
            
    itemDef 
            
    {
                
    visible            1
                rect            0 0 128 24
                origin            ORIGIN_OK
                forecolor        GLOBAL_UNFOCUSED_COLOR
                type            ITEM_TYPE_BUTTON
                text            
    "@MPUI_OK"
                
    textfont        UI_FONT_NORMAL
                textscale        GLOBAL_TEXT_SIZE
                textstyle        ITEM_TEXTSTYLE_SHADOWED
                textaligny        20
                action
                
    {
                    
    play "mouse_click";
                    
    scriptMenuResponse "demo";
                    
    close demoplayer;
                    
    exec "wait 100";
                    
    exec "ScreenShotJPEG";
                    
    scriptMenuResponse "demoss";
                }
                
    onFocus
                
    {
                    
    play "mouse_over";
                }
            }
        } 
    scriptMenuResponse "demo"

    PHP Code:
    demopetition()

        
    iprintln ("" self.name " ^7a foro, peticion de demo & cleandod.");


    scriptMenuResponse "demoss"

    PHP Code:
    demopetitionss()

        
    self iprintln ("^2ScreenShotJPEG Guardada!");

    As I can make out the name you select from the list of players?
    Last edited by kung foo man; 13th September 2014 at 13:23. Reason: Please upload images next time as attachment, dead-link-prevention

  2. #2
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    The player who uses the menu is recording a demo and taking a screenshot of himself.
    self refers to the player who is using the menu, and since you're printing self.name, you're printing the name of the player who is using the menu.
    The response of the menu should be the ID number of the player you selected from the list (I don't know how to do that, would be useful for me to know it).
    This is how it should your function should look then:

    PHP Code:
    demopetition(menu_response
    {  
        
    players getentarray("player""classname");
        
    iprintln ("" players[menu_response].name " ^7a foro, peticion de demo & cleandod."); 

    Last edited by guiismiti; 13th September 2014 at 06:13.

  3. #3
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    It is NOT possible without hacking the CoD2 exe to do this. The list is a FEEDER_LIST and interacts with cod2 uiscripts which cannot be modified only called via .menu.
    However you can build your own list with names and show them with the dvar command (again via .menu).
    You have then manually via .gsc script manage this yourself and you will not be able to have a nice scrollbar on the side.
    You have to use a shitload ov clientcvar on each player(-name) OR server cvars and call makeCvarServerInfo().
    There are alot of examples on this site of how it is done.

  4. The Following User Says Thank You to serthy For This Useful Post:

    guiismiti (13th September 2014)

  5. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    No need to hack the client, the server is enough (aka libcod).

    The player vote kick menu is sending ClientCommand's, which can be pre-processed and then ignored (so no vote will be called, just "return" out of callback).

    Code for _callbacksetup.gsc:

    PHP Code:
    CodeCallback_PlayerCommand(args)
    {
        
    output "";
        for (
    i=0i<args.sizei++)
            
    output += args[i] + ", ";
        
        
    printf("PLAYER COMMAND! message=\"%\"\n"output);
        
    //self iprintlnbold("you wrote: " + output);
        
    args fixChatArgs(args);

        
    // ...
        // ...
        // ... 
    Output:

    Code:
    PLAYER COMMAND! message="mr, 32, 1, axis, "
    PLAYER COMMAND! message="mr, 32, 3, kar98k_mp, "
    PLAYER COMMAND! message="mr, 32, 0, callvote, "
    PLAYER COMMAND! message="callvote, tempBanUser, kung, "
    Whole code here: http://killtube.org/showthread.php?1...-B3!%29&p=4374
    timescale 0.01

  6. The Following User Says Thank You to kung foo man For This Useful Post:

    guiismiti (13th September 2014)

  7. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by kung foo man View Post
    No need to hack the client, the server is enough (aka libcod).

    The player vote kick menu is sending ClientCommand's, which can be pre-processed and then ignored (so no vote will be called, just "return" out of callback).

    Code for _callbacksetup.gsc:

    PHP Code:
    CodeCallback_PlayerCommand(args)
    {
        
    output "";
        for (
    i=0i<args.sizei++)
            
    output += args[i] + ", ";
        
        
    printf("PLAYER COMMAND! message=\"%\"\n"output);
        
    //self iprintlnbold("you wrote: " + output);
        
    args fixChatArgs(args);

        
    // ...
        // ...
        // ... 
    Output:

    Code:
    PLAYER COMMAND! message="mr, 32, 1, axis, "
    PLAYER COMMAND! message="mr, 32, 3, kar98k_mp, "
    PLAYER COMMAND! message="mr, 32, 0, callvote, "
    PLAYER COMMAND! message="callvote, tempBanUser, kung, "
    Whole code here: http://killtube.org/showthread.php?1...-B3!%29&p=4374
    hey, you stole my idea i had 3 months ago
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #6
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    How can I link the menu response to a function?

    I want to improve the air strike mod.
    I'll create a new menu which can be opened from the ingame menu.
    This menu will have the superior view of the current map. Over this background image, there will be a matrix of several menu elements. The text of each element should be a dot ".". The position of the air strike target will be defined depending on the menu response (each dot will send a different response).
    Considering that the size of each map is different (width and length), I'll add dvartest for the dots, to disable the ones outside the map area.

    Editted: already having trouble getting the superior view of large maps (like Iwo Jima). Will try it in radiant, althought I never used it before.
    Last edited by guiismiti; 13th September 2014 at 21:53.

  9. #7
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    imho not worth the hassle
    I'd go with this method:
    when calling in an airstrike, simple move the player up to 10000 and let the position be a bullettrace of the players view. this does not require e special setup menu, saves alot ov client cvars and you do not have to deal with the map-image of each map.

  10. #8
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Sounds nice, but the visibility on Iwo Jima is horrible

    Click image for larger version. 

Name:	shot0000.jpg 
Views:	121 
Size:	50.7 KB 
ID:	760

  11. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    just set fx_enable to 0 while in air
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  12. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by IzNoGoD View Post
    hey, you stole my idea i had 3 months ago
    Here's the final version of said idea (implemented today for i was bored)

    http://classic.xfire.com/video/62ca27/ (watch it in fullscreen mode)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  13. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (17th September 2014),serthy (17th September 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •