
08-18-2003, 12:16 AM
|
|
Banned
|
Join Date: Aug 2003
Posts: 56
|
|
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);
} |
|
|
|