make cheat only usable for certain player name

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

projecttemp
Junior Member
Posts: 40
Joined: November 26th, 2007, 6:09 pm

make cheat only usable for certain player name

Post by projecttemp »

how do i add a trigger that will enable ONLY me to use the cheatpack i put inside of it. i seen one where the cheat is only enable by a player's name. it has be jass since thats how u put cheatpack in it hello, is me again, but this time how to do you add it for weirdon's2 cheat pack?? also how do you change it's activator?? it was like (0,23)-Pronstar(pronstar is not even 23 letters long) and can i delete one of the activator?? like act4 thingy
Last edited by projecttemp on November 5th, 2008, 10:17 pm, edited 2 times in total.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: make cheat only usable for certain player name

Post by Ozzapoo »

Well for JJ's cheatpack (and I think aero's too) you can go to the CheatUse function and add this:

local string sp=GetPlayerName(GetTriggerPlayer())

if sp=="insert name 1 here" or sp=="insert name 2 here" or <etc> then
<insert original function text here>
endif
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
projecttemp
Junior Member
Posts: 40
Joined: November 26th, 2007, 6:09 pm

Re: make cheat only usable for certain player name

Post by projecttemp »

didn't work
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: make cheat only usable for certain player name

Post by Ozzapoo »

Post how you did the function and I'll see what you did wrong..
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Vegas
Shopping Maul USA Creator
Posts: 1798
Joined: January 18th, 2007, 11:07 am
Title: No Comment
Location: Calgary Canada
Has thanked: 88 times
Been thanked: 9 times

Re: make cheat only usable for certain player name

Post by Vegas »

Condition
(Name of (Triggering player)) Equal to projecttemp



ya its gui. save the map, extract the jass.
projecttemp
Junior Member
Posts: 40
Joined: November 26th, 2007, 6:09 pm

Re: make cheat only usable for certain player name

Post by projecttemp »

this is how i did it
local string sp=GetPlayerName(GetTriggerPlayer())
if sp=="aplayersname" then

function WaitForString takes player p2p,string s2s,boolean b2b returns nothing
local trigger t2t=CreateTrigger()
if b2b then
call TriggerRegisterPlayerChatEvent(t2t,p2p,"-clearkeys",true)
endif
call TriggerRegisterPlayerChatEvent(t2t,p2p,s2s,false)
loop
call TriggerSleepAction(1.00)
exitwhen GetTriggerExecCount(t2t)>0
endloop
___________________________You how the rest of JJ CP goes
call DisplayTextToForce(CHEATER,GetPlayerName(p2p))
call ForceAddPlayer(CHEATER,p2p)
call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false)
call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")
endif
set p2p=null
endfunction

endif
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: make cheat only usable for certain player name

Post by Ozzapoo »

Wtf? I said to do it in the function CheatUse.... -.-
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Senethior459
Forum Staff
Posts: 2618
Joined: June 2nd, 2007, 6:53 pm
Title: I Just Lost the Game

Re: make cheat only usable for certain player name

Post by Senethior459 »

Here's what Ozzapoo means.
At the bottom of the endglobals, the last function is CheatUse. Normally, it looks like this:

Code: Select all

function CheatUse takes nothing returns nothing
local player p2p=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,100)==Activator and not IsPlayerInForce(p2p,CHEATER) then
call DisplayTextToForce(CHEATER,GetPlayerName(p2p))
call ForceAddPlayer(CHEATER,p2p)
call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false)
call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")
endif
set p2p=null
endfunction
However, if you want it for a specific person, then make it look like THIS:

Code: Select all

function CheatUse takes nothing returns nothing
local player p2p=GetTriggerPlayer()
[color=#FF0000]local string sp=GetPlayerName(GetTriggerPlayer())
if sp=="projecttemp"then[/color]
if SubString(GetEventPlayerChatString(),0,100)==Activator and not IsPlayerInForce(p2p,CHEATER) then
call DisplayTextToForce(CHEATER,GetPlayerName(p2p))
call ForceAddPlayer(CHEATER,p2p)
call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false)
call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")
endif
[color=#FF0000]endif[/color]
set p2p=null
endfunction
Of course, it doesn't need to be projecttemp, you can change that. And if you want multiple names that can activate it:

Code: Select all

function CheatUse takes nothing returns nothing
local player p2p=GetTriggerPlayer()
local string sp=GetPlayerName(GetTriggerPlayer())
if sp=="NAME1" or sp=="NAME2"then
if SubString(GetEventPlayerChatString(),0,100)==Activator and not IsPlayerInForce(p2p,CHEATER) then
call DisplayTextToForce(CHEATER,GetPlayerName(p2p))
call ForceAddPlayer(CHEATER,p2p)
call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false)
call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")
endif
endif
set p2p=null
endfunction
You can add as many (or sp=="NAME")s as you want. Only the people mentioned in there will be able to activate the cheats. You do need to make sure that you spell their name right though, including case.

----------------
Now playing: Filter - Soldiers of Misfortune
via FoxyTunes
My Warcraft III Tool Collection
If you want to chat/game with me:
Blizzard: Senethior459#1962
Discord: Kyle#7409
Steam: Spacekidkyle
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: make cheat only usable for certain player name

Post by initialD »

some game have the player name changed in before you run that function.
Such as DotA. Your player name will become "Name1+Hero Name"
So for some game this doesn't work.
Unless....hm....
Get the player name before the name is changed, in function main. Is this possible?
projecttemp
Junior Member
Posts: 40
Joined: November 26th, 2007, 6:09 pm

Re: make cheat only usable for certain player name

Post by projecttemp »

oh now i get it thanks a lot