AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Anti rat plugin help fix this (https://forums.alliedmods.net/showthread.php?t=307229)

yndith761 05-01-2018 12:57

Anti rat plugin help fix this
 
Hi everyone! I need a plugin, which slay player who kills in the back with knife.
So, I found right code and thought about adding a thunder slaying.

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define IsPlayer(%1) ( 1 <= %1 <= MaxPlayers )
new MaxPlayers,nick[32],detections[33]
static mapname[32]
public plugin_init(){
get_mapname(mapname,31)
if (containi(mapname,"35hp_")==-1){
return PLUGIN_HANDLED_MAIN
}
if (containi(mapname,"ka_")==-1){
return PLUGIN_HANDLED_MAIN
}
register_plugin( "AntiRat", "1.0", "<PAWNcoder>")
RegisterHam( Ham_TakeDamage, "player", "detectDamage" )
register_clcmd("prevention", "prevention")
MaxPlayers = get_maxplayers()
}
public client_connect(id){
detections[id]=0
}
public detectDamage(Victim, Inflictor, Attacker, Float:Damage, Damagebits){
if(IsPlayer(Attacker) && Damage==195.0){
client_cmd(Attacker, "prevention")
}
}
public prevention(id){
set_hudmessage(255, 255, 255, -1.0, 0.4, 6.0, 12.0, 5.0)
client_cmd(id, "speak danger")
switch(detections[id]){
case 0:{
show_hudmessage(id, "[1/3] Don't cut in a back!!!")
}
case 1:{
show_hudmessage(id, "[2/3] Don't cut in a back!!!")
}
case 2:{
get_user_name(id,nick,sizeof nick -1)
client_print(0,print_chat,"[Anti-Rat] Player %s was kicked!!!", nick)
server_cmd("kick #%d Don't cut in a back!!!",get_user_userid(id))
}
}
detections[id]++
}

Also I find thunder function:

Thunder( ivec1[ 3 ], ivec2[ 3 ] )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMPOINTS );
write_coord( ivec1[ 0 ] );
write_coord( ivec1[ 1 ] );
write_coord( ivec1[ 2 ] );
write_coord( ivec2[ 0 ] );
write_coord( ivec2[ 1 ] );
write_coord( ivec2[ 2 ] );
write_short( lightning );
write_byte( 1 );
write_byte( 5 );
write_byte( 7 );
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, ivec2 );
write_byte( TE_SPARKS );
write_coord( ivec2[ 0 ] );
write_coord( ivec2[ 1 ]);
write_coord( ivec2[ 2 ] );
message_end();

emit_sound( 0 ,CHAN_ITEM, thunder_sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
}

Please help me make killing in the back with slay and thunder sprite ((:cry:

Natsheh 05-01-2018 14:05

Re: Anti rat plugin help fix this
 
You should be slayed for not putting the code in code or php tags organise your thread.


All times are GMT -4. The time now is 04:38.

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