Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-18-2003, 12:16 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Help w/ Lotto Ticket

Ok my problem is that whenever I change the lotto numbers by random or by Change Numbers it changes everyone lotto numbers, I cant think of any way to fix it. I know its doing it because all the tickets read out of this.lottoa, b, and c. But I dont know any other way to do it.

// NPC made by Silent Skripter *Scripting*
if (created) {
this.lottoa = 0;
this.lottob = 0;
this.lottoc = 0;
}
if (playerchats && strequals(#c, Random Lotto Numbers)){
this.lottoa = int(random(0, 10));
this.lottob = int(random(0, 10));
this.lottoc = int(random(0, 10));
setcharprop #c, Current lotto tickets numbers: #v(this.lottoa), #v(this.lottob), #v(this.lottoc);
}
if (playerchats && strcontains(#c, Change Numbers)){
tokenize #c;
this.lottoa = strtofloat(#t(2));
this.lottob = strtofloat(#t(3));
this.lottoc = strtofloat(#t(4));
setcharprop #c, Current lotto tickets numbers: #v(this.lottoa), #v(this.lottob), #v(this.lottoc);
}
if (playerchats && strequals(#c, take ticket)) {
toweapons Lotto Ticket;
setplayerprop #c, Took 1 Lotto Ticket;
}

if (weaponfired) {
setplayerprop #c,Your numbers are #v(this.lottoa), #v(this.lottob), #v(this.lottoc);
}
Reply With Quote
  #2  
Old 08-18-2003, 12:53 AM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Sir...you use toweapons. Bad boy, very bad boy.

But anyway, try using client.strings instead of this.variables...it may work. Maybe a for loop too with a with in it.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #3  
Old 08-18-2003, 12:54 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Whats wrong with toweapons? What do you use instead? And im not quite sure on how to use strings. Could you please post an example? Thanks for the help.
Reply With Quote
  #4  
Old 08-18-2003, 12:55 AM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
If it's online. It's best to use addweapon. And have the weapon stored in the database. And I'm too lazy/tired to post an example at the minute.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #5  
Old 08-18-2003, 01:05 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
it doesnt seem to be for a server (unless its for classic)
if it is for a server, put //#CLIENTSIDE above if (weaponfired) and use addweapons like he said, instead of toweapons.

as for it changing everyones numbers, .. thats because your commands are telling it to change everyones numbers, not a specific one :P

there are many ways to fix it..
one, you could make a command for each lotto ticket, or you could make it so the command is "change lotto a/b/c #"
then use something like:

tokenize #c;
this.lotto#t(2) = strtofloat(#t(3));
__________________

Reply With Quote
  #6  
Old 08-18-2003, 01:10 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Sorry, I didn't understand the last part of your post very well, first part why put clientside with a comment thingie next to it? I want to be able to make a new ticket without it changing everyone elses tickets to the chosen number.
Reply With Quote
  #7  
Old 08-18-2003, 01:11 AM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
CheeTos, if it is changing everyone's variables, therefore it must be for some server. Not for Classic though.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #8  
Old 08-18-2003, 01:13 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally posted by Neoreno
CheeTos, if it is changing everyone's variables, therefore it must be for some server. Not for Classic though.
not necessarily, hes using this.vars and a weapon.. he could just be learning thingys
__________________

Reply With Quote
  #9  
Old 08-18-2003, 01:16 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
im going to change this to level or server, im just using this to test it out, but i know that it changes mine everytime I change it in singleplayer testing out the level.
Reply With Quote
  #10  
Old 08-18-2003, 02:12 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
By the way,read KSI-GS (Coding Standards).
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #11  
Old 08-18-2003, 05:58 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Im still no closer to knowing how to use a client.string or why I should use a for loop in this script.
Reply With Quote
  #12  
Old 08-18-2003, 06:07 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Now, perhaps you will take my advice and study the Newbie Scripter's Bible.
http://newbiescriptersbible.freewebspace.com/
__________________


Help me keep scripting
Reply With Quote
  #13  
Old 08-18-2003, 06:32 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
yes i think before you try to make this you should glance over commands.rtf and the nub scripting bible...
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #14  
Old 08-18-2003, 06:52 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
WOOHOOO I GOT IT WORKING! Whoever suggested using client.strings helped me! I figured out how to use em and it works! Now I can make lots of money on the server its goin on! Wooohoo, pm me maybe ill give u some of the cash i make.
Reply With Quote
  #15  
Old 08-18-2003, 01:45 PM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Er, that wont be necessary.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #16  
Old 08-18-2003, 05:42 PM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Will the client.string be saved to the character after they log off ?
Reply With Quote
  #17  
Old 08-18-2003, 05:47 PM
SaijinGohan SaijinGohan is offline
Registered User
SaijinGohan's Avatar
Join Date: Jul 2001
Location: U.S.A - Ohio
Posts: 536
SaijinGohan is on a distinguished road
Send a message via AIM to SaijinGohan Send a message via MSN to SaijinGohan
yes client.strings are saved
__________________

Job: A Legend

And you think that you have played Graal forever? Ha!
Reply With Quote
  #18  
Old 08-18-2003, 06:11 PM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Next up multiple tickets w/ using the arrow keys to select.
Reply With Quote
  #19  
Old 08-18-2003, 07:56 PM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
string array?
Reply With Quote
  #20  
Old 08-18-2003, 10:20 PM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Yup, string array.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.