Jump to content


Photo

Cum sa modific[AMXX]


  • Please log in to reply
4 replies to this topic

#1 OFFLINE   Katal!n_Joker

Katal!n_Joker

    Cresa de gaming

  • Forumist
  • Pip
  • 23 posts
    • :
  • 5 topics
0
likes on posts

Posted 07 August 2007 - 22:00

Cum sa modific [AMXX] de exemplu cand cineva se conecteaza pe server[amx_show_ip.amxx] sau la highpingkicker[hpk.amxx]am incercat sa modific smaurile si nu am reusit in loc de [AMXX] sa pun [serverul meu].Ms Anticipat! smile.gif

#2 OFFLINE   The Wizard

The Wizard

    Doctor docent in gaming

  • LinkManiac
  • 10,185 posts
    • Online: 40d 22h 53m 58s
  • 451 topics
648
likes on posts

User's Awards

              

Posted 07 August 2007 - 22:10

da si tu pluginurile alea sa ma uit si eu la ele

de obicei scrie ceva de genul:

client_print(id, print_chat, "[HPK] Ping checking disabled due to immunity...")
poti sa modifici client_print(id, print_chat, "[Servu tau] Ping checking disabled due to immunity...")

#3 OFFLINE   Katal!n_Joker

Katal!n_Joker

    Cresa de gaming

  • Topic Starter
  • Forumist
  • Pip
  • 23 posts
    • :
  • 5 topics
0
likes on posts

Posted 07 August 2007 - 22:30

CITAT(The_Wizard @ Aug 7 2007, 22:10) View Post

da si tu pluginurile alea sa ma uit si eu la ele

de obicei scrie ceva de genul:

client_print(id, print_chat, "[HPK] Ping checking disabled due to immunity...")
poti sa modifici client_print(id, print_chat, "[Servu tau] Ping checking disabled due to immunity...")

