Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Elysium Source Forum Index » Submitted Tutorials

Post new topic   Reply to topic
/roll script
View previous topic :: View next topic  
Author Message
Jamie
Member


Joined: 23 Feb 2006
Posts: 144
Location: England
Points

PostPosted: Wed May 31, 2006 1:01 pm    Post subject: /roll script Reply with quote

I thouhg ti would tell you the /roll script i just made, im not sure if there is one on here or not, some one might need it.

Creater:
Jamie

Just add this to the case section bit of the main.txt file which is located in the Scripts folder which is in the server folder.

Code:
   
Case "/roll"
   Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " rolls a " & int(rnd * 1000), 1)
   Exit Sub


How to use, write /roll

Please tell me if this works as i havent tested it yet, but i think it should.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
cirko
Newcomer


Joined: 09 Mar 2006
Posts: 8

Points

PostPosted: Wed May 31, 2006 2:45 pm    Post subject: Reply with quote

Thanks dude it works Very Happy
Back to top
View user's profile Send private message
Jamie
Member


Joined: 23 Feb 2006
Posts: 144
Location: England
Points

PostPosted: Wed May 31, 2006 2:56 pm    Post subject: Reply with quote

yey thats good Very Happy no prob mate
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
CuChulainn
Sr. Member


Joined: 13 Apr 2006
Posts: 1009

Points

PostPosted: Tue Jun 20, 2006 9:39 am    Post subject: Reply with quote

uhh..isnt it supposed to be a dice? as far as i know dices only got 6 numbers :so u might wanna change it to
visual basic code:
Case "/roll"
Dim dice
dice = Int(rnd * 6) +1
Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " rolls a " & dice, 1)
Exit Sub

Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
precrid
Newcomer


Joined: 16 Jun 2006
Posts: 24

Points

PostPosted: Tue Jun 20, 2006 10:08 am    Post subject: Reply with quote

what does this do?
Back to top
View user's profile Send private message
marsh
Sr. Member


Joined: 28 Feb 2006
Posts: 255

Points

PostPosted: Tue Jun 20, 2006 10:20 am    Post subject: Reply with quote

precrid wrote:
what does this do?


int(rnd * 1000)

Rolls a random number beetween 1 and 1000
Back to top
View user's profile Send private message
pingu
"The Bird"


Joined: 23 Feb 2006
Posts: 3400
Location: Antartica
Points

PostPosted: Tue Jun 20, 2006 10:27 am    Post subject: Reply with quote

Actually, 0 to 999.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jamie
Member


Joined: 23 Feb 2006
Posts: 144
Location: England
Points

PostPosted: Tue Jun 20, 2006 11:09 am    Post subject: Reply with quote

CuChulainn wrote:
uhh..isnt it supposed to be a dice? as far as i know dices only got 6 numbers :so u might wanna change it to
visual basic code:
Case "/roll"
Dim dice
dice = Int(rnd * 6) +1
Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " rolls a " & dice, 1)
Exit Sub


nope most games have it so it rolls between 0-999
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Malakai
Jr. Member


Joined: 15 Mar 2006
Posts: 69
Location: Addison, Vermont
Points

PostPosted: Tue Jun 20, 2006 11:17 am    Post subject: Reply with quote

so if i wanted to do 0-100 i would do 101?
_________________
The sky is falling! But can the sky really fall?

*Soon to be released... I think*
Back to top
View user's profile Send private message AIM Address MSN Messenger
pingu
"The Bird"


Joined: 23 Feb 2006
Posts: 3400
Location: Antartica
Points

PostPosted: Tue Jun 20, 2006 11:24 am    Post subject: Reply with quote

Yeah.

If you wanted 1 - 100, you'd do "Int(100 * rnd) + 1"
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Aranshada
Moderator


Joined: 07 May 2006
Posts: 907
Location: Probably stealing more planets
Points

PostPosted: Tue Jun 20, 2006 6:23 pm    Post subject: Reply with quote

I believe the surefire way to get a number within a set range lies in a simple equation:
Int((Max - Min + 1) * Rnd + Min)

I got that equation from this page:
http://www.w3schools.com/vbscript/func_rnd.asp
I love W3Schools. =)
_________________




http://aranshada.hopto.org/support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Elysium Source Forum Index » Submitted Tutorials All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional