Raised This Month: $51 Target: $400
 12% 

save by ip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lqlqlq
Senior Member
Join Date: Jan 2008
Old 10-08-2011 , 07:28   save by ip
Reply With Quote #1

Can you someone make this plugin to work with save by ip ?
Code:

#include <amxmodx>
#include <fvault>
#include <fakemeta>
#include <zombieplague>

new const g_vault_name[] = "ammopacks";

new maxplayers

public plugin_init()
{
register_plugin("[ZP] AP Save (Fixed)" , "1.1" , "AfteR. / Vechta")

register_forward(FM_Sys_Error, "fw_ServerDown")
register_forward(FM_GameShutdown, "fw_ServerDown")
register_forward(FM_ServerDeactivate, "fw_ServerDown")

maxplayers = get_maxplayers()

}

public client_putinserver(id)
{
if( !is_user_hltv(id) && !is_user_bot(id) )
{
Load(id);
}
}

public client_disconnect(id)
{
Save(id)
}

public Load(id)
{
new name[32];
get_user_name(id, name, sizeof(name) - 1);

new data[16];
if( fvault_get_data(g_vault_name, name, data, sizeof(data) - 1) )
{
zp_set_user_ammo_packs(id, str_to_num(data))
}
else
{
zp_set_user_ammo_packs(id, 5) // Modify here for default ammopacks.
}
}

public Save(id)
{
new name[32];
get_user_name(id, name, sizeof(name) - 1);

new data[16];
num_to_str(zp_get_user_ammo_packs(id), data, sizeof(data) - 1);

fvault_set_data(g_vault_name, name, data);
}

public fw_ServerDown()
{
for(new i = 1; i <= maxplayers; i++)
Save(i)
}



Last edited by lqlqlq; 10-08-2011 at 09:08.
lqlqlq is offline
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-08-2011 , 07:44   Re: save by ip
Reply With Quote #2

Do you mean work with only one server?
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
lqlqlq
Senior Member
Join Date: Jan 2008
Old 10-08-2011 , 07:53   Re: save by ip
Reply With Quote #3

YEP.
lqlqlq is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-08-2011 , 07:54   Re: save by ip
Reply With Quote #4

Why not by SteamID?
__________________
hleV is offline
lqlqlq
Senior Member
Join Date: Jan 2008
Old 10-08-2011 , 07:57   Re: save by ip
Reply With Quote #5

because i have sms system and he's added ammo packs by ip.
lqlqlq is offline
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-08-2011 , 08:37   Re: save by ip
Reply With Quote #6

Wait. IP Protection is this.

PHP Code:
#include <amxmodx> 

new const g_szServerIP[] = "SERVER.IP.HERE:PORT"

public 
plugin_init()  

    new 
szIP[20]; 
    
get_user_ip(0szIPcharsmax(szIP), false); 
     
    if( !
equal(szIPg_szServerIP) ) 
    { 
        
set_fail_state("This plugin is private !"); 
    } 

Put that in urcode
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
lqlqlq
Senior Member
Join Date: Jan 2008
Old 10-08-2011 , 08:46   Re: save by ip
Reply With Quote #7

I dont need ip protection, i need ammo packs save'd by ip.

This double lines:
new name[32];
get_user_name
(id, name, sizeof(name) - 1);

need to be edited.

maybe and this:
if( fvault_get_data(g_vault_name, name, data, sizeof(data) - 1) )

Last edited by lqlqlq; 10-08-2011 at 08:50.
lqlqlq is offline
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-08-2011 , 08:56   Re: save by ip
Reply With Quote #8

Why do you need it saved by ip? non steamer?
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
lqlqlq
Senior Member
Join Date: Jan 2008
Old 10-08-2011 , 09:06   Re: save by ip
Reply With Quote #9

Quote:
Originally Posted by lqlqlq View Post
because i have sms system and he's added ammo packs by ip.
php script is designed to work with ip and need to be edited to work with the system.

Last edited by lqlqlq; 10-08-2011 at 12:15.
lqlqlq is offline
Old 10-08-2011, 09:33
enjoi.
This message has been deleted by enjoi.. Reason: nvm
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-08-2011 , 10:59   Re: save by ip
Reply With Quote #10

Quote:
Originally Posted by lqlqlq View Post
php script is designed to work with my ip and need to be edited to work with the system.
Lol your signature at the bottom links to a site where you can download cs 1.6 non-steam...
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 21:09.


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