Activation code

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Activation code

Post by weirdone2 »

You tricked me xantan I thought you'd actually talked to him, so I cancelled my post. ;/

Anyway just change:

Code: Select all

if SubString(s,0,5)=="-gold" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD )+S2I(SubString(s,6,13)))
elseif SubString(s,0,7)=="-lumber" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER )+S2I(SubString(s,8,15)))
to:

Code: Select all

if SubString(s,0,5)=="-gold" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD )+S2I(SubString(s,6,13))/4)
elseif SubString(s,0,7)=="-lumber" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER )+S2I(SubString(s,8,15))/4)
and it should be fine. ;)
Penguin
Member
Posts: 55
Joined: May 22nd, 2007, 1:12 am

Re: Activation code

Post by Penguin »

Thank you very much weirdone. I also love your cheat pack (although it sometimes makes the map I apply it to cause WC to crash, and other time it just doesn't work at all).

Georgemots wrote:somehow off-topic
Shouldn't this be

from

Code: Select all

if SubString(GetEventPlayerChatString(),0,8)=="-penguin" then


to
this
if SubString(GetEventPlayerChatString(),0,9)=="-penguin" then


"-penguin" is 8 characters, so it should be 0,8.
User avatar
trb92
Senior Member
Posts: 132
Joined: February 20th, 2007, 8:40 pm
Title: Random Noob
Location: Canada!!!

Re: Activation code

Post by trb92 »

Penguin wrote:"-penguin" is 8 characters, so it should be 0,8.

Actually, it should be 0,7
- 0
p 1
e 2
n 3
g 4
u 5
i 6
n 7

Jass counts the first character as 0, not 1.
If you knew a woman who was pregnant, who had 8 kids already,
three who were deaf, two who were blind, one mentally retarded, and she had syphilis; would you recommend that she have an abortion?

Answer:
Spoiler:
If you said yes, you just killed Beethoven...
User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Activation code

Post by JJ2197 »

I'm not sure how to explain this but I think it works like this...
It starts at 1 and ends at whatever number specifed because 0 can't really be counted because that's not possible to put a string there because when you say "whatever" w=1 h=2 a=3 etc...

So 0 is simply like a precheck or whatever you want to call it...
Example (s,1,2) would just check to see where the 2nd char of what you say is...
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Activation code

Post by weirdone2 »

Trb if you stopped at 7 then one would only have to enter -pengui, it works liek this substring(source,start(where you wish to start at),end(ending does not get this char)) so lets say i have k="1234" Substring(k,0,3) This would look at the start 0, which is 1 then get 1 which is 2 also 2 which is 3 and then would see that its at 3(the end) so would stop. So in the end it would return "123"

@penguin thx, ya I know of the lil crash bug just haven't really tried to find it yet. :P And the 2nd is the vex error. :S