Getplayer: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
.
Line 1: Line 1:
getplayer[<player id>].<functionname> <gamevar>
This allows you to fetch the value of one of the [[members of the player structure]] to a [[gamevar]].


This sets the [[gamevar]] <gamevar> equal to the value of one of the [[Player Member Functions]] <functionname>. The value of <player id> can either be "[[THISACTOR]]" or "[[myconnectindex]]". Please see [[Player Member Functions]] for more information on this command.
getplayer[<player id>].<member> <gamevar>
 
The player ID can be either [[THISACTOR]], [[screenpeek]] or [[myconnectindex]], though using myconnectindex is strongly recommended against.
 
...
        ifvarg WEAPON_COUNT 25
        {
            '''getplayer'''[THISACTOR].weapon_pos TEMP2
            ifvarl TEMP2 10
            addvar TEMP2 2
            ifvarg TEMP2 9 setvar TEMP2 9
            setplayer[THISACTOR].weapon_pos TEMP2
        }
...


[[Category:EDuke commands]]
[[Category:EDuke commands]]
[[Category:Gamevar manipulation]]
[[Category:Gamevar manipulation]]
[[Category:Player manipulation]]

Revision as of 03:32, 8 September 2006

This allows you to fetch the value of one of the members of the player structure to a gamevar.

getplayer[<player id>].<member> <gamevar>

The player ID can be either THISACTOR, screenpeek or myconnectindex, though using myconnectindex is strongly recommended against.

...
       ifvarg WEAPON_COUNT 25
       {
           getplayer[THISACTOR].weapon_pos TEMP2
           ifvarl TEMP2 10
           addvar TEMP2 2
           ifvarg TEMP2 9 setvar TEMP2 9
           setplayer[THISACTOR].weapon_pos TEMP2
       }
...