AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Pease Help Me in My New Plugin (https://forums.alliedmods.net/showthread.php?t=229756)

AssAssIN_IMpossible 11-14-2013 08:20

Pease Help Me in My New Plugin
 
Hi AlliedModders!

I tried to create a plugin which shows a player's name and IP address

here is the code

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin("Entery Message", "1.0", "AssAssIN_IMpossible")

// Add your code here...
}


public infozone(){
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(0 ,get_user_name(, , )+" recently connected to this server^n"+get_user_name+(, ,)"\'s IP is "+get_user_ip(, ,))
}

So please can anyone debug it...
:wink:

YamiKaitou 11-14-2013 08:22

Re: Pease Help Me in My New Plugin
 
infozone never gets called and you are using the functions get_user_name and get_user_ip incorrectly

LordOfNothing 11-14-2013 08:28

Re: Pease Help Me in My New Plugin
 
write /info will shou name and ip :D
code :
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin("Entery Message""1.0""AssAssIN_IMpossible")
register_clcmd("say /info","infozone_p")
}


public 
infozone_p(id){
new 
szName[33];
get_user_name(idszName32);
new 
szIp[33];
get_user_ip(idszIp32);
set_hudmessage(id2550, -1.0, -1.0)
show_hudmessage(id ,"[IP : %s] [NAME : %s] recently connected to this server",szIp,szName);



simanovich 11-14-2013 10:21

Re: Pease Help Me in My New Plugin
 
Why are you formating string in Java style, when Pawn Language supports only c format style

AssAssIN_IMpossible 11-15-2013 06:46

Re: Pease Help Me in My New Plugin
 
thanks LordOfNothing.......
Now the plugin works

AssAssIN_IMpossible 11-15-2013 09:10

Re: Pease Help Me in My New Plugin
 
Quote:

Originally Posted by LordOfNothing (Post 2060780)
write /info will shou name and ip :D
code :
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin("Entery Message""1.0""AssAssIN_IMpossible")
register_clcmd("say /info","infozone_p")
}


public 
infozone_p(id){
new 
szName[33];
get_user_name(idszName32);
new 
szIp[33];
get_user_ip(idszIp32);
set_hudmessage(id2550, -1.0, -1.0)
show_hudmessage(id ,"[IP : %s] [NAME : %s] recently connected to this server",szIp,szName);



and what does infozone_p(id) does

xoxolala 11-15-2013 10:35

Re: Pease Help Me in My New Plugin
 
Quote:

Originally Posted by AssAssIN_IMpossible (Post 2061134)
and what does infozone_p(id) does

Exactly the same as yours. This one in fact aren't bugged.

LordOfNothing 11-16-2013 02:18

Re: Pease Help Me in My New Plugin
 
Quote:

and what does infozone_p(id) does
infozone_p(id) is the function called when you write in chat /info


All times are GMT -4. The time now is 23:19.

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