#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define FL_ONGROUND (1<<9)
#define FL_WATERJUMP (1<<11)
forward amxbans_admin_connect(id);
new bool:g_FreezeTime, bool:g_Vip[33], g_Hudmsg, skoki[33];
public plugin_init(){
register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
RegisterHam(get_player_resetmaxspeed_func(), "player", "fw_Player_ResetMaxSpeed", 1);
register_logevent("logevent_round_start", 2, "1=Round_Start");
register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
register_forward(FM_CmdStart, "CmdStartPre");
register_message(get_user_msgid("ScoreAttrib"), "VipStatus");
register_clcmd("say /vip", "ShowMotd");
register_message(get_user_msgid("SayText"),"handleSayText");
g_Hudmsg=CreateHudSyncObj();
}
public client_authorized(id){
if(get_user_flags(id) & 524288 == 524288){
client_authorized_vip(id);
}
}
public client_authorized_vip(id){
g_Vip[id]=true;
new g_Name[64];
get_user_name(id,g_Name,charsmax(g_Name));
set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
ShowSyncHudMsg(0, g_Hudmsg, "Vip %s wbija na serwer !",g_Name);
}
public client_disconnect(id){
if(g_Vip[id]){
client_disconnect_vip(id);
}
}
public client_disconnect_vip(id){
g_Vip[id]=false;
}
Ham:get_player_resetmaxspeed_func(){
#if defined Ham_CS_Player_ResetMaxSpeed
return IsHamValid(Ham_CS_Player_ResetMaxSpeed)?Ham_CS_Player_ResetMaxSpeed:Ham_Item_PreFrame;
#else
return Ham_Item_PreFrame;
#endif
}
public fw_Player_ResetMaxSpeed(id){
if(g_Vip[id]){
if(is_user_alive(id)){
fw_Player_ResetMaxSpeedVip(id);
}
}
}
public logevent_round_start(){
g_FreezeTime=false;
}
public event_new_round(){
g_FreezeTime=true;
}
public fw_Player_ResetMaxSpeedVip(id){
if(!g_FreezeTime){
set_user_maxspeed(id,get_user_maxspeed(id) + 325);
}
}
public SpawnedEventPre(id){
if(g_Vip[id]){
if(is_user_alive(id)){
SpawnedEventPreVip(id);
}
}
}
public SpawnedEventPreVip(id){
set_user_footsteps(id,1);
skoki[id]=2;
set_user_rendering(id, kRenderFxNone, 0,0,0, kRenderTransAlpha, 160);
new g_Model[64];
formatex(g_Model,charsmax(g_Model),"%s",get_user_team(id) == 1 ? "VipTT" : "VipCT");
cs_set_user_model(id,g_Model);
}
public CmdStartPre(id, uc_handle){
if(g_Vip[id]){
if(is_user_alive(id)){
CmdStartPreVip(id, uc_handle);
}
}
}
public CmdStartPreVip(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]>0){
--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]!=-1){
skoki[id] = 2;
}
}
public 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 ShowMotd(id){
show_motd(id, "vip.txt", "Informacje o vipie");
}
public handleSayText(msgId,msgDest,msgEnt){
new id = get_msg_arg_int(1);
if(is_user_connected(id) && g_Vip[id]){
new szTmp[256],szTmp2[256];
get_msg_arg_string(2,szTmp, charsmax(szTmp))
new szPrefix[64] = "^x04[VIP]";
if(!equal(szTmp,"#Cstrike_Chat_All")){
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2)," ");
add(szTmp2,charsmax(szTmp2),szTmp);
}
else{
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
}
set_msg_arg_string(2,szTmp2);
}
return PLUGIN_CONTINUE;
}
public plugin_precache(){
precache_model("models/player/VipCT/VipCT.mdl");
precache_model("models/player/VipTT/VipTT.mdl");
}
public client_PreThink(id){
if(g_Vip[id] && is_user_alive(id)){
client_PreThinkVip(id);
}
}
public client_PreThinkVip(id){
entity_set_float(id, EV_FL_fuser2, 0.0);
if(entity_get_int(id, EV_INT_button) & 2){
new flags = entity_get_int(id, EV_INT_flags);
if(flags & FL_WATERJUMP || entity_get_int(id, EV_INT_waterlevel) >= 2 || !(flags & FL_ONGROUND)){
return PLUGIN_CONTINUE;
}
new Float:velocity[3];
entity_get_vector(id, EV_VEC_velocity, velocity);
velocity[2] += 250.0;
entity_set_vector(id, EV_VEC_velocity, velocity);
entity_set_int(id, EV_INT_gaitsequence, 6);
}
return PLUGIN_CONTINUE;
}
public amxbans_admin_connect(id){
client_authorized(id);
}
vip.txt dajesz kod html z info o vipie, a ten plik wrzucasz do cstrike
Użytkownik kamilcio2192 edytował ten post 11.04.2014 07:38