UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

get a specific player

broken avatar :(
Created 10 years ago
by arceus
0 Members and 1 Guest are viewing this topic.
1,422 views
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
I was just wondering how i could get player 1 or 2 or 3 or 4 through script so if player 1 activates a trigger it will be different then when player 2 does it?
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Something along the lines of this should do it.
Code Snippet
Plaintext
// Example script. Depending on certain things GetEntArray would be better but make sure to thread that and set the values to self
// threading: thread TrigStuff();
// array threading: Trigs = GetEntArray( "TrigPlay", "targetname" ); for( i = 0; i < Trigs.size; i++ ) Trigs[i] thread TrigStuff();
TrigStuff()
{
// If use array comment below out
Trig = GetEnt( "TrigPlay", "targetname" );
while( 1 )
{
// If use array comment below out
Trig waittill( "trigger", user );
// Uncomment below if using array
// self waittill( "trigger", user );
if( user == GetPlayers()[0] )
{
// Player 1
}
else if( user == GetPlayers()[1] )
{
// Player 2
}
else if( user == GetPlayers()[2] )
{
//Player 3
}
else if( user == GetPlayers()[3] )
{
//Player 4
}
}
}
Last Edit: October 23, 2014, 02:46:49 pm by PROxFTW
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
EDIT:

Loool, PRO you beat by a few sec there. i removed mine since it was kinda the same..  ;D

Last Edit: October 23, 2014, 02:46:11 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Something along the lines of this should do it.
Code Snippet
Plaintext
// Example script. Depending on certain things GetEntArray would be better but make sure to thread that and set the values to self
// threading: thread TrigStuff();
// array threading: Trigs = GetEntArray( "TrigPlay", "targetname" ); Trigs[i] thread TrigStuff();
TrigStuff()
{
// If use array comment below out
Trig = GetEnt( "TrigPlay", "targetname" );
while( 1 )
{
// If use array comment below out
Trig waittill( "trigger", user );
// Uncomment below if using array
// self waittill( "trigger", user );
if( user == GetPlayers()[0] )
{
// Player 1
}
else if( user == GetPlayers()[1] )
{
// Player 2
}
else if( user == GetPlayers()[2] )
{
//Player 3
}
else if( user == GetPlayers()[3] )
{
//Player 4
}
}
}
thanks :D that was fast ill try it latter when i get home :D

 
Loading ...