|
Junior Member
|

08-23-2009
, 12:45
Modific Plugin + add commands
|
#1
|
I do not know if it's good where I posted , but listening :
At this plugin commands do not work . Please repair the plugin !
Code:
#include <amxmodx>
#include <cstrike>
#include <amxmisc>
new light, smoke
new const g_StartCommands[ ][ ] =
{
"mp_startmoney 800",
"mp_friendlyfire 1",
"mp_freezetime 10",
"mp_roundtime 2",
"mp_autoteambalance 0",
"mp_fadetoblack 0",
"sv_restart 3"
};
new const g_WarmCommands[ ][ ] =
{
"mp_startmoney 16000",
"mp_friendlyfire 0",
"mp_freezetime 0",
"mp_roundtime 2",
"mp_autoteambalance 0",
"sv_restart 3"
};
new gi_Lame;
public saypgl()
{
for ( new i = 0; i < sizeof g_StartCommands; i++ )
server_cmd ( g_StartCommands[ i ] );
gi_Lame = 0;
client_print(0,print_chat, "CONSOLE : Meciul incepe in 3 ..." )
client_print(0,print_chat, "CONSOLE : Meciul incepe in 2 ..." )
client_print(0,print_chat, "CONSOLE : Meciul incepe in 1 ..." )
}
public sayrestart ()
{
server_cmd ( "sv_restart 1" )
gi_Lame = 0;
client_print(0,print_chat, " CONSOLE : GL & HF !" )
client_print(0,print_chat, " CONSOLE : GL & HF !" )
client_print(0,print_chat, " CONSOLE : GL & HF !" )
}
public saywarm ()
{
for ( new i = 0; i < sizeof g_WarmCommands; i++ )
server_cmd ( g_WarmCommands[ i ] );
gi_Lame = 0;
client_print(0,print_chat, " CONSOLE : Runda de Incalzire a inceput ..." )
client_print(0,print_chat, " CONSOLE : Runda de Incalzire a inceput ..." )
client_print(0,print_chat, " CONSOLE : Runda de Incalzire a inceput ..." )
}
public saylame()
{
gi_Lame = 1;
client_print(0,print_chat, " CONSOLE : Runda de Lame a inceput ..." )
client_print(0,print_chat, " CONSOLE : Runda de Lame a inceput ..." )
client_print(0,print_chat, " CONSOLE : Runda de Lame a inceput ..." )
}
public saypassof(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost scoasa ..." );
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost scoasa ..." );
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost scoasa ..." );
set_cvar_string("sv_password", "")
return 1
}
public saypass(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new cmd[32], password[128]
read_argv(0, cmd, 31)
read_args(password, 127)
replace(password, 127, cmd, "")
format(password, 127, "%s", password)
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost pusa ..." );
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost pusa ..." );
client_print(0,print_chat, " CONSOLE : Parola Serverului a fost pusa ..." );
set_cvar_string("sv_password", password)
return 1
}
public saystop()
{
for ( new i = 0; i < sizeof g_StartCommands; i++ )
server_cmd ( g_StartCommands[ i ] );
gi_Lame = 0;
client_print(0,print_chat, " CONSOLE : Meciul s-a terminat ..." )
client_print(0,print_chat, " CONSOLE : Meciul s-a terminat ..." )
client_print(0,print_chat, " CONSOLE : Meciul s-a terminat ..." )
}
public saymap(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new arg[32]
new arglen = read_argv(1, arg, 31)
if (!is_map_valid(arg))
{
console_print(id, "Harta este scrisa gresit sau nu exista pe server", id)
return 1
}
client_print(0,print_chat, " CONSOLE : Harta s-a schimbat in %s ...", arg)
client_print(0,print_chat, " CONSOLE : Harta s-a schimbat in %s ...", arg)
client_print(0,print_chat, " CONSOLE : Harta s-a schimbat in %s ...", arg)
new _modName[10]
get_modname(_modName, 9)
if (!equal(_modName, "zp"))
{
message_begin(MSG_ALL, SVC_INTERMISSION)
message_end()
}
set_task(3.0, "xMap", 0, arg, arglen + 1)
return 1
}
public xMap(map[])
server_cmd("changelevel %s", map)
public sayban(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new target[32]
read_argv(1, target, 31)
new player = cmd_target(id, target, 7)
if (!player)
return 1
static name[32]
new authid2[32], usrip[32]
new userid2 = get_user_userid(player)
get_user_authid(player, authid2, 31)
get_user_name(player, name, 31)
get_user_ip(player, usrip, 31, 1)
client_cmd(player, "wait;snapshot;wait");
server_cmd("kick #%d ^"Ai Luat Ban^";wait;addip ^"0.0^" ^"%s^";wait;writeip", userid2, usrip);
console_print(player, "Banat Permanent");
client_print(0,print_chat, " CONSOLE : %s a primit BAN ...", name)
client_print(0,print_chat, " CONSOLE : %s a primit BAN ...", name)
client_print(0,print_chat, " CONSOLE : %s a primit BAN ...", name)
return 1
}
public sayunban(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new arg[32]
read_argv(1, arg, 31)
server_cmd("removeip ^"%s^";writeip", arg)
console_print(id, "Ip %s inlaturat din listip", id, arg)
client_print(0,print_chat, " CONSOLE : %s a fost debanat ...", arg)
client_print(0,print_chat, " CONSOLE : %s a fost debanat ...", arg)
client_print(0,print_chat, " CONSOLE : %s a fost debanat ...", arg)
return 1
}
public sayslay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id, arg, 7)
slay_player(player)
user_silentkill(player)
client_print(0,print_chat, " CONSOLE : %s a fost ucis ...",arg)
client_print(0,print_chat, " CONSOLE : %s a fost ucis ...",arg)
client_print(0,print_chat, " CONSOLE : %s a fost ucis ...",arg)
return 1
}
public saydemo()
{
new s_Args[ 32 ]
read_argv (2, s_Args, 31 )
client_cmd(get_user_index(s_Args), "record demo")
}
public saystopdemo()
{
new s_Args[ 32 ]
read_argv (2, s_Args, 31 )
client_cmd(get_user_index(s_Args), "stop")
client_cmd(get_user_index(s_Args), "say Mi-a fost facut un demo si nu stiu cui sa il dau !")
client_cmd(get_user_index(s_Args), "say Mi-a fost facut un demo si nu stiu cui sa il dau !")
client_cmd(get_user_index(s_Args), "say Mi-a fost facut un demo si nu stiu cui sa il dau !")
}
public sayslap(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1
new arg[32], origin[3]
read_argv(1, arg, 31)
new player = cmd_target(id, arg, 7)
if (!player)
return 1
new spower[32], authid2[32]
static name2[32]
read_argv(2, spower, 31)
new damage = str_to_num(spower)
user_slap(player, damage)
get_user_authid(player, authid2, 31)
get_user_name(player, name2, 31)
get_user_origin(player, origin)
client_print(0,print_chat, " CONSOLE : %s a primit slap cu %s putere ...",name2,damage)
client_print(0,print_chat, " CONSOLE : %s a primit slap cu %s putere ...",name2,damage)
client_print(0,print_chat, " CONSOLE : %s a primit slap cu %s putere ...",name2,damage)
return 1
}
slay_player(victim)
{
new origin[3], srco[3]
get_user_origin(victim,origin)
origin[2] -= 26;
srco[0]=origin[0]+150
srco[1]=origin[1]+150
srco[2]=origin[2]+400
lightning(srco,origin)
}
lightning(vec1[3],vec2[3])
{
client_cmd(0,"spk ^"ambience/thunder_clap^"")
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 0 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( light )
write_byte( 1 )
write_byte( 5 )
write_byte( 2 )
write_byte( 20 )
write_byte( 30 )
write_byte( 200 )
write_byte( 200 )
write_byte( 200 )
write_byte( 200 )
write_byte( 200 )
message_end()
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
write_byte( 9 )
write_coord( vec2[0] )
write_coord( vec2[1] )
write_coord( vec2[2] )
message_end()
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
write_byte( 5 )
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( smoke )
write_byte( 10 )
write_byte( 10 )
message_end()
}
public hook_curweapon ( id )
{
if ( ! gi_Lame )
return PLUGIN_CONTINUE;
if ( ! is_user_alive ( id ) )
return PLUGIN_CONTINUE;
if ( read_data ( 2 ) != CSW_KNIFE )
engclient_cmd ( id, "weapon_knife" );
return PLUGIN_CONTINUE;
}
public plugin_init()
{
register_plugin("Gather Kernel", "1.0", "N3messys/update x")
register_clcmd ( "say .stop" , "saystop" ,ADMIN_KICK )
register_clcmd ( "say .pass" , "saypass" ,ADMIN_KICK)
register_clcmd ( "say .passoff" , "saypassof" ,ADMIN_KICK)
register_clcmd ( "say .lame" , "saylame" ,ADMIN_KICK)
register_clcmd ( "say .warmup" , "saywarm" )
register_clcmd ( "say .restart", "sayrestart",ADMIN_KICK)
register_clcmd ( "say .start", "saypgl" ,ADMIN_KICK)
register_clcmd ( "say .map", "saymap" ,ADMIN_KICK)
register_clcmd ( "say .ban", "sayban" ,ADMIN_KICK)
register_clcmd ( "say .unban", "sayunban" ,ADMIN_KICK)
register_clcmd ( "say .slay" , "sayslay" ,ADMIN_KICK)
register_clcmd ( "say .demo" , "saydemo" ,ADMIN_KICK)
register_clcmd ( "say .stopdemo" , "saystopdemo" ,ADMIN_KICK)
register_event ( "CurWeapon", "hook_curweapon", "be", "1=1" )
}
And i want to add at plugin this commands :
.kick <name> (no with <>) and a mesage in chat : Name was kicked .
.score - to say the score : The team a score and team b score (in a message in chat)
.teams - to say in chat :
-Team a : the name in team a
-Team b : the name in team b
*if you can't to put this command , don't put it*
.hp - when you fire in an opponet and he kill you to say in chat :
-The opponent who kill you has x hp (to say his hp)
I want :
-modify command .start with .ready
-the commands to be only for admins
-the commands to be on say and say_team !
sorry for mai english ! I hope to understand ...
thx :* I hope to make ! a good day
|
|