Snippet A betting system on arena type duels

CaptDeath

New Member
Reaction score
103
would any one like me to make the gambling system?

Discontinued

[del]Working on gambling system
YAY![/del]
 

Romek

Super Moderator
Reaction score
963
Post the code.
 

Romek

Super Moderator
Reaction score
963
Trigger:
  • Player Group - Add (Triggering player) to Idiot
    • Game - Display to Idiot the text: This leaks to displ...
    • Custom script: call DestroyForce(udg_Idiot)

...Ermm?

Trigger:
  • Win Detection
    • Events
      • Player - Player 1 (Red) types a chat message containing -w as An exact match
    • Conditions
    • Actions
      • Set Winners = (All allies of Player 1 (Red))

...

> containing (Substring(-bet , 1, 5)) as A substring
Why don't you just use:
containing "-bet " as A substring
 

CaptDeath

New Member
Reaction score
103
oh yeah that was b4 i removed it i didnt change the text
well the commentary explains for the second one thats what you need to change
and ill make the changes
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
if he change the substring if a player write something like that : "123456-bet", the trigger will be evaluated and executed, yes it's a silly example, but anyway it's just an event so using SubStringBJ is not that bad.
 

CaptDeath

New Member
Reaction score
103
what ahh man i just changed it
Brians right and it wont fire then if you have 2345-bet and causes some other issues so now its back to how it was the first time
 

Romek

Super Moderator
Reaction score
963
> if he change the substring if a player write something like that : "123456-bet", the trigger will be evaluated and executed, yes it's a silly example, but anyway it's just an event so using SubStringBJ is not that bad.

Actually, SubstringBJ("-bet ", 1, 5) == "-bet "
So it's just an extra function call.

You'll need a condition to prevent that.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
> if he change the substring if a player write something like that : "123456-bet", the trigger will be evaluated and executed, yes it's a silly example, but anyway it's just an event so using SubStringBJ is not that bad.

Actually, SubstringBJ("-bet ", 1, 5) == "-bet "
So it's just an extra function call.

You'll need a condition to prevent that.

The SubStringBJ is called only ONE time when the event is registered , pity ...
 

CaptDeath

New Member
Reaction score
103
@romek but i detect the interger by using another substring 6, enterd chat string length
so if they were to say 135-bet would cause it to be read wrong
 

Romek

Super Moderator
Reaction score
963
The SubStringBJ is called only ONE time when the event is registered , pity ...
And, the point of it being there is?

Doing that is basically like doing this:
JASS:
if GetRandomInt(1, 5) < 6 then
 // Actions
endif

Instead of:
JASS:
if true then
 // Actions
endif


It's an extra, completely pointless function call. There's no point whatsoever in it being there.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
And, the point of it being there is?

Doing that is basically like doing this:
JASS:
if GetRandomInt(1, 5) < 6 then
 // Actions
endif

Instead of:
JASS:
if true then
 // Actions
endif


It's an extra, completely pointless function call. There's no point whatsoever in it being there.

No i would say it's the best way, just remember that's a gui, not dynamic trigger, if he use that in the register event part, he don't need to use an extra condition when the trigger is evaluated or executed.
 

Romek

Super Moderator
Reaction score
963
> did you read my post?^^
No, because you didn't read my one which explains why you're wrong.

No i would say it's the best way, just remember that's a gui, not dynamic trigger, if he use that in the register event part, he don't need to use an extra condition when the trigger is evaluated or executed.
I don't think you're trying to understand me.
The Substring does nothing more than the normal "-bet " would do. It's just a waste of space, and an extra function call. A condition is required to avoid people typing "329847-bet ". If you don't believe me, try it with simple "Game - Display Text" actions.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Hmm yes sorry, i guess it's time to go to bed :p

You need to add a condition in your trigger to avoid this case.
 

CaptDeath

New Member
Reaction score
103
for what?
whats the point of destroying one thing to call a different thing?
can you explain that
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
First remove the SubStrings in the events it's useless as Romek said.
And add in your conditions, SubString(entered chat string,1,5) == "-bet "
 

CaptDeath

New Member
Reaction score
103
not that i am againt changing the 12 actions for the 5 time just isnt that tomato toemato[so you know what i mean i added the e]?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top