Raised This Month: $51 Target: $400
 12% 

Funny code thread


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 09-27-2014 , 13:50   Funny code thread
Reply With Quote #1

At the moment I'm going through my plugins, cleaning things up and found this:
PHP Code:
public pfn_spawn(ent)
{
    if(!
is_valid_ent(ent))
        return 
PLUGIN_CONTINUE;

    return 
PLUGIN_CONTINUE;

I felt stupid and started to laught, so I decided to share this, and ask you to share you *BEST* codes
So yea, post them below.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-27-2014 , 14:05   Re: Funny code thread
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{       
    
RegisterHam(Ham_Spawn,"player","playerSpawn");
}

public 
playerSpawn(id)
{
    
user_silentkill(id)

__________________
JusTGo is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-27-2014 , 14:10   Re: Funny code thread
Reply With Quote #3

PHP Code:
stock bool:is_nade_excluded(nade) {
    return 
nade != nade // i know what you are thinking about, i'm not insane, i use this to avoid the compile warning

I did not write this lol
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 09-27-2014 , 14:37   Re: Funny code thread
Reply With Quote #4

Better than strlen....
PHP Code:
new sName33 ];
    
get_user_infoid"name"sNamecharsmaxsName ) - );

    new 
iLen;

    while(!
equali(sName[iLen], "^0"))

        
iLen++;

    if( 
iLen get_pcvar_numg_pCvarsCVAR_NAME_MAX ] ) )
    {... 
Source: https://forums.alliedmods.net/showthread.php?t=241078
DWIGHTpN is offline
DeteCT0R
Member
Join Date: Jun 2012
Location: My Home
Old 09-27-2014 , 14:53   Re: Funny code thread
Reply With Quote #5

Hitbox repair:

Code:
  1. #include <amxmodx>
  2. public plugin_init() {
  3. register_plugin("Hitbox javito","2.0.1","Hitbox Dev Team")
  4. server_cmd("amx_off")
  5. }
__________________
My steam:
DeteCT0R is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-27-2014 , 17:01   Re: Funny code thread
Reply With Quote #6

PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_plugin("Magic Server""0.0.1""Jhob94")
    
server_print(is_server_magic() ? "It seems your server is magic... CONGRATZ!" "It seems your server is normal!")
}

stock is_server_magic() {
    return 
equal("Allied""Modders")

__________________

Last edited by Jhob94; 09-27-2014 at 17:03.
Jhob94 is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 09-27-2014 , 17:09   Re: Funny code thread
Reply With Quote #7

What I meant with this thread was not to make fun in programming, but rather post funny/stupid mistakes you have made/seen done by others, not to make random codes.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 09-27-2014 , 20:07   Re: Funny code thread
Reply With Quote #8

LOL.

RAM rape.
PHP Code:
// C
void main(void) {
  do {
    
malloc(8192);
  } while (
true); // hell yeah

IQ test.
PHP Code:
// AMX Mod X
public clientPutInServer(Id)
{
  if (
BOT[Id] || HLTV[Id])return; // skip this 1
  
else if (IQ[Id] < 100)
    
Kick(Id"Your IQ level is not enough, try to connect later.");

The Walking Dead.
PHP Code:
// AMX Mod X
public StartFrame()
{
  static 
Id;
  
Id get_maxplayers();
  while (
Id)
  {
  if (
is_user_alive(Id)) dllfunc(DLLFunc_ClientKillId);
  --
Id;
  } 
// LOL

__________________

Last edited by claudiuhks; 09-27-2014 at 20:10.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode