Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < amxmisc >
- #include < engine >
- #include < fun >
- #include < xs >
- #include < cstrike >
- #include < fakemeta >
- #include < hamsandwich >
- #define PLUGIN "VIP Menu"
- #define VERSION "1.0"
- // -- || Score TAB || -- //
- enum {
- SCOREATTRIB_ARG_PLAYERID = 1,
- SCOREATTRIB_ARG_FLAGS
- };
- enum ( <<= 1 ) {
- SCOREATTRIB_FLAG_NONE = 0,
- SCOREATTRIB_FLAG_DEAD = 1,
- SCOREATTRIB_FLAG_BOMB,
- SCOREATTRIB_FLAG_VIP
- };
- #define VIP ADMIN_LEVEL_G
- #define IsPlayer(%0) (1 <= %0 <= g_iMaxPlayers)
- new g_iMaxPlayers;
- // -- || Variabil's
- new SuperKnife[33], Speed[33], Gravity[33], Round[33], HasPower[33];
- // -- || Constante
- new const v_superknife [ 64 ] = "models/v_sk3.mdl";
- // -- || Power
- //--| GodMode |--//
- new GodMode_Cooldown[33] = 0;
- new GodMode_DurationCooldown[33] = 0;
- //--| Teleport |--//
- new TeleportSprite, TeleportSprite2;
- new Teleport_Cooldown[33];
- new const SOUND_BLINK[] = { "weapons/flashbang-1.wav" };
- const UNIT_SEC = 0x1000;
- const FFADE = 0x0000;
- //------| Suicide Bomb |------//
- new SPR_SUICIDE_EXPLODE, SPR_SUICIDE_SMOKE, SPR_SUICIDE_BLAST
- #define EXPLOSION_MAX_DAMAGE 100.0
- #define EXPLOSION_KNOCKBACK 5.0
- #define EXPLOSION_BLAST_RADIUS 250.0
- #define TASK_EXPLOSION 160
- #define TASK_BEAMCYLINDER 192
- #define SOUND_SUICIDE "ambience/particle_suck1.wav"
- new BloodSpray, BloodDrop;
- // -- | Cvars | -- //
- new speed, gravity, cvar_he;
- new CvarGodModeCooldown, CvarGodModeDuration, CvarTeleportCooldown, CvarTeleportRange;
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, "Truth");
- // Cvar's
- speed = register_cvar("vip_menu_speed", "400.0");
- gravity = register_cvar("vip_menu_gravity", "0.7");
- cvar_he = register_cvar("vip_menu_he", "3");
- CvarGodModeCooldown = register_cvar("vip_godmode_cooldown", "25"); // GodMode Cooldown
- CvarGodModeDuration = register_cvar("vip_godmode_duration", "2"); // GodMode Duration
- CvarTeleportCooldown = register_cvar("vip_teleport_cooldown", "10.0"); // Teleport Cooldown
- CvarTeleportRange = register_cvar("vip_teleport_range", "12345"); // Teleport Range
- register_clcmd("say", "handle_say");
- register_clcmd("say_team", "handle_say");
- register_clcmd("say /wantvip", "VIPHTML");
- register_clcmd("say_team /wantvip", "VIPHTML");
- register_clcmd("say /furienvip", "VipCmd");
- register_clcmd("say_team /furienvip", "VipCmd");
- register_clcmd("power", "Power");
- register_event("CurWeapon", "CurrWeapon", "be", "1=1");
- register_event("DeathMsg", "EVENT_Death", "a");
- RegisterHam(Ham_Spawn, "player", "Spawn", true);
- RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage");
- g_iMaxPlayers = get_maxplayers( );
- register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
- // Add your code here...
- }
- public plugin_precache() {
- precache_model(v_superknife);
- TeleportSprite = precache_model( "sprites/shockwave.spr");
- TeleportSprite2 = precache_model( "sprites/blueflare2.spr");
- BloodSpray = precache_model("sprites/bloodspray.spr");
- BloodDrop = precache_model("sprites/blood.spr");
- SPR_SUICIDE_EXPLODE = precache_model("sprites/zerogxplode.spr")
- SPR_SUICIDE_SMOKE = precache_model("sprites/steam1.spr")
- SPR_SUICIDE_BLAST = precache_model("sprites/ef_shockwave.spr")
- precache_sound(SOUND_SUICIDE)
- }
- public VIPHTML ( id ) show_motd(id, "addons/amxmodx/configs/vip.html", "VIP");
- public EVENT_Death ( ) {
- new Victim = read_data ( 2 );
- if(is_user_connected(Victim)) {
- if(HasPower[Victim] == 3) {
- Ultimate_SuicideExplode(Victim)
- }
- }
- }
- public MessageScoreAttrib( iMsgId, iDest, iReceiver ) {
- new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );
- if( access( iPlayer, VIP ) ) {
- set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
- }
- }
- public Spawn ( id ) {
- SuperKnife[id] = false;
- Speed[id] = false;
- Gravity[id] = false;
- Round[ id ] = false;
- GodMode_Cooldown[id] = 0;
- GodMode_DurationCooldown[id] = 0;
- Teleport_Cooldown[id] = 0;
- HasPower[id] = 0;
- }
- public CurrWeapon( id ) {
- if ( SuperKnife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
- set_pev ( id, pev_viewmodel2, v_superknife );
- }
- if(Speed[id]) {
- set_user_maxspeed(id, get_pcvar_float(speed));
- }
- else
- {
- set_user_maxspeed(id, 260.0);
- }
- if(Gravity[id]) {
- set_user_gravity(id, get_pcvar_float(gravity));
- }
- else
- {
- set_user_gravity(id, 1.0);
- }
- }
- public VipCmd( id ) {
- if(Round[id]) {
- ColorChat(id, "^x04[VIP]^x01 Poti utiliza meniul doar odata pe runda.");
- return 1;
- }
- if(!(is_user_alive(id))) {
- ColorChat(id, "^x04[VIP]^x01 Nu poti accesa meniul cand esti mort.");
- return 1;
- }
- if (get_user_flags(id) & read_flags("v")){
- ColorChat(id, "^x04[VIP]^x01 Meniul este numai pentru membri^x04 VIP");
- return 1;
- }
- new VipMenu = menu_create("Vip Menu", "give_menu");
- if(get_user_team(id) == 1) {
- menu_additem(VipMenu, "\ySuper Knife \rx3 \yDMG", "1", 0);
- }
- else if(get_user_team(id) == 2) {
- menu_additem(VipMenu, "\ySpeed \r+ \yGravity", "1", 0);
- }
- menu_additem(VipMenu, "\yGod Mode", "2", 0);
- menu_additem(VipMenu, "\yTeleport", "3", 0);
- menu_additem(VipMenu, "\yPack \r500 \yHP \r+ \yAP", "4", 0);
- menu_additem(VipMenu, "\yHE Grenades", "5", 0);
- menu_additem(VipMenu, "\yExplode", "6", 0);
- menu_setprop(VipMenu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, VipMenu, 0);
- return 1;
- }
- public give_menu( id, VipMenu, item) {
- if(item == MENU_EXIT) {
- return 1;
- }
- switch ( item )
- {
- case 0:
- {
- if(get_user_team(id) == 1) {
- SuperKnife[id] = true;
- CurrWeapon(id);
- Round[id] = true;
- ColorChat(id, "^x04[VIP]^x01 Ai ales Super Knife 3X DMG.");
- }
- else if (get_user_team(id) == 2) {
- Speed[id] = true;
- Gravity[id] = true;
- CurrWeapon(id);
- Round[id] = true;
- ColorChat(id, "^x04[VIP]^x01 Ai ales speed + gravity.");
- }
- }
- case 1:
- {
- HasPower[id] = 1;
- ColorChat(id, "^x04[VIP]^x01 Ai ales godmode.Apasa^x04 V^x01 pentru a-l activa.");
- Round[ id ] = true;
- }
- case 2:
- {
- HasPower[id] = 2;
- ColorChat(id, "^x04[VIP]^x01 Ai ales teleport.Apasa^x04 V^x01 pentru a te teleporta.");
- Round[ id ] = true;
- }
- case 3:
- {
- set_user_health(id, 500);
- set_user_armor(id, 500);
- ColorChat(id, "^x04[VIP]^x01 Ai ales Pack 500HP si 500AP.");
- Round[id] = true;
- }
- case 4:
- {
- give_item(id, "weapon_hegrenade");
- cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(cvar_he));
- ColorChat(id, "^x04[VIP]^x01 Ai ales HE Grenade. Ai %s grenazi.", cvar_he );
- Round[id] = true;
- }
- case 5:
- {
- HasPower[id] = 3;
- ColorChat(id, "^x04[VIP]^x01 Ai ales Explode.Cand vei muri vei exploda.");
- Round[id] = true;
- }
- }
- menu_destroy(VipMenu);
- return 1;
- }
- public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits) {
- if(IsPlayer(iAttacker)) {
- if(iInflictor == iAttacker && SuperKnife[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && get_user_team(iAttacker) == 1) {
- SetHamParamFloat(4, fDamage * 3.0);
- return 1;
- }
- }
- return HAM_IGNORED;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // GodMode |
- //==========================================================================================================
- public GodModeShowHUD(id) {
- if (!is_user_alive(id) || HasPower[id] != 1) {
- remove_task(id);
- GodMode_DurationCooldown[id] = 0;
- set_user_godmode(id, 0);
- return PLUGIN_HANDLED;
- }
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(is_user_alive(id) && GodMode_DurationCooldown[id] == 1) {
- GodMode_DurationCooldown[id] --;
- show_hudmessage(id, "Ai GodMode pentru: %d secunda",GodMode_DurationCooldown[id]);
- }
- if(is_user_alive(id) && GodMode_DurationCooldown[id] > 1) {
- GodMode_DurationCooldown[id] --;
- show_hudmessage(id, "Ai GodMode pentru: %d secunde",GodMode_DurationCooldown[id]);
- }
- if(GodMode_DurationCooldown[id] <= 0) {
- show_hudmessage(id, "Nu mai ai GodMode");
- ColorChat(id,"^x03[Furien]^x04 Nu mai ai GodMode.");
- remove_task(id);
- set_user_godmode(id, 0);
- GodMode_DurationCooldown[id] = 0;
- GodMode_Cooldown[id] = get_pcvar_num(CvarGodModeCooldown);
- set_task(1.0, "GodModeShowHUD2", id, _, _, "b");
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(get_pcvar_num(CvarGodModeCooldown) != 1) {
- show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarGodModeCooldown));
- }
- if(get_pcvar_num(CvarGodModeCooldown) == 1) {
- show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarGodModeCooldown));
- }
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- public GodModeShowHUD2(id) {
- if (!is_user_alive(id) || HasPower[id] != 1) {
- remove_task(id);
- GodMode_Cooldown[id] = 0;
- return PLUGIN_HANDLED;
- }
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(is_user_alive(id) && GodMode_Cooldown[id] == 1) {
- GodMode_Cooldown[id] --;
- show_hudmessage(id, "Puterea iti va reveni in: %d secunda",GodMode_Cooldown[id]);
- }
- if(is_user_alive(id) && GodMode_Cooldown[id] > 1) {
- GodMode_Cooldown[id] --;
- show_hudmessage(id, "Puterea iti va reveni in: %d secunde",GodMode_Cooldown[id]);
- }
- if(GodMode_Cooldown[id] <= 0) {
- show_hudmessage(id, "Ti-a revenit puterea");
- ColorChat(id,"^x03[Furien]^x04 Iti poti folosi din nou puterea.");
- remove_task(id);
- GodMode_Cooldown[id] = 0;
- }
- return PLUGIN_HANDLED;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Teleport |
- //==========================================================================================================
- public TeleportShowHUD(id) {
- if (!is_user_alive(id) || HasPower[id] != 2) {
- remove_task(id);
- Teleport_Cooldown[id] = 0;
- return PLUGIN_HANDLED;
- }
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(is_user_alive(id) && Teleport_Cooldown[id] == 1) {
- Teleport_Cooldown[id] --;
- show_hudmessage(id, "Puterea iti va reveni in: %d secunda",Teleport_Cooldown[id]);
- }
- if(is_user_alive(id) && Teleport_Cooldown[id] > 1) {
- Teleport_Cooldown[id] --;
- show_hudmessage(id, "Puterea iti va reveni in: %d secunde",Teleport_Cooldown[id]);
- }
- if(Teleport_Cooldown[id] <= 0) {
- show_hudmessage(id, "Ti-a revenit puterea");
- ColorChat(id,"^x03[Furien]^x04 Iti poti folosi din nou puterea.");
- remove_task(id);
- Teleport_Cooldown[id] = 0;
- }
- return PLUGIN_HANDLED;
- }
- bool:teleport(id) {
- new Float:vOrigin[3], Float:vNewOrigin[3],
- Float:vNormal[3], Float:vTraceDirection[3],
- Float:vTraceEnd[3];
- pev(id, pev_origin, vOrigin);
- velocity_by_aim(id, get_pcvar_num(CvarTeleportRange), vTraceDirection);
- xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
- engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
- new Float:flFraction;
- get_tr2(0, TR_flFraction, flFraction);
- if (flFraction < 1.0) {
- get_tr2(0, TR_vecEndPos, vTraceEnd);
- get_tr2(0, TR_vecPlaneNormal, vNormal);
- }
- xs_vec_mul_scalar(vNormal, 40.0, vNormal); // do not decrease the 40.0
- xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
- if (is_player_stuck(id, vNewOrigin))
- return false;
- emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM);
- tele_effect(vOrigin);
- engfunc(EngFunc_SetOrigin, id, vNewOrigin);
- tele_effect2(vNewOrigin);
- return true;
- }
- stock is_player_stuck(id, Float:originF[3]) {
- engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
- if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
- return true;
- return false;
- }
- stock tele_effect(const Float:torigin[3]) {
- new origin[3];
- origin[0] = floatround(torigin[0]);
- origin[1] = floatround(torigin[1]);
- origin[2] = floatround(torigin[2]);
- message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
- write_byte(TE_BEAMCYLINDER);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]+10);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]+60);
- write_short(TeleportSprite);
- write_byte(0);
- write_byte(0);
- write_byte(3);
- write_byte(60);
- write_byte(0);
- write_byte(255);
- write_byte(255);
- write_byte(255);
- write_byte(255);
- write_byte(0);
- message_end();
- }
- stock tele_effect2(const Float:torigin[3]) {
- new origin[3];
- origin[0] = floatround(torigin[0]);
- origin[1] = floatround(torigin[1]);
- origin[2] = floatround(torigin[2]);
- message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
- write_byte(TE_BEAMCYLINDER);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]+10);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]+60);
- write_short(TeleportSprite);
- write_byte(0);
- write_byte(0);
- write_byte(3);
- write_byte(60);
- write_byte(0);
- write_byte(255);
- write_byte(255);
- write_byte(255);
- write_byte(255);
- write_byte(0);
- message_end();
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
- write_byte(TE_SPRITETRAIL);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]+40);
- write_coord(origin[0]);
- write_coord(origin[1]);
- write_coord(origin[2]);
- write_short(TeleportSprite2);
- write_byte(30);
- write_byte(10);
- write_byte(1);
- write_byte(50);
- write_byte(10);
- message_end();
- }
- // Suicide Explosion
- public Ultimate_SuicideExplode(id) {
- emit_sound(id, CHAN_STATIC, SOUND_SUICIDE, 1.0, ATTN_NORM, 0, PITCH_NORM);
- new parm[5], Origin[3];
- get_user_origin(id, Origin);
- parm[0] = id;
- parm[1] = 6;
- parm[2] = Origin[0];
- parm[3] = Origin[1];
- parm[4] = Origin[2];
- set_task(0.50, "SuicideExplode", TASK_EXPLOSION + id, parm, 5);
- set_task(0.50, "SuicideBlastCircles", TASK_BEAMCYLINDER + id, parm, 5);
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_IMPLOSION)
- write_coord(Origin[0]) // position(X)
- write_coord(Origin[1]) // position(Y)
- write_coord(Origin[2]) // position(Z)
- write_byte(100) // radius
- write_byte(20) // count
- write_byte(5) // life in 0.1's
- message_end()
- }
- public SuicideExplode(parm[5]) {
- new id = parm[0];
- new Origin[3];
- Origin[0] = parm[2];
- Origin[1] = parm[3];
- Origin[2] = parm[4];
- new Float:Origin2[3];
- IVecFVec(Origin, Origin2);
- message_begin(MSG_PVS, SVC_TEMPENTITY, Origin)
- write_byte(TE_EXPLOSION)
- write_coord(Origin[0]) // position(X)
- write_coord(Origin[1]) // position(Y)
- write_coord(Origin[2]) // position(Z)
- write_short(SPR_SUICIDE_EXPLODE) // sprite index
- write_byte((random_num(0,20) + 20)) // scale in 0.1's
- write_byte(12) // framerate
- write_byte(TE_EXPLFLAG_NONE) // flags
- message_end()
- message_begin(MSG_PVS, SVC_TEMPENTITY, Origin)
- write_byte(TE_SMOKE)
- write_coord(Origin[0]) // position(X)
- write_coord(Origin[1]) // position(Y)
- write_coord(Origin[2]) // position(Z)
- write_short(SPR_SUICIDE_SMOKE) // Sprite index
- write_byte(60) // scale * 10
- write_byte(10) // framerate
- message_end()
- for(new Victim = 1; Victim < get_maxplayers(); Victim++) {
- if(is_user_connected(Victim) && is_user_alive(Victim) && !get_user_godmode(Victim) && get_user_team(Victim) != get_user_team(id) && Victim != id) {
- new Float:VictimOrigin[3], Float:Distance_F, Distance;
- pev(Victim, pev_origin, VictimOrigin);
- Distance_F = get_distance_f(Origin2, VictimOrigin);
- Distance = floatround(Distance_F);
- if(Distance <= EXPLOSION_BLAST_RADIUS) {
- new Float:DistanceRatio, Float:Damage;
- DistanceRatio = floatdiv(float(Distance), EXPLOSION_BLAST_RADIUS);
- Damage = EXPLOSION_MAX_DAMAGE - floatround(floatmul(EXPLOSION_MAX_DAMAGE, DistanceRatio));
- new BloodColor = ExecuteHam(Ham_BloodColor, Victim);
- if(BloodColor != -1) {
- new Amount = floatround(Damage);
- Amount *= 2; //according to HLSDK
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
- write_byte(TE_BLOODSPRITE);
- write_coord(floatround(VictimOrigin[0]));
- write_coord(floatround(VictimOrigin[1]));
- write_coord(floatround(VictimOrigin[2]));
- write_short(BloodSpray);
- write_short(BloodDrop);
- write_byte(BloodColor);
- write_byte(min(max(3, Amount/10), 16));
- message_end();
- }
- if(parm[1] == 6)
- make_knockback(Victim, Origin2, EXPLOSION_KNOCKBACK*Damage);
- if(get_user_health(Victim) - Damage >= 1) {
- ExecuteHam(Ham_TakeDamage, Victim, id, id, Damage, DMG_BLAST);
- }
- else
- death_message(id, Victim, "Suicide Explode");
- }
- }
- }
- --parm[1];
- if(parm[1] > 0)
- set_task(0.1, "SuicideExplode", TASK_EXPLOSION + id, parm, 5);
- }
- public SuicideBlastCircles(parm[5]) {
- new Origin[3];
- Origin[0] = parm[2];
- Origin[1] = parm[3];
- Origin[2] = parm[4]-16;
- new Float:Origin2[3];
- IVecFVec(Origin, Origin2);
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin2, 0)
- write_byte(TE_BEAMCYLINDER) // TE id
- engfunc(EngFunc_WriteCoord, Origin2[0]) // x
- engfunc(EngFunc_WriteCoord, Origin2[1]) // y
- engfunc(EngFunc_WriteCoord, Origin2[2]) // z
- engfunc(EngFunc_WriteCoord, Origin2[0]) // x axis
- engfunc(EngFunc_WriteCoord, Origin2[1]) // y axis
- engfunc(EngFunc_WriteCoord, Origin2[2]+385.0) // z axis
- write_short(SPR_SUICIDE_BLAST) // sprite
- write_byte(0) // startframe
- write_byte(0) // framerate
- write_byte(4) // life
- write_byte(60) // width
- write_byte(0) // noise
- write_byte(255) // red
- write_byte(255) // green
- write_byte(255) // blue
- write_byte(200) // brightness
- write_byte(0) // speed
- message_end()
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
- write_byte(TE_DLIGHT);
- write_coord(Origin[0]); // x
- write_coord(Origin[1]); // y
- write_coord(Origin[2]); // z
- write_byte(floatround(EXPLOSION_BLAST_RADIUS/10.0)); // radius
- write_byte(255) // red
- write_byte(255) // green
- write_byte(255) // blue
- write_byte(8); // life
- write_byte(60); // decay rate
- message_end();
- }
- //------| Client Power |------//
- public Power(id) {
- if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 1 && !GodMode_DurationCooldown[id]) {
- if (GodMode_Cooldown[id]) {
- ColorChat(id,"^x03[Furien]^x04 Puterea iti va reveni in^x03 %d secunde.",GodMode_Cooldown[id]);
- return PLUGIN_CONTINUE;
- }
- set_user_godmode(id, 1);
- GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration)
- set_task(1.0, "GodModeShowHUD", id, _, _, "b");
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(get_pcvar_num(CvarGodModeDuration) != 1) {
- show_hudmessage(id, "Ai GodMode pentru: %d secunde",get_pcvar_num(CvarGodModeDuration));
- }
- if(get_pcvar_num(CvarGodModeDuration) == 1) {
- show_hudmessage(id, "Ai GodMode pentru: %d secunda",get_pcvar_num(CvarGodModeDuration));
- }
- return PLUGIN_HANDLED;
- }
- if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 2) {
- if (Teleport_Cooldown[id]) {
- ColorChat(id,"^x03[Furien]^x04 Puterea iti va reveni in^x03 %d secunde.",Teleport_Cooldown[id]);
- return PLUGIN_CONTINUE;
- }
- if (teleport(id)) {
- emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM);
- remove_task(id);
- Teleport_Cooldown[id] = get_pcvar_num(CvarTeleportCooldown);
- set_task(1.0, "TeleportShowHUD", id, _, _, "b");
- set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
- if(get_pcvar_num(CvarTeleportCooldown) != 1) {
- show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarTeleportCooldown));
- }
- if(get_pcvar_num(CvarTeleportCooldown) == 1) {
- show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarTeleportCooldown));
- }
- return PLUGIN_HANDLED;
- }
- else {
- Teleport_Cooldown[id] = 0;
- ColorChat(id, "^x03[Furien]^x04 Pozitia de teleportare este invalida.");
- return PLUGIN_HANDLED;
- }
- return 1;
- }
- return 0;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // VIP's Online |
- //==========================================================================================================
- public print_adminlist(user) {
- new adminnames[33][32];
- new message[256];
- new id, count, x, len;
- for(id = 1 ; id <= get_maxplayers() ; id++)
- if(is_user_connected(id))
- if(get_user_flags(id) & VIP)
- get_user_name(id, adminnames[count++], 31);
- len = format(message, 255, "^x04 VIP ONLINE: ");
- if(count > 0) {
- for(x = 0 ; x < count ; x++) {
- len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
- if(len > 96) {
- print_message(user, message);
- len = format(message, 255, "^x04 ");
- }
- }
- print_message(user, message);
- }
- else {
- len += format(message[len], 255-len, "No VIP online.");
- print_message(user, message);
- }
- }
- print_message(id, msg[]) {
- message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
- write_byte(id);
- write_string(msg);
- message_end();
- }
- public handle_say(id) {
- new said[192];
- read_args(said,192);
- if(contain(said, "/vips") != -1)
- set_task(0.1,"print_adminlist",id);
- return PLUGIN_CONTINUE;
- }
- stock death_message(Killer, Victim, const Weapon[]) {
- if(is_user_connected(Killer) && is_user_connected(Victim)) {
- set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET);
- ExecuteHamB(Ham_Killed, Victim, Killer, 2);
- set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT);
- make_deathmsg(Killer, Victim, 0, Weapon);
- message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"));
- write_byte(Killer); // id
- write_short(pev(Killer, pev_frags)); // frags
- write_short(cs_get_user_deaths(Killer)); // deaths
- write_short(0); // class?
- write_short(get_user_team(Killer)); // team
- message_end();
- }
- }
- public make_knockback(Victim, Float:origin[3], Float:maxspeed) {
- new Float:fVelocity[3];
- kickback(Victim, origin, maxspeed, fVelocity);
- entity_set_vector(Victim, EV_VEC_velocity, fVelocity);
- return(1);
- }
- stock kickback(ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3]) {
- new Float:fEntOrigin[3];
- entity_get_vector(ent, EV_VEC_origin, fEntOrigin);
- new Float:fDistance[3];
- fDistance[0] = fEntOrigin[0] - fOrigin[0];
- fDistance[1] = fEntOrigin[1] - fOrigin[1];
- fDistance[2] = fEntOrigin[2] - fOrigin[2];
- new Float:fTime = (vector_distance(fEntOrigin,fOrigin) / fSpeed);
- fVelocity[0] = fDistance[0] / fTime;
- fVelocity[1] = fDistance[1] / fTime;
- fVelocity[2] = fDistance[2] / fTime;
- return(fVelocity[0] && fVelocity[1] && fVelocity[2]);
- }
- 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, "!x01", "^1");
- 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[i])) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement