Question about gold

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

GM_reggie
Junior Member
Posts: 48
Joined: October 1st, 2010, 2:36 pm

Question about gold

Post by GM_reggie »

Is there a way to add a code to a map that when the host activates this mode,all players get 1000 or more gold?

Example is adding a game mode in dota that adds a certain amount of gold to everyone in game.
User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

Re: Question about gold

Post by Nuuby »

If im not wrong, DotA's -test mode has a -goldall command which gives xx gold to all players. You can just use that.
User avatar
UndeadxAssassin
Grammar King
Posts: 2116
Joined: June 22nd, 2008, 10:11 pm
Title: Worst human for 4eva
Location: Mostly USEast

Re: Question about gold

Post by UndeadxAssassin »

There is no -goldall command in test mode, as far as I know.

If you want it to be after host activates a certain mode, then, let's take DotA for example. If they activate, say, ap mode.

The code would be something like:

if AP then
blahblahblah
endif
etc.

AP, of course, being a boolean that was called in an earlier function.
All you would have to do is add this line to the beginning of the function:

local integer goldz

then add this line under the blahblahblah but above the endif:


loop
exitwhen goldz>12 (replace 12 with number of players according to color. I believe these are the JASS colors so 00 is red, 01 is blue, 02 is teal, etc...)
call SetPlayerState(goldz, PLAYER_STATE_RESOURCE_GOLD, SetPlayerState(goldz,PLAYER_STATE_RESOURCE_GOLD) + xxx)
set goldz=goldz+1
endloop

Something like that. My JASS is bad :|.
Replace xxx with the amount of gold you want to add.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
(23:44:12) Bartimaeus: I was in pubic school until middle school...
Learn how to extract and read RAW Codes here!

Need help? Click here and ask your question!
GM_reggie
Junior Member
Posts: 48
Joined: October 1st, 2010, 2:36 pm

Re: Question about gold

Post by GM_reggie »

UndeadxAssassin wrote:There is no -goldall command in test mode, as far as I know.

If you want it to be after host activates a certain mode, then, let's take DotA for example. If they activate, say, ap mode.

The code would be something like:

if AP then
blahblahblah
endif
etc.

AP, of course, being a boolean that was called in an earlier function.
All you would have to do is add this line to the beginning of the function:

local integer goldz

then add this line under the blahblahblah but above the endif:


loop
exitwhen goldz>12 (replace 12 with number of players according to color. I believe these are the JASS colors so 00 is red, 01 is blue, 02 is teal, etc...)
call SetPlayerState(goldz, PLAYER_STATE_RESOURCE_GOLD, SetPlayerState(goldz,PLAYER_STATE_RESOURCE_GOLD) + xxx)
set goldz=goldz+1
endloop

Something like that. My JASS is bad :|.
Replace xxx with the amount of gold you want to add.
Well,I thank you for trying to help me but I just don't understand those stuff. Can you or anyone else explain in a much more detailed way?

Thanks.
User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

Re: Question about gold

Post by Nuuby »

Oh, then its only in the AI versions.
From 6.67b ai :

Code: Select all

    local string VH=GetEventPlayerChatString()
    local integer UP
    local integer O5
    .
    .
    .
elseif(SubString(VH,0,9)=="-goldall ")then
        set UP=S2I(SubString(VH,9,StringLength(VH)))
        set O5=1
        loop
            call SetPlayerState(Player(O5),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(O5),PLAYER_STATE_RESOURCE_GOLD)+UP)
            set O5=O5+1
            exitwhen O5>11
        endloop
User avatar
haxorico
Super Moderator
Posts: 3195
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND
Been thanked: 1 time

Re: Question about gold

Post by haxorico »

why only in AI? it can be done in any map. tough every one will need to download it from you and would likly to QUITE before you start the game.

You need to find the code of the mode, or just add it yourself, as dota is checking what is the mode already.
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
User avatar
Madara
Forum Fanatic
Posts: 311
Joined: October 26th, 2009, 10:22 pm
Title: mib^

Re: Question about gold

Post by Madara »

haxorico wrote:why only in AI? it can be done in any map. tough every one will need to download it from you and would likly to QUITE before you start the game.

You need to find the code of the mode, or just add it yourself, as dota is checking what is the mode already.
He meant the goldall was only in ai version of dota...
Spoiler:
(06:05:25) UndeadxAssassin: SLANDER
(06:05:32) Bartimaeus: See you later, Undead. I miss talking to you. Message me once in a while, :<
(06:05:37) UndeadxAssassin: /quit Bartimaeus!
(06:05:40) ChatBot: Madara logs into the Chat.
(06:05:49) ChatBot: Madara has been logged out (Kicked).
(06:05:54) Bartimaeus: >>
(06:06:02) Bartimaeus: He doesn't deserve to see my good bye to you, :D
(06:06:23) UndeadxAssassin: I'm still here because I wanna see his response
(06:06:29) UndeadxAssassin: :D
(06:06:31) ChatBot: Madara logs into the Chat.
(06:06:31) Bartimaeus: Oh.
(06:06:35) Bartimaeus: lol
(06:06:43) Madara: So should i say something dramatic
(06:06:48) Madara: or what satisfies u ?
(06:06:48) Bartimaeus: Nope.
(06:06:50) Bartimaeus: Because nobody cares.
(06:06:52) Bartimaeus: :3
(06:06:57) UndeadxAssassin: What a let down
(06:06:58) UndeadxAssassin: I'm leaving.