Cheat could only be activated once?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Cheat could only be activated once?

Post by initialD »

I was using the cheat activate system like Aero's cp.
May I ask how to make the cheat could only be activated once by the same player?
I notice if someone activate it twice, all things will be double up.
such as -gold 500 will become $1000.
lol
Bushido

Re: Cheat could only be activated once?

Post by Bushido »

its not only in aero's cp..i had the same with weirdone2's pack
i used the gold 50 and got 100
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Cheat could only be activated once?

Post by weirdone2 »

Why would you input the cmd more then once anyway?
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Cheat could only be activated once?

Post by Ozzapoo »

I think you'd need to make it only register "-" chat event if the a variable "activated" (boolean) is false....
SO something like this

Instead of this:

Code: Select all

if SubString(GetEventPlayerChatString(),0,23)=="-Pronstar"then
set zzdz[i+48]=zzdz[i+48]+1
call TriggerRegisterPlayerChatEvent(zwWW,p,"-",false)
endif
make a new global named 'acti' as a boolean array
and change the code to this

Code: Select all

if SubString(GetEventPlayerChatString(),0,23)=="-Pronstar"then
if(acti[GetPlayerId(GetTriggerPlayer())]==false)then
set zzdz[i+48]=zzdz[i+48]+1
call TriggerRegisterPlayerChatEvent(zwWW,p,"-",false)
endif
endif
That's how I think it works anyway...

And I think it doubles up cos when u type it in twice, it registers the same event twice...
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Cheat could only be activated once?

Post by Aero »

Or we can all not be noobs so I don't have to sacrifice more code space and efficiency . . . ^.^'
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Cheat could only be activated once?

Post by Ozzapoo »

3 more lines doesn't really matter... -.-
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Cheat could only be activated once?

Post by initialD »

The way you mentioned would be the easiet way though.
I was thinking not to have any additional globals. If that's gonna to work, it will not only add 3 more lines. It will need at least one additional function though.
Aero wrote:Or we can all not be noobs so I don't have to sacrifice more code space and efficiency . . . ^.^'
lol.
That's the problem, one time a noob on our team keep typing the password over and over again because he thought he needs to type the pasword everytime before he typed other commands.
Guess what happend? He DC'ed . It stacked up much for him.
lol.

wait, it's not working, any help please?
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Cheat could only be activated once?

Post by Ozzapoo »

How will it need an additional function..?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Cheat could only be activated once?

Post by initialD »

Tested it, it didn't work.
when I talked about adding one more function I was tlaking about something else, about and -off cheat command which will also remove all existing functions.


hmm,
I actually know how to do it, but that will surely making the com to run an unecessary function to detect if the player has already activated the cheats.

hmm.
Got to be someway simplier and less laggy.

edit: I got it, thx. I just used a globals integer
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Cheat could only be activated once?

Post by weirdone2 »

If your using my pack you could make it only activate once with this if statement. I won't add this to my pack however since imo it's your fault if you activate more then once and I persoanlly sometimes purposefully make my cmds go 2x-8x. :P

Code: Select all

if SubString(GetEventPlayerChatString(),0,23)=="-Pronstar"then
if zzdz[i+48]<1then
set zzdz[i+48]=zzdz[i+48]+1
call TriggerRegisterPlayerChatEvent(zwWW,p,"-",false)
endif
endif
endif