Uite cum am facut:
La amx_show_ip.sma:
* Show IP AMX MOD X Plugin
* Author : SAMURAI
* Version 0.2
* from 0.1 to 0.2 -> - fixed str_to_num
* - lineup console
* - t args
* * ipban by W@lker (not tested ! i recommand to use amx_banip from amxx 1.75+)
* Commands : amx_showip (dysplay all players on server and them ip's)
* amx_ipban <minutes> <part of nick>
*/

#include <amxmodx>

// file to read descriptions from
new ipdesc[32] = "addons/amx/ipdesc.ini"


public amx_showip(id){
new userip[16]
new name[64]
new players[32],inum
new buffor[3000]
new header[50]
new temp[150]

new arg[1]
new team

read_args(arg,1)
team=str_to_num(arg)

switch(team){
case 1: {
header="IP List - Terrorists Forces"
get_players(players,inum,"e","TERRORIST")
}
case 2: {
header="IP List - CT Forces"
get_players(players,inum,"e","CT")
}
default:{
header="IP List"
get_players(players,inum)
}
}
//
client_print(id,print_console,"%s",header)

format(buffor,100,"%-25.24s %-16.15s %s","Name","IP","Description^n____________________________________^n")


for(new i = 0; i < inum; ++i) {
temp=""
get_user_ip(players[i],userip,16,1)
get_user_name(players[i],name,64)
if (strlen(name)>20) {
copy(name,17,name)
add(name,64,"...")
}
new IPD[32]
findip(userip,IPD)
format(temp,150,"%-25.24s %-16.15s %s^n",name,userip,IPD)
add(buffor,3000,temp)
client_print(id,print_console,"%-32.31s %-16.15s %s",name,userip,IPD)
}
show_motd(id,buffor,header)
return PLUGIN_CONTINUE
}

public getdesc(sip[16],sdesc[32]){
if (file_exists(ipdesc))
{
new data[128]
new stextsize = 0
new line = 0
new ip[16]
new desc[32]
while((line=read_file(ipdesc,line,data,192,stextsize))!=0)
{ /*while*/
if (contain(data,"//") == -1) {/*skip comments*/
parse(data,ip,16,desc,32)
if (equal(sip,ip)) {
sdesc=desc
return 1
}
} /*skip comments*/
} /*while*/
} else log_message("IP Descriptions file not found!")
sdesc=""
return 0
}

public findip(sip[16],sdesc[32]){
new ipsubnet[16]
new RValue=0
new uip[16]
new ippart1[12]
new ippart2[12]
new ippart3[12]
new ippart4[12]

/*Calculating subnet*/
copy(uip, 16, sip)
while(replace(uip, 16, ".", " ")){}
parse(uip, ippart1,12,ippart2,12,ippart3,12,ippart4,12)
ipsubnet=""
add(ipsubnet,16,ippart1)
add(ipsubnet,16,".")
add(ipsubnet,16,ippart2)
add(ipsubnet,16,".")
add(ipsubnet,16,ippart3)
/*Calculating subnet*/

RValue = getdesc(sip , sdesc);
if (RValue==0) RValue = getdesc(ipsubnet , sdesc)
return RValue
}

public client_connect(id){
new userip[16]
new name[32]
new IPD[32]
get_user_ip(id,userip,16,1)
get_user_name(id,name,32)
findip(userip, IPD)
//server_cmd("say[servu meu] %s (%s , %s) incearca sa se conecteze",name,userip,IPD)
client_print(0,print_chat,"[servu meu] %s (%s,%s) incearca sa se conecteze",name,userip,IPD);
return PLUGIN_CONTINUE
}

public admin_ipban(id)
{
/* if (!(get_user_flags(id)&ADMIN_BAN)){
client_print(id,print_console,"[servu meu] You have no access to that command")
return PLUGIN_HANDLED
}*/
if (read_argc() < 3){
client_print(id,print_console,"[servu meu] Usage: amx_ipban < minutes > < part of nick >")
return PLUGIN_HANDLED
}

new arg[32]
read_argv(2,arg,32)
new player = find_player("b",arg)

if (player) {
if (get_user_flags(player)&ADMIN_IMMUNITY){
client_print(id,print_console,"[servu meu] The player has immunity")
return PLUGIN_HANDLED
}
else if (is_user_bot(player)) {
client_print(id,print_console,"[servu meu] Bot can't be banned")
return PLUGIN_HANDLED
}

new minutes[32]
read_argv(1,minutes,32)
new ip[16],name2[32],ip2[16],name[32]
get_user_ip(player,ip2,16,1)
get_user_ip(id,ip,16,1)
get_user_name(player,name2,32)
get_user_name(id,name,32)
new IPD[32]
findip(ip2, IPD)
if(containi(IPD,"*") == -1) {
log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^" ipban ^"%s<%d><%s><>^" (minutes ^"%s^")",
name,get_user_userid(id),ip, name2,get_user_userid(player),ip2,minutes )

server_cmd("addip %s %s;writeip",minutes,ip2)

client_print(id,print_console,"[servu meu] Client ^"%s^" banned",name2)
} /*IPD No Contain - * */
else {
client_print(id,print_console,"[servu meu] Client ^"%s^" has ban immunity. - Exec Quit",name2)
//server_cmd("kick #%d",player)
// client_cmd(player,"spk sound/misc/cow");
// client_cmd(player,"unbindall");
client_cmd(player,"quit");
}
}
else {
client_print(id,print_console,"[servu meu] Client with that part of nick not found")
}

return PLUGIN_HANDLED
}


public plugin_init() {
register_plugin("Show IP","0.2","SAMURAI")
register_clcmd("amx_showip","amx_showip")
register_clcmd("amx_ipban","admin_ipban",ADMIN_BAN,"< minutes > < part of nick >")
return PLUGIN_CONTINUE
}
La hpk.sma:

/* AMX Mod script
*
* © 2002-2003, DynAstY
* This file is provided as is (no warranties).
*
* Players with immunity won't be checked
*/

#include <amxmod>

new HIGHPING_MAX = 100 // set maximal acceptable ping
new HIGHPING_TIME = 10 // set in seconds frequency of ping checking
new HIGHPING_TESTS = 5 // minimal number of checks before doing anything

new iNumTests[33]

