Raised This Month: $ Target: $400
 0% 

Help With a Custom Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-01-2007 , 16:12   Help With a Custom Plugin
Reply With Quote #1

i made this plugin and its not compiling i don't know how to fix

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#define PLUGIN "say connect" 
#define VERSION "1.0" 
#define AUTHOR "Reaper2331" 
public plugin_init() { 
 
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_concmd("/steamid","PrintText",ADMIN_ALL,"gets your steam id for you")
 
register_concmd("/myip","PrintText2",ADMIN_ALL,"gets your IP Adress for you")
 
register_concmd("/serverip","PrintText3",ADMIN_ALL,"gets the Servers IP Adress for you")
 
register_concmd("/abuse","PrintText4",ADMIN_ALL,"Report Abuse")
 
register_concmd("/website","PrintText5",ADMIN_ALL,"Clans Website")
 
register_concmd("/myinfo","PrintText6",ADMIN_ALL,"gets your info")

public 
PrintText(id)
{
 new 
steamid get_user_authid(id)
 
client_print (idprint_chat"[AMXX] Your Steam ID is #%d" steamid
}
public 
PrintText2(id)
{
 new 
ip get_user_ip(id)
 
client_print (idprint_chat"[AMXX] Your IP Adress is #%d" ip
}
public 
PrintText3(id)
{
 new 
serverip register_cvar("amx_serverip""69.28.220.195:27035")
 
client_print (idprint_chat"[AMXX] This Server IP is #%d" serverip
}
public 
PrintText4(id)
{
 new 
email register_cvar("amx_adminemail""[email protected]")
 
client_print (idprint_chat"[AMXX] The Admins Email is #%d" email
}
public 
PrintText5(id)
{
 new 
website register_cvar("amx_clanwebsite""http://www.clanbha.com")
 
client_print (idprint_chat"[AMXX] The Clans Website is #%d" website
}
public 
PrintText6(id)
{
 new 
myinfo get_user_info(id)
 
client_print (idprint_chat"[AMXX] Your Info Is #%d" myinfo

__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-01-2007 , 16:14   Re: Help With a Custom Plugin
Reply With Quote #2

Try This:
PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "say connect" 
#define VERSION "1.0" 
#define AUTHOR "Reaper2331" 

public plugin_init() { 
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("/steamid""PrintText"ADMIN_ALL"Gets your steam id for you")
    
register_concmd("/myip""PrintText2"ADMIN_ALL"Gets your IP Adress for you")
    
register_concmd("/serverip""PrintText3"ADMIN_ALL"Gets the Servers IP Adress for you")
    
register_concmd("/abuse""PrintText4"ADMIN_ALL"Report Abuse")
    
register_concmd("/website""PrintText5"ADMIN_ALL"Clans Website")
    
register_concmd("/myinfo""PrintText6"ADMIN_ALL"Gets your info")


public 
PrintText(id)
{
    new 
steamid get_user_authid(id)
    
client_print (idprint_chat"[AMXX] Your Steam ID is #%d" steamid)
    return 
PLUGIN_HANDLED
}

public 
PrintText2(id)
{
    new 
ip get_user_ip(id)
    
client_print (idprint_chat"[AMXX] Your IP Adress is #%d" ip)
    return 
PLUGIN_HANDLED
}

public 
PrintText3(id)
{
    new 
serverip register_cvar("amx_serverip""69.28.220.195:27035")
    
client_print (idprint_chat"[AMXX] This Server IP is #%d" serverip)
    return 
PLUGIN_HANDLED
}

public 
PrintText4(id)
{
    new 
email register_cvar("amx_adminemail""[email protected]")
    
client_print (idprint_chat"[AMXX] The Admins Email is #%d" email)
    return 
PLUGIN_HANDLED
}

public 
PrintText5(id)
{
    new 
website register_cvar("amx_clanwebsite""http://www.clanbha.com")
    
client_print (idprint_chat"[AMXX] The Clans Website is #%d" website)
    return 
PLUGIN_HANDLED
}

public 
PrintText6(id)
{
    new 
myinfo get_user_info(id)
    
client_print (idprint_chat"[AMXX] Your Info Is #%d" myinfo)
    return 
PLUGIN_HANDLED


Last edited by X-Script; 09-01-2007 at 16:16.
X-Script is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-01-2007 , 19:20   Re: Help With a Custom Plugin
Reply With Quote #3

still not compiling i get this
PHP Code:
 
/home/groups/amxmodx/tmp3/textUGMZO9.sma(21) : error 088number of arguments does not match definition
/home/groups/amxmodx/tmp3/textUGMZO9.sma(28) : error 088number of arguments does not match definition
/home/groups/amxmodx/tmp3/textUGMZO9.sma(56) : error 088number of arguments does not match definition 
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-01-2007 , 19:36   Re: Help With a Custom Plugin
Reply With Quote #4

Try this :

Code:
    #include <amxmodx>     #include <amxmisc>     #define PLUGIN  "say connect"     #define VERSION "1.0"     #define AUTHOR  "Reaper2331"     new         p_serverip,         p_email,         p_clanwebsite;                     #define _charsmax(%1) sizeof( %1 ) - 1             public plugin_init()     {         register_plugin( PLUGIN, VERSION, AUTHOR );               register_concmd( "/steamid" ,"PrintText" , ADMIN_ALL, "gets your steam id for you" );         register_concmd( "/myip"    ,"PrintText2", ADMIN_ALL, "gets your IP Adress for you" );         register_concmd( "/serverip","PrintText3", ADMIN_ALL, "gets the Servers IP Adress for you" );         register_concmd( "/abuse"   ,"PrintText4", ADMIN_ALL, "Report Abuse" );         register_concmd( "/website" ,"PrintText5", ADMIN_ALL, "Clans Website" );         register_concmd( "/myinfo"  ,"PrintText6", ADMIN_ALL, "gets your info" );                 p_serverip    = register_cvar( "amx_serverip"   , "69.28.220.195:27035"    );         p_email       = register_cvar( "amx_adminemail" , "[email protected]"      );         p_clanwebsite = register_cvar( "amx_clanwebsite", "http://www.clanbha.com" );     }             public PrintText( id )     {         new steamid[32];         get_user_authid( id, steamid, _charsmax( steamid ) );                 client_print( id, print_chat, "[AMXX] Your Steam ID is %s" , steamid );     }             public PrintText2( id )     {         new ip[32];         get_user_ip( id, ip, _charsmax( ip ) );               client_print (id, print_chat, "[AMXX] Your IP Adress is %s" , ip )     }             public PrintText3( id )     {         new serverip[128];         get_pcvar_string( p_serverip, serverip, _charsmax( serverip ) );                 client_print( id, print_chat, "[AMXX] This Server IP is %s" , serverip );     }             public PrintText4(id)     {         new email[128];         get_pcvar_string( p_email, email, _charsmax( email ) );                 client_print( id, print_chat, "[AMXX] The Admins Email is %s" , email );     }             public PrintText5(id)     {         new website[128];         get_pcvar_string( p_clanwebsite, website, _charsmax( website ) );                 client_print( id, print_chat, "[AMXX] The Clans Website is %s" , website );     }     /* public PrintText6(id)     {         new myinfo[32];         get_user_info( id, _, myinfo, _charsmax( myinfo )  );                 client_print( id, print_chat, "[AMXX] Your Info Is %s" , myinfo );     } */


For the the last function, you miss an argument, see : http://www.amxmodx.org/funcwiki.php?...info&go=search
__________________
Arkshine is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-01-2007 , 19:43   Re: Help With a Custom Plugin
Reply With Quote #5

thanks
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-20-2007 , 17:31   Re: Help With a Custom Plugin
Reply With Quote #6

Ok the
/steamid
/myip
works

but the
/abuse
/website
/serverip
doesn't work


this is my code

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#define PLUGIN  "Player Info!" 
#define VERSION "1.0" 
#define AUTHOR  "Reaper2331" 
new 
p_serverip,
p_email,
p_clanwebsite;

#define _charsmax(%1) sizeof( %1 ) - 1

public plugin_init() 

 
register_pluginPLUGINVERSIONAUTHOR );
 
 
register_clcmd"say /steamid" ,"PrintText" ADMIN_ALL"gets your steam id for you" );
 
register_clcmd"say /myip"    ,"PrintText2"ADMIN_ALL"gets your IP Adress for you" );
 
register_clcmd"say /serverip","PrintText3"ADMIN_ALL"gets the Servers IP Adress for you" );
 
register_clcmd"say /abuse"   ,"PrintText4"ADMIN_ALL"Report Abuse" );
 
register_clcmd"say /website" ,"PrintText5"ADMIN_ALL"Clans Website" );
 
register_clcmd"say /myinfo"  ,"PrintText6"ADMIN_ALL"gets your info" );
 
 
p_serverip    register_cvar"amx_serverip"   "69.28.220.195:27035"    );
 
p_email       register_cvar"amx_adminemail" "[email protected]"      );
 
p_clanwebsite register_cvar"amx_clanwebsite""http://www.clanbha.com" );


