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?
// 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
// 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 that was fast ill try it latter when i get home