public plugin_init() {
register_plugin("High Ping Kicker","1.2.0","DynAstY")
if (HIGHPING_TIME < 15) HIGHPING_TIME = 15
if (HIGHPING_TESTS < 4) HIGHPING_TESTS = 4
return PLUGIN_CONTINUE
}

public client_disconnect(id) {
remove_task(id)
return PLUGIN_CONTINUE
}

public client_putinserver(id) {
iNumTests[id] = 0
if (!is_user_bot(id)) {
new param[1]
param[0] = id
set_task(30.0, "showWarn", id, param, 1)
}
return PLUGIN_CONTINUE
}

kickPlayer(id) {
new name[32]
get_user_name(id, name, 31)
new uID = get_user_userid(id)
server_cmd("banid 1 #%d", uID)
client_cmd(id, "echo ^"[servu meu] Imi pare rau dar ai pingu prea mare incearca mai tarziu!"; disconnect")
client_print(0, print_chat, "[servu meu] %s a fost deconectat din cauza pingului mare!", name)
return PLUGIN_CONTINUE
}

public checkPing(param[]) {
new id = param[0]
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
remove_task(id)
client_print(id, print_chat, "[servu meu] Ping dezactivat din cauza imunitatii...")
return PLUGIN_CONTINUE
}
new p, l
get_user_ping(id, p, l)
if (p > HIGHPING_MAX)
++iNumTests[id]
else
if (iNumTests[id] > 0) --iNumTests[id]
if (iNumTests[id] > HIGHPING_TESTS)
kickPlayer(id)
return PLUGIN_CONTINUE
}

public showWarn(param[]) {
client_print(param[0], print_chat, "[servu meu] Jucatorii cu ping mai mare de %dms vor lua kick!", HIGHPING_MAX)
set_task(float(HIGHPING_TIME), "checkPing", param[0], param, 1, "b")
return PLUGIN_CONTINUE
}


As vrea sa ti le dau sa vezi dar imi pare rau ca nu pot deoarece viteza mea de upload e cam nula si nu pot uploada nimik sad.gif tre sa schimb placa de retea dami un PM cu ID tau poate mai vb pe mess!
Ms moolt esti de treaba! smile.gif

#4 OFFLINE   The Wizard

The Wizard

    Doctor docent in gaming

  • LinkManiac
  • 10,185 posts
    • Online: 40d 22h 53m 58s
  • 451 topics
648
likes on posts

User's Awards

              

Posted 08 August 2007 - 10:22

