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

What's wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 10-04-2010 , 15:16   What's wrong?
Reply With Quote #1

It doesn't work really, got some warnings too!

Warning: Loose indentation on line 49
Warning: Loose indentation on line 53
Warning: Loose indentation on line 70
Warning: Loose indentation on line 74
Header size: 496 bytes
Code size: 1244 bytes
Data size: 1156 bytes
Stack/heap size: 16384 bytes; estimated max. usage=41 cells (164 bytes)
Total requirements: 19280 bytes
4 Warnings.
Done.
Attached Files
File Type: sma Get Plugin or Get Source (AutoSlay.sma - 567 views - 1.9 KB)
__________________

Last edited by surfhope; 10-04-2010 at 16:18.
surfhope is offline
Send a message via Skype™ to surfhope
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-04-2010 , 15:24   Re: What's wrong?
Reply With Quote #2

Don't use [quote] tags for code.

Your code is very bad. Please learn more before trying to code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 10-04-2010 , 15:26   Re: What's wrong?
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
Don't use quote tags for code.

Your code is very bad. Please learn more before trying to code.
ok :/
__________________
surfhope is offline
Send a message via Skype™ to surfhope
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 10-12-2010 , 16:16   Re: What's wrong?
Reply With Quote #4

I think this should be better, 2 warnings, what I need for the server_cmd???
Attached Files
File Type: sma Get Plugin or Get Source (Auto Slay.sma - 497 views - 1.9 KB)
__________________
surfhope is offline
Send a message via Skype™ to surfhope
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-12-2010 , 18:27   Re: What's wrong?
Reply With Quote #5

First of all ... i would like to say ignore indentations , they dont mean much , anyways
PHP Code:
/* Autoslay by Hope 
Will slay Nem or Sur in Nem/Surv. Mode when 3 rounds after the last same mode haven't past*/

#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <cstrike>


#define PLUGIN "[ZP] Auto Slay"
#define VERSION "1.0"
#define AUTHOR "Hope"


new i=1;
new 
pcvar;
new 
rounds

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
pcvar register_cvar("zp_auto_slay""1");  // Enable/Disable Plugin
    
rounds register_cvar("zp_rounds""3"); // How many rounds should be no nem/sur after the last!
}

public 
plugin_cfg()
{
    
// Plugin is disabled
    
if (!get_pcvar_num(pcvar))
    return;
    }




public 
zp_round(gamemodeid)
{
     
     if(
gamemode != MODE_SURVIVOR)

     {
        
        
        
        if (
rounds
            {
         
i=1;
         new 
uid;
         static 
name[32], authid[32];
         
get_user_name (idname32);
         
uid get_user_authid(idauthid32);
        
        
        
             
server_cmd("amx_slay #%d"uid)            
             
client_print(0,print_chat,"%s have been slayed for making Survivor to early!"name);
           
             }
     } 
    
     
     if(
gamemode != MODE_NEMESIS)
       
      {
        if (
rounds)
             {
           
i=1;
         new 
uid;
         static 
name[32], authid[32];
         
get_user_name (idname32);
         
uid get_user_authid(idauthid32);
                
             
server_cmd("amx_slay #%d"uid)
             
client_print(0,print_chat,"%s have been slayed for making Nemesis to early!"name);
            
             }
      }
    
     
     if(
gamemode != MODE_INFECTION)
    {
i++;
    }

     
     if(
gamemode != MODE_SWARM)
    {
i++;
    }

 
     if(
gamemode != MODE_PLAGUE)
    {
i++;
    }

    
     
     if(
gamemode != MODE_MULTI)
    {
i++;
    }

     
     if(
gamemode != MODE_PLAGUE)
    {
i++;
    }

__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-12-2010 , 19:53   Re: What's wrong?
Reply With Quote #6

Quote:
Originally Posted by SaM.ThE.MaN View Post
First of all ... i would like to say ignore indentations , they dont mean much , anyways

Code:
 // code
Wtf, you didn't change anything.

You can ignore indentation warnings but you should not if you want to have decent code or get good help from others here. Readability is a huge part of coding.
__________________
fysiks is offline
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 10-13-2010 , 09:21   Re: What's wrong?
Reply With Quote #7

I added something new, but the var i isn't working. I think I must get the type of the round somewhere.... but how....

maybe
Code:
zp_is_nemesis_round
?

New Code:
PHP Code:
/* Autoslay by Hope 
Will slay Nem or Sur in Nem/Surv. Mode when 3 rounds after the last same mode haven't past*/
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <cstrike>
 
#define PLUGIN "[ZP] Auto Slay"
#define VERSION "1.0"
#define AUTHOR "Hope"
 
new i=1;
new 
pcvar;
new 
rounds;
 
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR);
 
pcvar register_cvar("zp_auto_slay""1");  // Enable/Disable Plugin
 
rounds register_cvar("zp_rounds""3"); // How many rounds should be no nem/sur after the last!
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
register_clcmd("say /zpround""Sayzpround")
 
register_clcmd("say_team /zpround""Sayzpround")
}
public 
plugin_cfg()
{
 
// Plugin is disabled
 
if (!get_pcvar_num(pcvar))
 return;
}
 
 
public 
Sayzpround()

 
         new 
rr rounds 1;
         if (
rr)
         {
          
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can't make Nemesis/Surivior next round!"i);
         }
        if (
>= rounds)
        {
        
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can make Nemesis/Surivior next round!"i); 
         }
 
 
}
 
 
public 
zp_round(gamemodeid)
{
 
  if(
gamemode != MODE_SURVIVOR)
  {
 
 
 
          if (
rounds
         {
           
i=1;
           new 
uid;
           static 
name[32], authid[32];
           
get_user_name (idname32);
           
uid get_user_authid(idauthid32);
 
 
          
server_cmd("amx_slay #%d"uid)   
          
client_print(0,print_chat,"%s have been slayed for making Survivor to early!"name);
 
          }
  } 
 
 
  if(
gamemode != MODE_NEMESIS)
 
   {
           if (
rounds)
          {
          
i=1;
          new 
uid;
          static 
name[32], authid[32];
          
get_user_name (idname32);
          
uid get_user_authid(idauthid32);
 
          
server_cmd("amx_slay #%d"uid)
          
client_print(0,print_chat,"%s have been slayed for making Nemesis to early!"name);
 
          }
   }
 
 
  if(
gamemode != MODE_INFECTION)
 {
i++;
 }
 
  if(
gamemode != MODE_SWARM)
 {
i++;
 }
 
  if(
gamemode != MODE_PLAGUE)
 {
i++;
 }
 
 
  if(
gamemode != MODE_MULTI)
 {
i++;
 }
 

__________________

Last edited by surfhope; 10-13-2010 at 11:32.
surfhope is offline
Send a message via Skype™ to surfhope
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 10-13-2010 , 10:34   Re: What's wrong?
Reply With Quote #8

Indent the Code right, then post it. My eyes are crying now, after reading your code.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-13-2010 , 10:46   Re: What's wrong?
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
Wtf, you didn't change anything.

You can ignore indentation warnings but you should not if you want to have decent code or get good help from others here. Readability is a huge part of coding.
His code had loose indents ... so thats all i fixed
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-13-2010 , 11:01   Re: What's wrong?
Reply With Quote #10

Quote:
Originally Posted by SaM.ThE.MaN View Post
His code had loose indents ... so thats all i fixed
And yet you made it look even worse...
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
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 21:39.


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