public 
PrintTextid )
{
 new 
steamid[32];
 
get_user_authididsteamid_charsmaxsteamid ) );
 
 
client_printidprint_chat"[AMXX] Your Steam ID is %s" steamid );
}

public 
PrintText2id )
{
 new 
ip[32];
 
get_user_ipidip_charsmaxip ) );
 
 
client_print (idprint_chat"[AMXX] Your IP Adress is %s" ip 
}

public 
PrintText3id )
{
 new 
serverip[128];
 
get_pcvar_stringp_serveripserverip_charsmaxserverip ) );
 
 
client_printidprint_chat"[AMXX] This Server IP is %s" serverip );
}

public 
PrintText4(id)
{
 new 
email[128];
 
get_pcvar_stringp_emailemail_charsmaxemail ) );
 
 
client_printidprint_chat"[AMXX] The Admins Email is %s" email );
}

public 
PrintText5(id)
{
 new 
website[128];
 
get_pcvar_stringp_clanwebsitewebsite_charsmaxwebsite ) );
 
 
client_printidprint_chat"[AMXX] The Clans Website is %s" website );
}
/* public PrintText6(id)
{
new myinfo[32];
get_user_info( id, _, myinfo, _charsmax( myinfo )  );
client_print( id, print_chat, "[AMXX] Your Info Is %s" , myinfo );
} */ 
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 17:38   Re: Help With a Custom Plugin
Reply With Quote #7