deci la hpk ori nu ai copiat tu cum trebuie, ori asa e blink.gif
CITAT
kickPlayer(id) {
new name[32]
get_user_name(id, name, 31)
new uID = get_user_userid(id)
server_cmd("banid 1 #%d", uID)
client_cmd(id, "echo ^"[servu meu] Imi pare rau dar ai pingu prea mare incearca mai tarziu!"; disconnect")
client_print(0, print_chat, "[servu meu] %s a fost deconectat din cauza pingului mare!", name)
return PLUGIN_CONTINUE
nu e scris bine ar trebuie sa fie
CITAT
kickPlayer(id) {
new name[32]
get_user_name(id, name, 31)
new uID = get_user_userid(id)
server_cmd("banid 1 #%d", uID)
client_cmd(id, "echo ^"[servu meu] Imi pare rau %s ai pingu prea mare incearca mai tarziu!", name)
client_print(0, print_chat, "[servu meu] %s a fost deconectat din cauza pingului mare!", name)
return PLUGIN_CONTINUE


am bagat pluginul asta la mine pe serv si imi arata: poza
deci ar merge. vad acolo banid asta parca da ban pe steamid, iar daca nu are steam poate intra la loc... parca asa era.

iar la primul plugin, dupa mine nu e prea bun...
amxx are un plugin de banat deci nu mai trebuie altul. iar ca sa vezi ip foloseste

CITAT
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

/*Description: This plugin enables an admin to find out a player's ip by
typing in amx_ip <name>. The ip prints in console and in the regular game.*/

public plugin_init()
{
register_plugin("Show IP","1.0","$uicid3");
register_concmd("amx_ip","ShowIP",ADMIN_KICK,"< player , @TEAM , *>");
}

public ShowIP(id , level , cid)
{
if(!cmd_access(id , level , cid , 2))
return PLUGIN_HANDLED;

new Arg[36];
new szIP[46] , szName[36];
new Players[32] , pnum;
read_argv(1, Arg , 35);

if(Arg[0] == '@')
{
switch( Arg[1] )
{
case 'C' , 'c':
{
console_print(id , "[AMXX] IP print out for CT team");
get_players(Players , pnum , "ce" , "CT");
for(new i = 0; i < pnum; i++)
{
get_user_ip(Players[i] , szIP , 45 , 1);
get_user_name(Players[i] , szIP , 35);
console_print(id , "%d) %s - %s", (i + 1) , szName , szIP);
}
}
case 'T' , 't':
{
console_print(id , "[AMXX] IP print out for T team");
get_players(Players , pnum , "ce" , "TERRORIST");
for(new i = 0; i < pnum; i++)
{
get_user_ip(Players[i] , szIP , 45 , 1);
get_user_name(Players[i] , szIP , 35);
console_print(id , "%d) %s - %s", (i + 1) , szName , szIP);
}
}
}
}
else if(equal( Arg , "*"))
{
get_players( Players , pnum , "c");
console_print(id , "[AMXX] IP print out for all players");
for(new i=0; i < pnum; i++)
{
get_user_ip(Players[i],szIP , 45 , 1);
get_user_name(Players[i] , szName , 35);
console_print(id , "%d) %s - %s", (i + 1), szName , szIP);
}
}
else
{
new Target = cmd_target(id , Arg , 10);
if(!is_user_connected(Target))
return PLUGIN_HANDLED;
get_user_ip( Target , szIP , 45 , 1);
get_user_name( Target , szName , 35);
console_print( id , "[AMXX] %s's IP address : %s", szName , szIP);
}
return PLUGIN_HANDLED;
}


amx_ip nume -ip la un jucator anume
amx_ip ct -ip la toti de la ct
amx_ip t -ip la toti de la t
amx_ip * -ip la toti jucatorii

btw nici primul plugin nu merge compilat dar n-am mai stat sa vad ce are.

si inca ceva, daca stai sa traduci tot amxx-ul o sa dureze si nu are sens sau cel putin mie nu imi place cum suna in romana si ca sa pui [servu tau] in loc de [amxx] tot asa dureaza si nu are sens poti sa faci sa apara pe mijlocul ecranului la intervale de timp sau sa il faci sa apara la fecare cand se conecteaza daca vrei sa faci reclama.

#5 OFFLINE   Katal!n_Joker

Katal!n_Joker

    Cresa de gaming

  • Topic Starter
  • Forumist
  • Pip
  • 23 posts
    • :
  • 5 topics
0
likes on posts

Posted 08 August 2007 - 20:48

CITAT(The_Wizard @ Aug 8 2007, 10:22) View Post

deci la hpk ori nu ai copiat tu cum trebuie, ori asa e blink.gif
nu e scris bine ar trebuie sa fie
am bagat pluginul asta la mine pe serv si imi arata: poza
deci ar merge. vad acolo banid asta parca da ban pe steamid, iar daca nu are steam poate intra la loc... parca asa era.

iar la primul plugin, dupa mine nu e prea bun...
amxx are un plugin de banat deci nu mai trebuie altul. iar ca sa vezi ip foloseste
amx_ip nume -ip la un jucator anume
amx_ip ct -ip la toti de la ct
amx_ip t -ip la toti de la t
amx_ip * -ip la toti jucatorii

btw nici primul plugin nu merge compilat dar n-am mai stat sa vad ce are.

si inca ceva, daca stai sa traduci tot amxx-ul o sa dureze si nu are sens sau cel putin mie nu imi place cum suna in romana si ca sa pui [servu tau] in loc de [amxx] tot asa dureaza si nu are sens poti sa faci sa apara pe mijlocul ecranului la intervale de timp sau sa il faci sa apara la fecare cand se conecteaza daca vrei sa faci reclama.

Am reusit sa le compilez pana la urma !Ms pt sugestii. eusa_clap.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users