88 lines
2.0 KiB
Plaintext
88 lines
2.0 KiB
Plaintext
//Script Name: prevent_cheat
|
|
//////////////////////////////////////////
|
|
//Created By: Genisys (Guile)
|
|
//Created On: 8/15/08
|
|
/////////////////////////////////////////
|
|
/*
|
|
This script is REAL easy to use, basically
|
|
it was designed to CATCH a cheater in the
|
|
act, trying to execute scripts, which they
|
|
should be doing on ANY Server!
|
|
|
|
All you have to do is enter the code
|
|
like you see it below in any script
|
|
which should never be fired by a PC.
|
|
I recommend you use this code in any
|
|
script you definitely do not want anyone
|
|
trying to execute, especially if it's any
|
|
module restart or server restart scripts!
|
|
|
|
//Example Script:
|
|
|
|
//Main Script..
|
|
void main()
|
|
{
|
|
|
|
//////////////////USE THIS////////////////////////////
|
|
|
|
ExecuteScript("prevent_cheat", OBJECT_SELF)
|
|
if(GetLocalInt(OBJECT_SELF, "CHEATER")==1)
|
|
{ return; }
|
|
|
|
//////////////////////////////////////////////////////
|
|
//ALL of your code goes after the above functions..
|
|
//////////////////////////////////////////////////////
|
|
|
|
|
|
//Main Script End
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
//////////////////////////////////////////////////////
|
|
|
|
|
|
////////////DON'T TOUCH ANYTHING BELOW!////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
|
|
////////////CHEATER CHECK FUNCTION///////////////
|
|
|
|
//The Person Executing the Script
|
|
object oMe = OBJECT_SELF;
|
|
|
|
//This will prevent ANYONE from firing this script EVER!
|
|
if(GetIsPC(oMe) || GetIsDM(oMe) || GetIsDMPossessed(oMe))
|
|
{
|
|
if(GetIsPC(oMe))
|
|
{
|
|
//Tell the script which fired to stop!
|
|
SetLocalInt(oMe, "CHEATER", 1);
|
|
|
|
string sMsg = "****The Player - " + GetName(oMe) + " / " + GetPCPlayerName(oMe) +
|
|
" / " + GetPCPublicCDKey(oMe) + " Has attempted to Execute a Script!!!****BANN THEM!****";
|
|
|
|
//BUSTED!
|
|
SendMessageToAllDMs(sMsg);
|
|
WriteTimestampedLogEntry(sMsg);
|
|
}
|
|
|
|
if(GetIsDM(oMe) || GetIsDMPossessed(oMe))
|
|
{
|
|
string sCMSG = "**** " + GetName(oMe) + " Has fired a script.******";
|
|
WriteTimestampedLogEntry(sCMSG);
|
|
|
|
//Tell all of the DMs a DM is firing a script..
|
|
SendMessageToAllDMs(sCMSG);
|
|
}
|
|
|
|
//Cheater Check End
|
|
return;
|
|
}
|
|
|
|
|
|
//Script end
|
|
}
|