For /abuse try %i instead of %s.
X-Script is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 17:49   Re: Help With a Custom Plugin
Reply With Quote #8

Here try this (I changed your indenting by great heights)

Also, things you need to fix. you don't need 15 spaces in between something, only one space is needed.

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

#define PLUGIN  "Player Info!" 
#define VERSION "1.0" 
#define AUTHOR  "Reaper2331" 

#define _charsmax(%1) sizeof( %1 ) - 1

new p_serverip
new p_email
new p_clanwebsite


public plugin_init() 

    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_clcmd("say /steamid" ,"PrintText" ADMIN_ALL"gets your steam id for you");
    
register_clcmd("say /myip"    ,"PrintText2"ADMIN_ALL"gets your IP Adress for you");
    
register_clcmd("say /serverip","PrintText3"ADMIN_ALL"gets the Servers IP Adress for you");
    
register_clcmd("say /abuse"   ,"PrintText4"ADMIN_ALL"Report Abuse");
    
register_clcmd("say /website" ,"PrintText5"ADMIN_ALL"Clans Website");
    
register_clcmd("say /myinfo"  ,"PrintText6"ADMIN_ALL"gets your info");
    
    
p_serverip register_cvar("amx_serverip"   "69.28.220.195:27035");
    
p_email register_cvar("amx_adminemail" "[email protected]");
    
p_clanwebsite  =  register_cvar("amx_clanwebsite""http://www.clanbha.com");


public 
PrintTextid )
{
    new 
steamid[32];
    
get_user_authididsteamid_charsmaxsteamid ) );
    
    
client_printidprint_chat"[AMXX] Your Steam ID is %s" steamid );
    return 
PLUGIN_HANDLED
}

public 
PrintText2id )
{
    new 
ip[32];
    
get_user_ipidip_charsmaxip ) );
    
    
client_print (idprint_chat"[AMXX] Your IP Adress is %s" ip );
    return 
PLUGIN_HANDLED
}

public 
PrintText3id )
{
    new 
serverip[128];
    
get_pcvar_stringp_serveripserverip_charsmaxserverip ) );
    
    
client_printidprint_chat"[AMXX] This Server IP is %s" serverip );
    return 
PLUGIN_HANDLED
}

public 
PrintText4(id)
{
    new 
email[128];
    
get_pcvar_stringp_emailemail_charsmaxemail ) );
    
    
client_printidprint_chat"[AMXX] The Admins Email is %i" email );
    return 
PLUGIN_HANDLED
}

public 
PrintText5(id)
{
    new 
website[128];
    
get_pcvar_stringp_clanwebsitewebsite_charsmaxwebsite ) );
    
    
client_printidprint_chat"[AMXX] The Clans Website is %s" website );
    return 
PLUGIN_HANDLED
}

/*public PrintText6(id)
{
    new myinfo[32];
    get_user_info( id, _, myinfo, _charsmax( myinfo )  );
    
    client_print( id, print_chat, "[AMXX] Your Info Is %s" , myinfo );
    return PLUGIN_HANDLED
}*/ 
X-Script is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-20-2007 , 17:50   Re: Help With a Custom Plugin
Reply With Quote #9

Quote:
Originally Posted by X-Script View Post
For /abuse try %i instead of %s.
nope still not working
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-20-2007 , 17:52   Re: Help With a Custom Plugin
Reply With Quote #10

What ?! LoL

Code:
[AMXX] The Admins Email is %i
, cvar email is a string! :S, and should be %s! Shame on you X-Script.

And this

Code:
new email[128];
get_pcvar_string( p_email, email, _charsmax( email ) );
, i don't think is a good thing, maybe you want to do like this: (i don't see any _charsmax func in amxmodx)

Code:
new email[128];
get_pcvar_string( p_email, email, sizeof email - 1);

__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 09-20-2007 at 17:57.
Alka 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 16:15.


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