Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Trying to detect 0x80
Trying to detect 0x80
2005-08-19, 7:10 AM #1
Code:
pulse:
   player = GetLocalPlayerThing();
   anyone = FirstThingInView(player, 179, 999, 0x404);
   if(GetActorFlags(anyone) & 8)
   {
      jkStringClear();
      jkStringConcatPlayerName(anyone);        
      jkStringConcatAsciiString(" has God mode on!");                   
      jkStringOutput(-3, -3);  
      Return;
   }
   else
   {
      Print("NOPE NOTHING TO SEE HERE");
      Return;
   }

Return;


Well...this isn't working right. It always prints "[FirstThingInView] has God mode on!", or if anyone leaves my sight it just switches to "has God mode on!"

Any help in this regard would rock. :)

ReT
2005-08-19, 9:32 AM #2
&& should be &

&& is the logical and operator.

80 will always be 'TRUE', and since most likely a player will have some sort of actor flag, GetActorFlags(anyone), will always be true, unless something gets rather messed up, I imagine.

Though, even then, I don't believe this form of detection will work. The problem is, locally, your computer flags all players other than yourself as God.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-08-19, 10:48 AM #3
Not to mention 0x80 is the flag for "Creature is using persuasion" ;) You want 0x8 (Creature is invulnerable)
May the mass times acceleration be with you.
2005-08-19, 12:32 PM #4
Also remember that supershield uses 0x8. People who pick up supershields will be setting off an alarm if you had an ideal way to detect it.

Is this for hackers?
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman
2005-08-19, 1:32 PM #5
Silly me, I meant 0x8. :rolleyes:

Originally posted by ProdigyOddigy:
Also remember that supershield uses 0x8. People who pick up supershields will be setting off an alarm if you had an ideal way to detect it.
I can check for that.

Originally posted by ProdigyOddigy:
Is this for hackers?

Yup.

Thanks guys.

ReT
2005-08-19, 6:15 PM #6
If you're trying to counter hacking I have a little anti-build cog that works pretty good. I plan on implementing it in my mod some time. I noticed this is being a problem on the JKserver.
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman
2005-08-19, 6:17 PM #7
That would be cool, I'de be interested to see how you did it.
2005-08-19, 6:36 PM #8
Code:
# Jedi Knight Cog Script
#
# FORCE_WELL.COG
#
# Thing parent checking
#
# Build cogs for the sake of ruining the level are countered by this cog
#
# Immediately removes ai created by players
# Removes powerups created by players after 10 seconds. This is so force pulled weapons, dropped weapons, and backpacks still function for gameplay
# Immediately removes structures created by players
#
# Incomplete
#

symbols

thing       player                           local
int         i=0                              local
int         type                             local
int         buildparent                      local

template    specialtpl1=+phystemplate        local
template    specialtpl2=_entity              local
template    specialtpl3=+weapmodel           local

message     startup
message     pulse
message     timer

end

# ========================================================================================

code

startup:
   player = GetLocalPlayerThing();
   Sleep(2.0);
   SetPulse(1.0);

   Return;

# ........................................................................................

pulse:
   for(i=0; i<=1000; i=i+1) // cycle through 1000 Thing ID's in the level
   {
      buildparent = GetThingParent(i);
      type = GetThingType(buildparent);
      if((type == 10) && (GetThingTemplate(i) != specialtpl1) && (GetThingTemplate(i) != specialtpl2) && (GetThingTemplate(i) != specialtpl3)) // Thing is created by a player that is NOT a special mod thing
      {
         if(GetThingType(i) == 1) // the created thing is something unknown
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }
         if(GetThingType(i) == 2) // the created thing is an AI actor
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }
         if(GetThingType(i) == 4) // the created thing is something unknown
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }
         if(GetThingType(i) == 5) // the created thing is a pickup template
         {
            if((i != -1) && (GetThingFlags(i) != 0x400000)) // also uses some random silly flag so it doesn't send a timer every second
            {
               SetTimerEx(10.0, 1, i, i); // since it's a pickup template, kill it after a timer. it could possibly be a force pulled weapon
               SetThingFlags(i, 0x400000); // give some random silly flag so it doesn't send a timer every second
            }
         }
         if(GetThingType(i) == 7) // if the created thing is a structure or level prop
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }
         if(GetThingType(i) == 8) // the created thing is something unknown
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }
         if(GetThingType(i) == 9) // the created thing is something unknown
         {
            if(i != -1) // if you use destroything on negative one, it will remove thing zero instead
            {
               DestroyThing(i); // remove it from the level immediately
            }
         }

      }

   }

   Return;

# ........................................................................................

timer:

   parzero = GetParam(0);
   if(GetSenderID() == 1)
   {
      if(parzero != -1)
      {
         DestroyThing(parzero); // remove it from the level
      }
   }

   Return;

# ........................................................................................

end



it's incomplete right now, but it works on common build hacks

a minor problem is that it removes particles (like smoke and saber clashes)
it can be fixed by finding out what thing type particles are
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman
2005-08-19, 6:45 PM #9
also, if anyone knows if GetThingCount(), returns the original level's thing count/ingame thing count for sure, that would help. If it returns the original count, than a bulletproof antibuild could be possible.

also a note on the build cog, it can be worked around and exploited. I would have included "punishment" code, but a smart hacker could use this to his evil doing.
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman
2005-08-19, 9:40 PM #10
GetThingCount() returns the level's maximum thing count. The maximum possible number of things. Not the actual number of things.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-08-19, 9:54 PM #11
I'm pretty sure about that, GetThingCount() is a great way to figure out what level you are in via cog.

↑ Up to the top!