Sign in to follow this  
NemeSyS

cerere modificare plugin

1 post in this topic

puteti sa-l modificati ina sa fel cand moare sa ii de-a s respawn automat il locul unde a murit , si timp de 10 sec sa aibe goodmode !
Multumesc

 

Quote:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>

#define FLAG "t"

new jumpnum[33] = 0
new bool:dojump[33] = false
new cvar_vip_health, cvar_vip_armor, cvar_vip_jumps

new const model[] = "bb_vip_skin"

public plugin_init()
{
register_plugin("[bB] Vip", "1.0", "alex ownage")

RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1)

register_event("DeathMsg", "PlayerKill", "a")

cvar_vip_armor = register_cvar("bb_vip_spawn_armor", "100")
cvar_vip_health = register_cvar("bb_vip_spawn_health", "200")
cvar_vip_jumps = register_cvar("bb_vip_max_jumps", "1")

register_message(get_user_msgid("ScoreAttrib"), "TabVIP")

register_clcmd("say /vip", "sayVIP")
register_clcmd("say /vips", "OnlineVIPS")
}

public plugin_precache()
{
new Model[64]
formatex(Model, charsmax(Model), "models/player/%s/%s.mdl", model, model)

precache_model(Model)
}

public PlayerKill()
{
static k; k = read_data(1)
static v; v = read_data(2)

if(get_user_flags(k) & read_flags(FLAG))
{
if(k == v)
{
return PLUGIN_HANDLED;
}

if(get_user_health(k) == 200)
{
return PLUGIN_HANDLED;
}

set_user_health(k, get_user_health(k) + 20)
}

return PLUGIN_CONTINUE;
}

public TabVIP(iMsgId, iDest, iReciver)
{
new iPlayer = get_msg_arg_int(1)

if(get_user_flags(iPlayer) & read_flags(FLAG))
{
set_msg_arg_int(2, ARG_BYTE, (1<<2))
}
}

public PlayerSpawn(id)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
if(get_user_flags(id) && read_flags(FLAG))
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{

set_user_health(id, get_pcvar_num(cvar_vip_health))
set_user_armor(id, get_pcvar_num(cvar_vip_armor))
cs_set_user_model(id, "bb_skin_vip")
}
}

return PLUGIN_CONTINUE;
}

public sayVIP(id)
{
new Dir[64], File[64]

get_configsdir(Dir, charsmax(Dir))

formatex(File, charsmax(File), "%s/vip.txt", Dir)

if(!file_exists(File))
{
ColorChat(id, "!x04[bB] !x03Eroare in deschiderea fisierului !x04vip.txt")
return PLUGIN_HANDLED;
}

show_motd(id, File)

return PLUGIN_CONTINUE;
}

public OnlineVIPS(id)
{
new AdminNames[33][32], Message[256]
new Count, i, len

if(!is_user_connected(id))
{
return PLUGIN_HANDLED;
}

if(get_user_flags(id) & read_flags(FLAG))
{
get_user_name(id, AdminNames[Count++], 31)

len = format(Message, 255, "!x04Gold Members: !x03")
if(Count > 0)
{
for(i = 0; i < Count; i++)
{
len += format(Message[len], 255-len, "%s%s", AdminNames, i < (Count - 1) ? ", ":"")
if(len < 96)
{
}
}
}

}

ColorChat(id, Message)

else {
ColorChat(id, "!x04No Gold Members")
}

return PLUGIN_CONTINUE;
}

public client_PreThink(id)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}

new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)

if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(get_user_flags(id) & read_flags(FLAG))
{
if(jumpnum[id] < get_pcvar_num(cvar_vip_jumps))
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE;
}
}
}

if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE;
}

return PLUGIN_CONTINUE;
}

public client_PostThink(id)
{
if(!is_user_alive(id))
{
return PLUGIN_CONTINUE;
}

if(get_user_flags(id) & read_flags(FLAG))
{
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity, velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity, velocity)
dojump[id] = false
return PLUGIN_CONTINUE;
}
}

return PLUGIN_CONTINUE;
}

stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!x04", "^4");
replace_all(msg, 190, "!x03", "^3");

if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players)) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this