|
发表于 2009-7-18 17:33:02
|
显示全部楼层
来自 中国–福建–漳州
- #include <amxmodx>
- #include <amxmisc>
- new g_maxplayers
- public plugin_init()
- {
- register_plugin("One IP One Player", "1.0", "Rulzy");
- g_maxplayers = get_maxplayers();
- }
- public client_connect(id)
- {
- new ip[20], tip[20];
- get_user_ip(id, ip, 19, 1);
- for(new player=1;player<=g_maxplayers;player++)
- {
- if((is_user_connected(player) || is_user_connecting(player)) && id!=player)
- {
- get_user_ip(player, tip, 19, 1);
- if(equal(ip, tip))
- {
- server_cmd("kick #%d", get_user_userid(id));
- server_exec();
- break;
- }
- }
- }
- }
复制代码 |
|