Raised This Month: $ Target: $400
 0% 

Advertising in the server


Post New Thread Reply   
 
Thread Tools Display Modes
Elusive138
Senior Member
Join Date: Dec 2010
Old 12-29-2010 , 02:40   Re: Advertising in the server
Reply With Quote #11

Untested:

PHP Code:
#include <amxmodx>
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
ip[32]
    
get_user_ip(0ipcharsmax(ip))
    if( !
equali(ip"127.0.0.1:27015") )
        
set_fail_state("Don't steal plugins.")

If you want to do advertisements, drekes has already given you the code for that.

Last edited by Elusive138; 12-29-2010 at 02:44.
Elusive138 is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 12-29-2010 , 06:39   Re: Advertising in the server
Reply With Quote #12

He will probably try to use 127.0.0.1...
Anyways change the IP to your server's IP and you should be ready to go.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
anupm
Senior Member
Join Date: May 2010
Old 01-13-2011 , 00:51   Re: Advertising in the server
Reply With Quote #13

Thanks a lot guys ... i will try to develop it today
anupm is offline
anupm
Senior Member
Join Date: May 2010
Old 01-15-2011 , 01:03   Re: Advertising in the server
Reply With Quote #14

Quote:
Originally Posted by Elusive138 View Post
Untested:

PHP Code:
#include <amxmodx>
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
ip[32]
    
get_user_ip(0ipcharsmax(ip))
    if( !
equali(ip"127.0.0.1:27015") )
        
set_fail_state("Don't steal plugins.")

If you want to do advertisements, drekes has already given you the code for that.

Just some query ...
Will it be like if some other server is using this plugin then it will not work ?
Because here you are taking the userip and checking that .
It will be better if you can please provide me the code which will only work for a certain server ip and will not work in any other server .
anupm is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-15-2011 , 05:48   Re: Advertising in the server
Reply With Quote #15

Quote:
Originally Posted by anupm View Post
Just some query ...
Will it be like if some other server is using this plugin then it will not work ?
Because here you are taking the userip and checking that .
It will be better if you can please provide me the code which will only work for a certain server ip and will not work in any other server .
As long as they don't get the source (sma) and change the ip, they won't be able to run it. set_fail_state

Also, I'm not getting a user's ip, despite the name. I'm getting the ip of 'user' 0, which is the server. Just replace 127.0.0.1:27015 with your server ip:port and it should work.

And what do you mean it would be better if I could provide code? That is the code. It will only work on a server with ip/port 127.0.0.1:27015 right now.
Elusive138 is offline
anupm
Senior Member
Join Date: May 2010
Old 01-15-2011 , 16:03   Re: Advertising in the server
Reply With Quote #16

Quote:
Originally Posted by Elusive138 View Post
As long as they don't get the source (sma) and change the ip, they won't be able to run it. set_fail_state

Also, I'm not getting a user's ip, despite the name. I'm getting the ip of 'user' 0, which is the server. Just replace 127.0.0.1:27015 with your server ip:port and it should work.

And what do you mean it would be better if I could provide code? That is the code. It will only work on a server with ip/port 127.0.0.1:27015 right now.
OOhhh sorry ....
I did not know that ip of 'user' 0 is the server ip . :p ..Thanks a lot for your code ....I will test it tonight
anupm is offline
anupm
Senior Member
Join Date: May 2010
Old 01-19-2011 , 02:18   Re: Advertising in the server
Reply With Quote #17

Wroked like charm ....both the advertising and ip check .... thanks all .
anupm 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 10:49.


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