News A server update was released on July 20. Server patch notes and downloads are here. Additionally, a client update was released on the same day. Client patch notes are here.
Recent Posts
1
Off-Topic General / Re: Free Host
« Today at 05:07 AM by Kewun »
i cant believe people actually fell for this..
3
Script and Content Requests / Re: random cmd
« Yesterday at 08:36 PM by redax »
ahm sorry if this doesnt work for you i didnt test,but you can get an idea for sure from it if it doesnt work.

Code: [Select]
class PC
{
guessing = false;
numtoguess = 0;
}

function onScriptLoad()
{
s <- array( GetMaxPlayers(), null );
}

function onPlayerJoin( player )
{
s[ player.ID ] = PC();
}

function onCheckpointEntered( player, sphere )
{
if ( sphere.ID == 0 )
{
if ( s[player.ID].guessing ) MessagePlayer("You already has a cmd to guess",player);
else{
s[ player.ID ].guessing = true;
local numtoguess = Random4();
s[player.ID].numtoguess = numtoguess;
MessagePlayer("If you can guess the number /**** You get a reward.",player);
}
}
}

function onPlayerCommand(player,cmd,text)
{
local numtoguess = s[player.ID].numtoguess;
if ( cmd == "exec" )
{
local script = compilestring( text );
if( script )
{
script();
MessagePlayer( "Command executed!", player );
}
else MessagePlayer( "Error.", player );
}
else if ( s[player.ID].guessing && cmd.tointeger() == s[player.ID].numtoguess )
{
s[player.ID].numtoguess = 0;
s[ player.ID ].guessing = false;
MessagePlayer("YOU WON 69M",player);//add the function to reward and tp player under this line
}
else if ( s[player.ID].guessing && cmd != s[player.ID].numtoguess )
{
MessagePlayer("NOP",player);
}
}

function Random(start, finish)
{
   local ran;
   if (start < 0) ran = ((rand() % (-start + finish)) + start)
   else
   {
      ran = ((rand() % (finish - start)) + start);
   }
   return ran;
}

function Random4()
{
local no = Random(0,9),n2 = Random(0,9),n3 = Random(0,9),n4 = Random(1,9),numtoguess = 0;
numtoguess = no;
numtoguess += n2*10;
numtoguess += n3*100;
numtoguess += n4*1000;
return numtoguess;
}

 :edit:
Tested......worked fine for me.
5
@Tizen please try again
9
----
10
In order to keep sending PMs without getting a captcha I'm required to get 5 posts on this account. You can ignore these 5 post, and act like nothing happened.