-Gold (Amount)

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
User avatar
OrcSlayer101
Posts: 82
Joined: Thu Mar 25, 2010 6:09 pm
Realm: US East
Account: ShadowBlades
Clan: TvN

-Gold (Amount)

Unread post by OrcSlayer101 »

I waas wondering how to make a trigger that when you type ex. -gold 1000, it gives you that money. I want this for a creator cheat that I'm hoping i will only use in emergencies :D I can't seem to figure out the strings part..... Help Me!
The Slayer Of Orcs...

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: -Gold (Amount)

Unread post by 3ICE »

You can grab the "Amount" from converting t_all Substring(Entered Chat String, 7, 13) to an integer.
7 because the string "-gold " is 6 characters long, so we start our "Amount" from the 7th char
And 13, because the most gold you can have is 7 digits (1000000 - from the 7th character to the 13th character you get exactly 7 digits)

The rest is easy.

Code: Select all

if(String2Integer(Substring("-gold 1000000", 7, 13)) != 1000000)then
  In case my maths is off, just play around with the numbers until it works. :)
endif
ImageImageImageImageImage
Image
ImageImage

User avatar
OrcSlayer101
Posts: 82
Joined: Thu Mar 25, 2010 6:09 pm
Realm: US East
Account: ShadowBlades
Clan: TvN

Re: -Gold (Amount)

Unread post by OrcSlayer101 »

Alrighty after a long time not playing wc im back but what you said here... could you please show me the whole thing in gui :( im kinda sucky when it comes to triggers
Please and Thank you!
The Slayer Of Orcs...

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: -Gold (Amount)

Unread post by 3ICE »

No.


Use this...

Event: Player types "Gold me" (exact match)
Action: Give (triggering player) 10000 gold

...and you are done.
ImageImageImageImageImage
Image
ImageImage

User avatar
OrcSlayer101
Posts: 82
Joined: Thu Mar 25, 2010 6:09 pm
Realm: US East
Account: ShadowBlades
Clan: TvN

Re: -Gold (Amount)

Unread post by OrcSlayer101 »

LoL.

Fine I guess im not good enough :(
The Slayer Of Orcs...

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 111 guests