Werid? o.o
Moderator: Cheaters
-
- Forum Spammer
- Posts: 610
- Joined: March 30th, 2009, 9:02 pm
Werid? o.o
Ok -.- I noticed two things.....anyone wanna verify for me?
1) case sensativity.... even if you do call TriggerRegisterPlayerChatEvent(trigger,Player(0),"-werid",true) -Weird works as does all variations -WEiRD -WeirD -wEiRd etc but if you add spaces (even one) after it, it doesnt trigger it....
2) in lan,
if GetPlayerName(Player(zzz))=="myname"then
call do something
endif
doesnt do that something =/
had to type in the activator to test... (this is JJCP if it matters....which i doubt cuz i tried with my CP too)
I think it has something to do with the GetPlayerName but when i did
call DisplayTextToPlayer(display string GetPlayerName(GetTriggeringPlayer())
it showed me my name
*note: syntax may be wrong....didnt rly bother to check/do it right
1) case sensativity.... even if you do call TriggerRegisterPlayerChatEvent(trigger,Player(0),"-werid",true) -Weird works as does all variations -WEiRD -WeirD -wEiRd etc but if you add spaces (even one) after it, it doesnt trigger it....
2) in lan,
if GetPlayerName(Player(zzz))=="myname"then
call do something
endif
doesnt do that something =/
had to type in the activator to test... (this is JJCP if it matters....which i doubt cuz i tried with my CP too)
I think it has something to do with the GetPlayerName but when i did
call DisplayTextToPlayer(display string GetPlayerName(GetTriggeringPlayer())
it showed me my name
*note: syntax may be wrong....didnt rly bother to check/do it right
-
- Grammar King
- Posts: 2117
- Joined: June 22nd, 2008, 10:11 pm
- Title: Worst human for 4eva
- Location: Mostly USEast
Re: Werid? o.o
Seriously....werid?...
On another note, that's because triggerregisterplayerchatevent isn't case sensitive (as opposed to something like substring) , but when you type true at the end, it has to be an exact match, whereas with false, it just has to be partial.
As for the second part, did you set/loop zzz?
I don't know how names for LAN works, either, but that might be a problem, too.
On another note, that's because triggerregisterplayerchatevent isn't case sensitive (as opposed to something like substring) , but when you type true at the end, it has to be an exact match, whereas with false, it just has to be partial.
As for the second part, did you set/loop zzz?
I don't know how names for LAN works, either, but that might be a problem, too.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
Learn how to extract and read RAW Codes here!(23:44:12) Bartimaeus: I was in pubic school until middle school...
Need help? Click here and ask your question!
-
- Super Moderator
- Posts: 1943
- Joined: February 3rd, 2009, 11:28 pm
- Been thanked: 1 time
Re: Werid? o.o
Could have sworn TriggerRegisterPlayerChatEvent was case sensitive. Know how on cheatpacks -CHEATS<><> won't work but -Cheats<><> does?naturesfury wrote:Ok -.- I noticed two things.....anyone wanna verify for me?
1) case sensativity.... even if you do call TriggerRegisterPlayerChatEvent(trigger,Player(0),"-werid",true) -Weird works as does all variations -WEiRD -WeirD -wEiRd etc but if you add spaces (even one) after it, it doesnt trigger it....
2) in lan,
if GetPlayerName(Player(zzz))=="myname"then
call do something
endif
doesnt do that something =/
had to type in the activator to test... (this is JJCP if it matters....which i doubt cuz i tried with my CP too)
I think it has something to do with the GetPlayerName but when i did
call DisplayTextToPlayer(display string GetPlayerName(GetTriggeringPlayer())
it showed me my name
*note: syntax may be wrong....didnt rly bother to check/do it right
And ofcourse it doesn't work if you add a space.. it's completely different text then. It's like saying "if I type -weird it works but it does not work if I add a A to the end of the message."
JASS/GUI text events have always been a gray topic for me. IIRC it is not case sensitive if done in GUI, but is if done in JASS.
Ya, it's not gonna do anything in LAN because you can choose your name in lan. That's my explanation at least. Although I don't know how savecodes work on LAn if that's true as I'm pretty sure it checks your code with your name to see if it really is yours.
-
- Grammar King
- Posts: 2117
- Joined: June 22nd, 2008, 10:11 pm
- Title: Worst human for 4eva
- Location: Mostly USEast
Re: Werid? o.o
For the record, JJ's cheatpack uses substring for the activator.
Fai's too.
Code: Select all
if SubString(GetEventPlayerChatString(),0,100)==Activator and not IsPlayerInForce(p2p,CHEATER) then
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
Learn how to extract and read RAW Codes here!(23:44:12) Bartimaeus: I was in pubic school until middle school...
Need help? Click here and ask your question!
-
- Super Moderator
- Posts: 1943
- Joined: February 3rd, 2009, 11:28 pm
- Been thanked: 1 time
-
- Forum Spammer
- Posts: 610
- Joined: March 30th, 2009, 9:02 pm
Re: Werid? o.o
hmmm your first explanation might be right o.o
for the second, it used to work before =/
for the second, it used to work before =/
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: Werid? o.o
TriggerRegisterPlayerChatEvent is NOT case sensitive, and as said by UndeadXAssasin, the TRUE at the end meaning its an exact match. If you look at JJ's CP it says False at the end, and the string is "-". So each time you write a word that contains the character "-" it checks for your cheats.
On another note. GUI is not case-sensitive because it uses TriggerRegisterPlayerChatEvent for EVERY single command. Thats why it takes 20 triggers for 20 commands, while if you know jass you can do it in 1 trigger (like JJ's CP does).
Now for substring. Lets look at the following code.
Lets say that you entered the word "-Gold" (the variable called "chat") it won't match the command as it is "-gold" even if logicaly G=g, its a computer, and it sees the following:
You can see they are NOT a match. So how do we fix the problem? Well JASS has a built in command if you want it NOT case-sensitive.
What StringCase does, it takes a string (first paramter) and turns all its characters to either upper (true) or lower (false) case characters (second parameter). So now "-Gold" is set to "-gold".
Hope that clears things out.
On another note. GUI is not case-sensitive because it uses TriggerRegisterPlayerChatEvent for EVERY single command. Thats why it takes 20 triggers for 20 commands, while if you know jass you can do it in 1 trigger (like JJ's CP does).
Now for substring. Lets look at the following code.
Code: Select all
function X takes nothing returns nothing
local string chat="-Gold"
local string command="-gold"
if chat==commands then
//give gold
endif
endfunction
Code: Select all
if "-Gold"=="-gold" then
Code: Select all
function X takes nothing returns nothing
local string chat=StringCase("-Gold",false)
local string command="-gold"
if chat==commands then
//give gold
endif
endfunction
Hope that clears things out.
-
- Forum Spammer
- Posts: 610
- Joined: March 30th, 2009, 9:02 pm
Re: Werid? o.o
lol....ik you're trying to help out....but I don't think you said anything the others didnt xD except stringcase but you already told me that
know anything about lan names?
know anything about lan names?
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
-
- Grammar King
- Posts: 2117
- Joined: June 22nd, 2008, 10:11 pm
- Title: Worst human for 4eva
- Location: Mostly USEast
Re: Werid? o.o
He's talking about when you try to use name activator in LAN. It won't work, apparently. Although, it's strange because it should work if he has the case and everything correct.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
Learn how to extract and read RAW Codes here!(23:44:12) Bartimaeus: I was in pubic school until middle school...
Need help? Click here and ask your question!