Random numbers
Posted: June 18th, 2013, 5:49 pm
is it possible to generate random numbers in codscript?
CoDJumper.com - For all your CoDJumping needs!
https://www.codjumper.com/forums/
Code: Select all
RandomInt( <max> )
well i am not a good scripter but i'll try to help youpcbouncer wrote:thanks alot, do you know if there's a method for checking if a user activated a trigger?
Code: Select all
thread_name()
{
trigger = getent("trig_1","targetname");
Â
  while (1)
  {
Â
   trigger waittill ("trigger", player );
Â
   if ( isPlayer( player ) && isAlive( player ) && isdefined( player.done ) )
       {
        //when player touch the trigger for 2nd,3rd..ect
        }
   else
     {
Â
//when the player touch the trigger for the first time
player iprintlnbold ("Congratulations, " + player.name + ", you have completed the map!"); Â
Â
  wait 0.5;
Â
     player.done = true;
Â
     }
  }
}
pcbouncer wrote:thanks alot, do you know if there's a method for checking if a user activated a trigger?
Code: Select all
function()
{
  trigger_ent = getent("trigger_targetname", "targetname")
Â
  while(1)
  {
   trigger_ent waittill("trigger", user)
   iprintlnbold("Player " + user.name + " ^7activated the trigger");
 }
}
Stay out of the mapping section.randomjumper wrote:well, here are some numbers for you:
...i hope thats enough np