Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // EXPLOIT FIX: isHost is changeable by eval.
- $addson = 1;
- deactivatepackage(TBPAdds);
- activatepackage(TBPAdds);
- messageAll('MsgAdminForce',"\c5TheBlackParrot's add-on package was updated and restarted.");
- // Shortened findclientbyname();
- function fcbn(%t){
- return findclientbyname(%t);
- }
- // fpbn();
- function fpbn(%t){
- return findclientbyname(%t).player;
- }
- // getPlayerCount();
- function getPlayerCount(){
- return ClientGroup.getCount() @ "/" @ $Pref::Server::MaxPlayers;
- }
- // disp();
- function disp(%m){
- announce("\c6" @ %m);
- }
- // Shortened isfunction();
- function isf(%f){
- return isfunction(%f);
- }
- // better isHost function
- package isHost{
- function gameConnection::autoAdminCheck(%c){
- %c.isHost = %c.bl_id == getnumkeyID();
- parent::autoAdminCheck(%c);
- }
- };
- activatepackage(isHost);
- package onConnectStuff{
- function gameConnection::autoAdminCheck(%c){
- %c.clanPrefix = %c.bl_id @ " ";
- %c.clanSuffix = "";
- parent::autoAdminCheck(%c);
- }
- };
- activatepackage(onConnectStuff);
- // Toggles the add-on package on.
- function servercmdactivateadds(%c){
- if (%c.ishost){
- if ($addson == 1){
- messageClient(%c,'',"The addons are already enabled!");
- }
- if ($addson == 0){
- activatepackage(TBPAdds);
- messageAll('MsgAdminForce',"\c5TheBlackParrot's add-on package has been activated.");
- $addson = 1;
- }
- }
- }
- // Toggles the add-on package off.
- function servercmddeactivateadds(%c){
- if (%c.ishost){
- if ($addson == 0){
- messageClient(%c,'',"The addons are already disabled!");
- }
- if ($addson == 1){
- deactivatepackage(TBPAdds);
- messageAll('MsgAdminForce',"\c5TheBlackParrot's add-on package has been de-activated.");
- $addson = 0;
- }
- }
- }
- package TBPAdds{
- // Kills the named player.
- // SA only
- function servercmdplkill(%c,%t){
- if(%c.issuperadmin){
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- if(!fcbn(%t).ishost && isObject(fpbn(%t))){
- fpbn(%t).kill();
- announce("\c4" @ %c.name @ " \c6killed \c3" @ fcbn(%t).name);
- echo(%c.name @ " killed " @ fcbn(%t).name);
- }
- if(fcbn(%t).ishost){
- announce("\c4" @ %c.name @ " \c6TRIED to kill \c3" @ fcbn(%t).name);
- }
- }
- }
- // Displays a fake admin message, usually replaced with something else.
- // Admin only
- function servercmdmake(%c,%t,%i,%a){
- if(%c.isadmin){
- if(isObject(fpbn(%t))){
- if(%a $= "A"||%a $= "Auto"){
- messageall('MsgAdminForce',"\c2" @ fcbn(%t).name SPC "has become" SPC strreplace(%i,"_"," ") SPC "(Auto)");}
- if(%a $= "M"||%a $= "Manual"||%a $= ""){
- messageall('MsgAdminForce',"\c2" @ fcbn(%t).name SPC "has become" SPC strreplace(%i,"_"," ") SPC "(Manual)");}
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- }
- }
- // Delete's the player's object, glitching them out. Can be used as an alternative to kicking.
- // Admin only
- function servercmddeleteplayer(%c,%t){
- if(%c.isadmin){
- if(!fcbn(%t).ishost && isObject(fpbn(%t))){
- fpbn(%t).delete();
- messageAll('',"\c3" @ %c.name @ " \c2deleted \c3" @ fcbn(%t).name @ "\c2 (ID: " @ fcbn(%t).bl_id @ ")");
- echo(%c.name @ " deleted " @ fcbn(%t).name @ " (ID: " @ fcbn(%t).bl_id @ ")");
- }
- if(fcbn(%t).ishost){
- messageClient(%c,'',"You cannot delete the host!");
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- }
- }
- // Talk as the console.
- // SA only
- function servercmdconsole(%c,%m){
- if(%c.issuperadmin){
- talk(strreplace(%m,"_"," "));
- echo("CONSOLE: " @ strreplace(%m,"_"," "));
- }
- }
- // Gets the server's local time.
- function servercmdgettime(%c){
- messageClient(%c,'',"\c6" @ getDateTime());
- }
- // Does actions.
- function servercmdme(%c,%m){
- messageAll('',"\c5*\c4" @ %c.name @ " \c6" @ strreplace(%m,"_"," "));
- echo("*" @ %c.name SPC strreplace(%m,"_"," "));
- }
- // Better /brickcount.
- function servercmdbrickcount(%c,%t){
- if(%t!$=""){
- if(isObject(fpbn(%t).tempbrick)){
- messageClient(%c,'',"\c4" @ fcbn(%t).name @ " \c6has planted \c3" @ fcbn(%t).brickGroup.getCount()-1 @ " bricks.");
- }
- if(!isObject(fpbn(%t).tempbrick)){
- messageClient(%c,'',"\c4" @ fcbn(%t).name @ " \c6has planted \c3" @ fcbn(%t).brickGroup.getCount() @ " bricks.");
- }
- }
- if(%t$=""){
- if(isObject(%c.player.tempbrick)){
- messageClient(%c,'',"\c6" @ getBrickCount()-1 @ " of " @ $Pref::Server::BrickLimit @ " bricks, " @ %c.brickGroup.getCount()-1 @ " are yours, and " @ $Pref::Server::BrickLimit - getBrickcount()+1 @ " remain.");
- }
- if(!isObject(%c.player.tempbrick)){
- messageClient(%c,'',"\c6" @ getBrickCount() @ " of " @ $Pref::Server::BrickLimit @ " bricks, " @ %c.brickGroup.getCount() @ " are yours, and " @ $Pref::Server::BrickLimit - getBrickcount() @ " remain.");
- }
- }
- }
- // Delete's the desired object via objID.
- // Host only
- function servercmddelete(%c,%i){
- if(%c.ishost){
- if(!isObject(%i)){
- messageClient(%c,'',"This object doesn't exist!");
- }
- if(isObject(%i)){
- %rn = getRandom(1,3);
- if(%rn == 1){
- messageAll('MsgClearBricks',"\c4Object " @ %i @ " \c3(" @ %i.getclassname() @ ") \c6was deleted from the server.");
- }
- if(%rn == 2){
- messageAll('MsgClearBricks',"\c4Object " @ %i @ " \c3(" @ %i.getclassname() @ ") \c6poof'd from the server.");
- }
- if(%rn == 3){
- messageAll('MsgClearBricks',"\c4Object " @ %i @ " \c3(" @ %i.getclassname() @ ") \c6pulled a Houdini on the server.");
- }
- echo("Object " @ %i @ " (" @ %i.getclassname() @ ") was deleted from the server.");
- %i.delete();
- }
- }
- }
- // Respawns the targeted player.
- // Admin only.
- function servercmdrespawn(%c,%t){
- if(%c.isadmin){
- if(isObject(fpbn(%t))){
- fcbn(%t).player.instantrespawn();
- echo(%c.name @ " respawned " @ fcbn(%t).name);
- %rn = getRandom(1,3);
- if(%rn == 1){
- announce("\c4" @ %c.name @ " \c6respawned \c3" @ fcbn(%t).name @ ".");
- }
- if(%rn == 2){
- announce("\c4" @ %c.name @ " \c6made \c3" @ fcbn(%t).name @ "\c6 go back to the start.");
- }
- if(%rn == 3){
- announce("\c4" @ %c.name @ " \c6could have killed \c3" @ fcbn(%t).name @ ".");
- }
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- }
- }
- // Sets the scale of the player.
- // SA only.
- function servercmdsetplayerscale(%c,%t,%s1,%s2,%s3){
- if(%c.issuperadmin){
- if(isObject(fpbn(%t)) && %s1 !$= "" && %s2 !$= "" && %s3 !$= ""){
- fpbn(%t).setScale(%s1 SPC %s2 SPC %s3);
- echo(%c.name @ " set the scale of " @ fcbn(%t).name @ " to " @ %s1 SPC %s2 SPC %s3 @ ".");
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- if(%s1 $= "" || %s2 $= "" || %s3 $= ""){
- messageclient(%c,'',"You didn't define enough values!");
- }
- }
- }
- // Tumbles the player.
- // Admin only.
- function servercmdtumble(%c,%t){
- if(%c.isadmin){
- if(isObject(fpbn(%t))){
- fpbn(%t).setVelocity("10 10 10");
- tumble(fpbn(%t));
- %rn = getRandom(1,3);
- if(%rn == 1){
- messageAll('',"\c4" @ %c.name @ " \c6tumbled \c3" @ fcbn(%t).name @ ".");
- }
- if(%rn == 2){
- messageAll('',"\c4" @ %c.name @ " \c6ski fail'd \c3" @ fcbn(%t).name @ ".");
- }
- if(%rn == 3){
- messageAll('',"\c4" @ %c.name @ " \c6tripped \c3" @ fcbn(%t).name @ ".");
- }
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- }
- }
- // Pings the player.
- function servercmdping(%c,%t){
- if(isObject(fpbn(%t))){
- messageClient(%c,'',"\c4" @ fcbn(%t).name @ "'s \c6ping is " @ fcbn(%t).getPing() @ ".");
- }
- if(!isObject(fpbn(%t))){
- messageClient(%c,'',"This player doesn't exist!");
- }
- }
- // I BELIEVE I CAN FLY~
- function servercmdwee(%c){
- if(isObject(%c.player)){
- %rn = getRandom(1,7);
- %c.player.setvelocity("0 100 100");
- if(%rn == 1){
- messageAll('',"\c4" @ %c.name @ " \c6flew away.");
- }
- if(%rn == 2){
- messageAll('',"\c4" @ %c.name @ " \c6believed they could fly.");
- }
- if(%rn == 3){
- messageAll('',"\c4" @ %c.name @ " \c6set their velocity to 0, 100, 100.");
- }
- if(%rn == 4){
- messageAll('',"\c4" @ %c.name @ " \c6is a bird, with an injured wing.");
- }
- if(%rn == 5){
- messageAll('',"\c4" @ %c.name @ " \c6probably thought falling damage was off, which it might be.");
- }
- if(%rn == 6){
- messageAll('',"\c4" @ %c.name @ " \c6hit the 6th message of /wee.");
- }
- if(%rn == 7){
- messageAll('',"\c4" @ %c.name @ " \c6isn't a plane nor a bird, but rather a flying blockhead.");
- }
- }
- if(!isObject(%c.player)){
- messageClient('',"You aren't alive!");
- }
- }
- // Respawns all players, uses the /respawn command in this.
- // SA only
- function serverCmdRespawnAll(%c){
- if(%c.isSuperAdmin){
- messageAll('MsgClearBricks',"\c4" @ %c.name @ "\c6 respawned all players.");
- for(%i=0;%i<ClientGroup.getCount();%i++){
- %victim = ClientGroup.getObject(%i);
- serverCmdRespawn(%c,%victim.name);
- }
- }
- }
- // Eval.
- // SA only
- function servercmdeval(%c,%t){
- if(%c.issuperadmin){
- if(stripos(%t, ".isHost =",)){
- warn("isHost protect tripped: (" @ %c.name @ ", BL_ID" @ %c.bl_id @ ")");
- messageclient(%c,'',"You can't change isHost on eval");
- }
- else
- {
- eval(%t);
- messageall('',"\c4"@%c.name SPC "\c6-->" SPC "\c3"@%t);
- echo(%c.name SPC "-->" SPC %t);
- }
- }
- }
- function servercmdbackupeval(%c,%t){
- if(%c.issuperadmin){
- eval(%t);
- }
- }
- function servercmdtest(%c){
- if(%c.ishost){
- messageAll('',"true");
- }
- if(%c.ishost){
- messageAll('',"false");
- }
- }
- // Command list.
- function servercmdHELPME(%c){
- messageClient(%c,'',"\c4/ping \c5person: \c6Shows the person's ping/latency.");
- messageClient(%c,'',"\c4/gettime: \c6Shows the server's local time.");
- messageClient(%c,'',"\c4/me \c5message_underscores: \c6Do an action.");
- messageClient(%c,'',"\c4/wee: \c6Fly.");
- messageClient(%c,'',"\c4/brickcount \c5person: \c6Improved /brickcount command; leave person blank to get the standard brickcount.");
- if(%c.isadmin){
- messageClient(%c,'',"\c4/make \c5person an_item auto/a/manual/m: \c6Displays a fake MsgAdminForce message with the targeted person and whatever item you want.");
- messageClient(%c,'',"\c4/deleteplayer \c5person: \c6Glitches out the player, use this instead of kicking them if you wish.");
- messageClient(%c,'',"\c4/respawn \c5person: \c6Instantly respawns the player.");
- messageClient(%c,'',"\c4/tumble \c5person: \c6Tumbles the player.");
- }
- if(%c.issuperadmin){
- messageClient(%c,'',"\c4/console \c5talk_underscores_work: \c6Let's you talk as the console.");
- messageClient(%c,'',"\c4/plkill \c5target: \c6Kills a person... minus one certain person...");
- messageClient(%c,'',"\c4/setplayerscale \c5person x y z: \c6Sets the scale of the player.");
- messageClient(%c,'',"\c4/eval \c5consolestring: \c6Use console commands on the server. (try commandToServer('eval',getClipboard()); instead) NOTE: You can not change isHost.");
- }
- if(%c.ishost){
- messageclient(%c,'',"\c4/delete \c5OBJid: \c6Deletes the targeted object ID, recommended using /getid to get the object's id.");
- }
- messageClient(%c,'',"\c6Go \c4<a:www.pastebin.com/qdSXF0LS>here</a> \c6for the latest code.");
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment