AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   Funny code thread (https://forums.alliedmods.net/showthread.php?t=248962)

GuskiS 09-27-2014 13:50

Funny code thread
 
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 :3
So yea, post them below.

JusTGo 09-27-2014 14:05

Re: Funny code thread
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

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

public 
playerSpawn(id)
{
    
user_silentkill(id)



aron9forever 09-27-2014 14:10

Re: Funny code thread
 
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

DWIGHTpN 09-27-2014 14:37

Re: Funny code thread
 
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

DeteCT0R 09-27-2014 14:53

Re: Funny code thread
 
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. }



Jhob94 09-27-2014 17:01

Re: Funny code thread
 
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")



GuskiS 09-27-2014 17:09

Re: Funny code thread
 
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.

claudiuhks 09-27-2014 20:07

Re: Funny code thread
 
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




All times are GMT -4. The time now is 02:44.

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