Go
Wc3C.net
»
Warcraft III Modding
»
Developer's Corner
»
Triggers & Scripts
»
Anti Cheat using gamecache
Anti Cheat using gamecache
08-19-2006, 11:51 PM
#1
Mystic Prophet
Supposedly you can detect whether someone is on bnet, lan, or singleplayer by attempting to save the gamecache.
using this you can allow players to play solo on bnet and lan while disallowing cheats by preventing single player mode.
However, I can't seem to get it to work properly.
anyone know how to do this?
08-19-2006, 11:59 PM
#2
PipeDream
Store something in the cache, SaveGameCache() and check the boolean it returns.
08-20-2006, 02:19 AM
#3
Mystic Prophet
how would I go about checking that particular boolean. I tried both of the gui conditions gamecache booleans.
08-20-2006, 02:33 AM
#4
PipeDream
Trigger:
Custom script: set udg_bool = SaveGameCache(udg_mygamecachevar)
Then use the boolean in your logic. True means single player.
08-20-2006, 02:47 AM
#5
wonder_priest
Example Trigger:
Trigger:
Singleplayer Check
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Custom script: set udg_bool=SaveGameCache(udg_cache)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
bool Equal to False
Then - Actions
Game - Defeat Player 1 (Red) with the message: Playing this map in single player is not allowed!
Else - Actions
08-20-2006, 03:14 AM
#6
PipeDream
You got the sign wrong. True means single player.
To below: That's either because you didn't init or didn't store anything.
08-20-2006, 03:21 AM
#7
wonder_priest
:/ tested and it works. That exact trigger ends me in defeat, and 'bool equal to True' leaves me in the game.
08-20-2006, 05:55 AM
#8
Mystic Prophet
thanks a bunch. have some rep.
Edit: hmm that is true priest but you get booted whether you're playing singleplayer or not with that trigger. hmm I wish I understood how to reference the gamecache better.
08-20-2006, 05:49 PM
#9
Rising_Dusk
Why don't you use this boolean...
JASS:
bj_isSinglePlayer
That works just as well and is easier to remember. :P