Raised This Month: $32 Target: $400
 8% 

Solved [REQ] A simple Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-13-2017 , 02:01   [REQ] A simple Plugin
Reply With Quote #1

Hello Everyone , i dont know about coding so i am here for help ..

I want a plugin that make a player easy to copy IP of Our Server for Saving it in Favorite , like if he used clcmd like /ip or anything registered in plugin he should get our Predefined Text which is presently Server's IP in his Console so that he could Copy and add it to Favorites , so as it is predefined we cant use it for other purposes too to show anything in console is there any PLUGIN present or can anybody make ?

Last edited by instinctpt1; 02-10-2018 at 06:37. Reason: Old solved thread
instinctpt1 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-13-2017 , 02:41   Re: [REQ] A simple Plugin
Reply With Quote #2

here you go :
PHP Code:

#include <amxmodx>

//here you have to put your server ip
#define IP "192.168.1.1:27015"

//you can uncomment this line if you wants to show ip in chat too
//#define chat

//you can uncomment this line if you wants to show hud color too
//#define hud

#if defined chat
#include <colorchat>
#endif

public plugin_init()
{
    
register_plugin("show ip in console","0.1","@alliedmodders");
    
register_clcmd("say /ip","show_ip_console");
    
register_clcmd("say_team /ip","show_ip_console");
}

