AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help With a Custom Plugin (https://forums.alliedmods.net/showthread.php?t=60351)

Reaper2331 09-01-2007 16:12

Help With a Custom Plugin
 
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



X-Script 09-01-2007 16:14

Re: Help With a Custom Plugin
 
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



Reaper2331 09-01-2007 19:20

Re: Help With a Custom Plugin
 
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 


Arkshine 09-01-2007 19:36

Re: Help With a Custom Plugin
 
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

Reaper2331 09-01-2007 19:43

Re: Help With a Custom Plugin
 
thanks

Reaper2331 09-20-2007 17:31

Re: Help With a Custom Plugin
 
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 );
} */ 


X-Script 09-20-2007 17:38

Re: Help With a Custom Plugin
 
For /abuse try %i instead of %s.

X-Script 09-20-2007 17:49

Re: Help With a Custom Plugin
 
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
}*/ 


Reaper2331 09-20-2007 17:50

Re: Help With a Custom Plugin
 
Quote:

Originally Posted by X-Script (Post 533684)
For /abuse try %i instead of %s.

nope still not working

Alka 09-20-2007 17:52

Re: Help With a Custom Plugin
 
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);




All times are GMT -4. The time now is 16:15.

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