Page 1 of 1

Random numbers

Posted: June 18th, 2013, 5:49 pm
by pcbouncer
is it possible to generate random numbers in codscript?

Re: Random numbers

Posted: June 18th, 2013, 6:14 pm
by Goro92

Code: Select all

RandomInt( <max> )
check here for scripts http://www.zeroy.com/script/

Re: Random numbers

Posted: June 18th, 2013, 7:04 pm
by pcbouncer
thanks alot :), do you know if there's a method for checking if a user activated a trigger?

Re: Random numbers

Posted: June 18th, 2013, 7:19 pm
by Goro92
pcbouncer wrote:thanks alot :), do you know if there's a method for checking if a user activated a trigger?
well i am not a good scripter but i'll try to help you

example of code:

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; 
 
         }
   }
}
if this didn't help you, wait for a good scripter :)

Re: Random numbers

Posted: June 18th, 2013, 7:32 pm
by Drofder2004
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");
 Â  }
}

Re: Random numbers

Posted: June 19th, 2013, 8:43 pm
by Drofder2004
randomjumper wrote:well, here are some numbers for you:
...i hope thats enough np
Stay out of the mapping section.