public 
show_ip_console(id)
{
    
client_print(id,print_console,"****************************************");
    
client_print(id,print_console,"Welcome to our Server");
    
client_print(id,print_console,"Add this ip to fav : %s",IP);
    
client_print(id,print_console,"****************************************");
    
    
#if defined chat
    
ColorChat(id,NORMAL,"^4****************************************");
    
ColorChat(id,NORMAL,"^3Welcome to our Server");
    
ColorChat(id,NORMAL,"^1Add this ip to fav :^3 %s",IP);
    
ColorChat(id,NORMAL,"^4****************************************");
    
#endif    
    
    #if defined hud
    
set_hudmessage(255000.310.1006.012.0)
    
show_hudmessage(id"        Welcome to our Server^nAdd this ip to fav : %s",IP);
    
#endif

Attached Files
File Type: sma Get Plugin or Get Source (show_ip_console.sma - 448 views - 1.2 KB)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-13-2017 , 05:27   Re: [REQ] A simple Plugin
Reply With Quote #3

Code:
static ip[22] get_user_ip(0, ip, charsmax(ip))
This does the job.
__________________
Relaxing is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-13-2017 , 06:39   Re: [REQ] A simple Plugin
Reply With Quote #4

Quote:
Originally Posted by indraraj striker View Post
here you go :
PHP Code:

#include <amxmodx>

//here you have to put your server ip
#define IP "192.168.1.1:27015"

//you can uncomment this line if you wants to show ip in chat too
//#define chat

//you can uncomment this line if you wants to show hud color too
//#define hud

#if defined chat
#include <colorchat>
#endif

public plugin_init()
{
    
register_plugin("show ip in console","0.1","@alliedmodders");
    
register_clcmd("say /ip","show_ip_console");
    
register_clcmd("say_team /ip","show_ip_console");
}

public 
show_ip_console(id)
{
    
client_print(id,print_console,"****************************************");
    
client_print(id,print_console,"Welcome to our Server");
    
client_print(id,print_console,"Add this ip to fav : %s",IP);
    
client_print(id,print_console,"****************************************");
    
    
#if defined chat
    
ColorChat(id,NORMAL,"^4****************************************");
    
ColorChat(id,NORMAL,"^3Welcome to our Server");
    
ColorChat(id,NORMAL,"^1Add this ip to fav :^3 %s",IP);
    
ColorChat(id,NORMAL,"^4****************************************");
    
#endif    
    
    #if defined hud
    
set_hudmessage(255000.310.1006.012.0)
    
show_hudmessage(id"        Welcome to our Server^nAdd this ip to fav : %s",IP);
    
#endif

Really Thanx !! But can you add this . like if a user says /ip i just want this like when he says /ip he gets a message printed in chat .like "Check Your Console or something else" and then he will check console bcoz at present it working good but user will not knw that /ip really worked ..so please can u edit it again ?
instinctpt1 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-13-2017 , 08:00   Re: [REQ] A simple Plugin
Reply With Quote #5

here you go :
I have deleted chat and hud part since you need to show ip address in client console only
PHP Code:

#include <amxmodx>

//here you have to put your server ip
#define IP "192.168.1.1:27015"

public plugin_init()
{
    
register_plugin("show ip in console","0.1","@alliedmodders");
    
register_clcmd("say /ip","show_ip_console");
    
register_clcmd("say_team /ip","show_ip_console");
}

public 
show_ip_console(id)
{
    
client_print(id,print_chat,"Check your console for our IP Address");
    
client_print(id,print_console,"****************************************");
    
client_print(id,print_console,"Welcome to our Server");
    
client_print(id,print_console,"Add this ip to fav : %s",IP);
    
client_print(id,print_console,"****************************************");

Attached Files
File Type: sma Get Plugin or Get Source (show_ip_console.sma - 438 views - 668 Bytes)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-13-2017 , 08:04   Re: [REQ] A simple Plugin
Reply With Quote #6

Quote:
Originally Posted by indraraj striker View Post
here you go :
I have deleted chat and hud part since you need to show ip address in client console only
PHP Code:

#include <amxmodx>

//here you have to put your server ip
#define IP "192.168.1.1:27015"

public plugin_init()
{
    
register_plugin("show ip in console","0.1","@alliedmodders");
    
register_clcmd("say /ip","show_ip_console");
    
register_clcmd("say_team /ip","show_ip_console");
}

public 
show_ip_console(id)
{
    
client_print(id,print_chat,"Check your console for our IP Address");
    
client_print(id,print_console,"****************************************");
    
client_print(id,print_console,"Welcome to our Server");
    
client_print(id,print_console,"Add this ip to fav : %s",IP);
    
client_print(id,print_console,"****************************************");

Thanx Buddy
instinctpt1 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-13-2017 , 08:23   Re: [REQ] A simple Plugin
Reply With Quote #7

Quote:
Originally Posted by Relaxing View Post
Code:
static ip[22] get_user_ip(0, ip, charsmax(ip))
This does the job.
Who told you to use static?

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Server IP Displayer", "1.0", "DoNii" ) ;     register_clcmd( "say /ip", "DisplayServerIP" ) ; } public DisplayServerIP( id ) {     new ServerIP[ 22 ] ;     get_user_ip( 0, ServerIP, charsmax( ServerIP ) ) ;     client_print( id, print_chat, "To See The Server IP Check Your Console" ) ;     client_print( id, print_console, "***** Server IP Displayer ***** ^n Our Server's IP : %s ^n ***** Server IP Displayer *****", ServerIP ) ; }

Quote:
Originally Posted by indraraj striker View Post
here you go :
I have deleted chat and hud part since you need to show ip address in client console only
PHP Code:

#include <amxmodx>

//here you have to put your server ip
#define IP "192.168.1.1:27015"

public plugin_init()
{
    
register_plugin("show ip in console","0.1","@alliedmodders");
    
register_clcmd("say /ip","show_ip_console");
    
register_clcmd("say_team /ip","show_ip_console");
}

public 
show_ip_console(id)
{
    
client_print(id,print_chat,"Check your console for our IP Address");
    
client_print(id,print_console,"****************************************");
    
client_print(id,print_console,"Welcome to our Server");
    
client_print(id,print_console,"Add this ip to fav : %s",IP);
    
client_print(id,print_console,"****************************************");

I don't know if you've heard or not but you can make a new line by using '^n' instead of using client_print 4 times.
__________________

Last edited by edon1337; 03-13-2017 at 09:29.
edon1337 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-13-2017 , 08:41   Re: [REQ] A simple Plugin
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
I don't know if you've heard or not but you can make a new line by using '^n' instead of using client_print 4 times.
i know i thought character will be more than 128 that's why i used client_print 4 times
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-13-2017 , 09:27   Re: [REQ] A simple Plugin
Reply With Quote #9

Quote:
Originally Posted by indraraj striker View Post
i know i thought character will be more than 128 that's why i used client_print 4 times
HTML Code:
***** Server IP Displayer ***** ^n Our Server's IP : 192.168.1.1:27015 ^n ***** Server IP Displayer *****
Idk what to count the '^n' s like so I'll say about 100-110.
__________________

Last edited by edon1337; 03-13-2017 at 09:36.
edon1337 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-13-2017 , 10:21   Re: [REQ] A simple Plugin
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
HTML Code:
***** Server IP Displayer ***** ^n Our Server's IP : 192.168.1.1:27015 ^n ***** Server IP Displayer *****
Idk what to count the '^n' s like so I'll say about 100-110.
you think that he is going to use as it is what if he edited msg txt
btw its already resolved
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Reply


Thread Tools
Display Modes

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 20:26.


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