is it possible to make a trigger_use still show text but not be usable by a specific player?
so that way if a player has already used one of the triggers all the others say you have already activated a trigger but cant activate the trigger
it is possible with a counting trig that when you activate them then the other trigs is usable but when you pressed the button then it says that it already activated is.
level.trig_up_limit = 1; //change here that can use the trigger,
level thread multiple_triggers(); }
multiple_triggers() { player = undefined; //we don't know who pressed the trigger and we don't who is who.
trig = getEnt("trigs_all","targetname"); //all triggers; make sure that you have at lease 2 trigger other wise it will not working for(t=0; t<trig.size; t++) { trig[t] SetHintString("Press and hold &&1 to activate trigger"); //change to whatever you want to have on the trigger... trig[t] SetCursorHint( "HINT_NOICON" ); trig[t] UseTriggerRequireLookAt();
while(1) { trig[t] waittill("trigger", player); //why player = we will check to define which player activate the trigger... trig[t] trigger_off(); //to shut it down for few seconds on the end to enable it.
if(level.trig_up_amount < level.trig_up_limit) { level.trig_up_amount++; //count up to make the limit working.
player iprintlnbold("trigger is activated here"); //player means only the player that has activated the trigger.
//do your stuff here
wait 0.1; } else { player iprintlnbold("sorry there is already a trigger being triggered"); wait 1; }
trig[t] trigger_on(); wait 0.01; } } }
if you going to try this then you need to make less 2 triggers in your map otherwise it will not working.
I have it not tested. but it could look like this.
I hope that you mean this what you say. ?
you know if you need some help you can also send a pm to me
best regards, Gamer9294
Last Edit: February 04, 2015, 08:29:32 pm by gamer9294
thats similar to what im wanting to do but its not exactly what im wanting, im wanting to display the message on the trigger just like normal so that way when the player looks at it says "you already have used a trigger" but cant be triggered by that player anymore. if that helps describe what im wanting to do any better
thats similar to what im wanting to do but its not exactly what im wanting, im wanting to display the message on the trigger just like normal so that way when the player looks at it says "you already have used a trigger" but cant be triggered by that player anymore. if that helps describe what im wanting to do any better
trig SetHintString("press f cauze i got nothing better to do (JJ)"); while(1) { trig waittill("trigger", player); // any player
if(player.already_used_trig) { player IPrintLnBold( "you already have used a trigger" ); } else { //do stuff like yolo and why not... player.already_used_trig = true; } }
Last Edit: February 05, 2015, 04:10:15 am by jjbradman
trig SetHintString("press f cauze i got nothing better to do (JJ)"); while(1) { trig waittill("trigger", player); // any player
if(player.already_used_trig) { player IPrintLnBold( "you already have used a trigger" ); } else { //do stuff like yolo and why not... player.already_used_trig = true; } }
i have it set up similar to that except when the player goes to the other triggers on the map it says the right message but the trigger can still be activated by that player. which i dont want to happen
i have it set up similar to that except when the player goes to the other triggers on the map it says the right message but the trigger can still be activated by that player. which i dont want to happen
heres the code that checks if the player has triggered the trigger and the one that waits for each trigger to be activated and then updates if a player has activated one or not. i tried using the trigger_off function but it just totally disabled the trigger
Code Snippet
Plaintext
keys_function(key_trigs,keys){ dist = 96 * 96; while(1){ for(i = 0; i <key_trigs.size; i++){ players = getPlayers(); for(k = 0; k < players.size; k++){ if(players[k].hasKey && DistanceSquared( players[k].origin, key_trigs[i].origin ) < dist){ printDisplay(key_trigs[i], "You already have a key!"); //key_trigs[i] trigger_off(); }//end if else if (!players[k].hasKey && DistanceSquared( players[k].origin, key_trigs[i].origin ) < dist){ printDisplay(key_trigs[i], "Press and hold &&1 to pick up the key!"); key_trigs[i] thread key_trig_watch(keys[i]); }//end else if else{ }//end else }//end players for loop }//end keys for loop wait(.01); }//end while loop }//end keys_function
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
keys_function(key_trigs,keys){ dist = 96 * 96; while(1){ for(i = 0; i <key_trigs.size; i++){ players = getPlayers(); for(k = 0; k < players.size; k++){ if(players[k].hasKey && DistanceSquared( players[k].origin, key_trigs[i].origin ) < dist){ printDisplay(key_trigs[i], "You already have a key!"); //key_trigs[i] trigger_off(); }//end if else if (!players[k].hasKey && DistanceSquared( players[k].origin, key_trigs[i].origin ) < dist){ printDisplay(key_trigs[i], "Press and hold &&1 to pick up the key!"); key_trigs[i] thread key_trig_watch(keys[i]); }//end else if else{ }//end else }//end players for loop }//end keys for loop wait(.01); }//end while loop }//end keys_function
key_trig_watch(key){ player = undefined; self waittill ("trigger",player);
// ====================================================== // YOU NEED TO CHECK HERE IF THE PLAYER SHOULD OR SHOULD NOT BE ABLE TO USE IT // ====================================================== if ( player.hasKey ) { continue; } // ======================================================