Posiadam serwer Deathmatch kazdy na kazdego i gdy zabije swojego to nie dostaje hp za zabicie .
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
new skoki[33], bool:g_Vip[33];
public plugin_init(){
register_plugin("vipdm", "3.2.0.2", "benio101 & speedkill");
register_message(get_user_msgid("ScoreAttrib"), "g_VipStatus");
register_event("DeathMsg", "DeathMsg", "a");
RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
register_forward(FM_CmdStart, "CmdStartPre");
}
public g_VipStatus(){
new id=get_msg_arg_int(1);
if(is_user_alive(id) && g_Vip[id])
set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int(2)|4);
}
public DeathMsg(){
new killer=read_data(1);
new victim=read_data(2);
if(is_user_alive(killer) && g_Vip[killer]){
if(get_user_team(killer) != get_user_team(victim)){
new g_Hs=read_data(3);
new g_Hp=get_user_health(killer);
if(g_Hs){
if(g_Hp < 400){
if(g_Hp + 50 > 400){
new g_Dif=400-g_Hp;
set_user_health(killer,g_Hp + g_Dif);
}
else
set_user_health(killer,g_Hp + 50);
}
}
else{
if(g_Hp < 400){
if(g_Hp + 30 > 400){
new g_Dif=400-g_Hp;
set_user_health(killer,g_Hp + g_Dif);
}
else
set_user_health(killer,g_Hp + 30);
}
}
}
}
}
public client_authorized(id){
if(get_user_flags(id) & 524288 == 524288){
g_Vip[id]=true;
}
}
public client_disconnect(id){
if(g_Vip[id]){
g_Vip[id]=false;
}
}
public SpawnedEventPre(id){
if(is_user_alive(id) && g_Vip[id])
SpawnedEvent(id);
}
public SpawnedEvent(id){
give_item(id, "weapon_hegrenade");
skoki[id]=2;
return PLUGIN_CONTINUE;
}
public CmdStartPre(id,uc_handle){
if(is_user_alive(id) && g_Vip[id])
CmdStart(id,uc_handle);
}
public CmdStart(id,uc_handle){
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id]){
--skoki[id];
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id,pev_velocity,velocity);
} else if(flags & FL_ONGROUND)
skoki[id] = 2;
return FMRES_IGNORED;
}


Dodatki SourceMod



Temat jest zamknięty
Plugin.amxx








