Announcement
Collapse
No announcement yet.
Get list of players from interaction class...
Collapse
X
-
legacy-bushbomb repliedOk, so I can get a list of every player in the game through the interaction class now. Is it possible to get their locations too or no?
-
legacy-bushbomb repliedOK, THANK YOU SO MUCh for your help, all your tips were dead on, I just needed to tweak. I added this line above it....
GRI = viewportowner.Actor.GameReplicationInfo;
I already had GRI declared as a var(), but I hadn't set GRI = anything. Never would have gotten it without your help, thanks again guys. It even lists webamin, weird.
Leave a comment:
-
legacy-bushbomb repliedThat's the problem, in an interaction class, I cannot start with "Level". If I type Level.anythingunderit I get missing parameter 1 in the simple call for the clientmessage. Any other tips?
Leave a comment:
-
legacy-bushbomb repliedPHP Code:viewportowner.Actor.Pawn.ClientMessage(GRI.PRIArray.Length);
for (playercount=0;playercount<(GRI.PRIArray.Length);playercount++) {
viewportowner.Actor.Pawn.ClientMessage(GRI.PRIArray[playercount].playername);
}
//FOLLOWING CODE WORKS GREAT IF TARGET IS VISIBLE....
// foreach ViewportOwner.Actor.DynamicActors(class'Pawn', P) {
// if( len(P.PlayerReplicationInfo.PlayerName) >= 3) {
// viewportowner.Actor.Pawn.ClientMessage("Player: "$P.PlayerReplicationInfo.PlayerName);
// }
// }
The above code simply puts a "0" on the screen for the lenght of the list being 0 items long. What can I do to make it work?
Leave a comment:
-
Hsoolien repliedI'llbe damned it does... I'm confused now though... cause I have a function based off that that does not work with bots...
Leave a comment:
-
NakedApe repliedOriginally posted by Hsoolien
Not sure if this is of any help but:
Level.GRI.PRIArray
Holds an array of all PRI's in a level (so it does not hold bots..)
Leave a comment:
-
Hsoolien repliedNot sure if this is of any help but:
Level.GRI.PRIArray
Holds an array of all PRI's in a level (so it does not hold bots..)
Leave a comment:
-
legacy-bushbomb repliedand I know how to simply add a keybind to get a player list....the thing is that I need the list in the interaction because I intend on doing other things to it there.
Leave a comment:
-
legacy-bushbomb started a topic Get list of players from interaction class...Get list of players from interaction class...
I want to get a list of all players in a game by pressing a key.
Ok, so in a typical class, lets say mutator, you can use the following code:
PHP Code:for( C = Level.ControllerList; C != None; C = C.nextController ) {
if( C.IsA('PlayerController') || C.IsA('xBot')) {
LOG("Player: "$C.PlayerReplicationInfo.PlayerName);
}
}
PHP Code:foreach ViewportOwner.Actor.DynamicActors(class'Pawn', P) {
viewportowner.Actor.Pawn.ClientMessage("Player: "$P.PlayerReplicationInfo.PlayerName);
}
End result, I want a list of all players in the interaction class. I don't know if there's a way to pull in info from another class function or anything. Thanks for any help you can provide.Tags: None
Leave a comment: