- reset death-ul
- viata pe hs (să rămână viața pe kill normal)
- armura pe hs (să rămână armura pe kill normal)
- banii hs (să rămână banii pe kill normal)
- speed-ul
- bullet damage
- x2 jump (să fie eliminat jumpul de tot)
Și să fie pe flagul x, nu pe t, cum este a acum.
O altă chestie, dacă-l bag cu cel de jos, adică să funcționeze două (gold/silver) nu e nici o problemă nu ? dacă schimb cvar-urile din sma.
- uvs_vips.sma | Afiseaza codul
/* Plugin generated by AMXX-Studio */ #pragma tabsize 0; // Prevenire avertizari, nu sterge... #include < amxmodx > #include < amxmisc > #include < cstrike > #include < hamsandwich > #include < fun > #include < engine > #include < fakemeta > #define PLUGIN "Ultimate Vip System" #define VERSION "1.5.2" #define CHAT_PREFIX "^4[PLAY-ARENA]:^1" enum _:Colors { NORMAL, RED, BLUE, GREY }; stock const TeamName [Colors] [ ] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }; const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90); const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE); new const Float: iCoords [ ] [ ] = { { 0.50, 0.40 }, { 0.56, 0.44 }, { 0.60, 0.50 }, { 0.56, 0.56 }, { 0.50, 0.60 }, { 0.44, 0.56 }, { 0.40, 0.50 }, { 0.44, 0.44 } }; enum { ShowMenuOnRound, HealthOnHs, ArmorOnHs, MoneyOnHs, HealthOnKill, ArmorOnKill, MoneyOnKill, HealthLimit, ArmorLimit, MoneyLimit, VipSpeed, VipMaxJumps, MaxCvars } new RMaps [ ] [ ] = { "awp_", "35hp_" } new iSize, MsgSync, RoundCount = 0, ResetDeaths [33] = 0, PlayerName [33] [32], iPosition [33], getCvars [MaxCvars], CurrentHealth, CurrentArmor, CurrentMoney, JumpNum [33], bool: DoJump [33] = false, MaxPlayers, Ham: Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame; public plugin_init ( ) { new MapName [32]; get_mapname ( MapName, charsmax ( MapName ) ); for (new i = 0; i < sizeof RMaps; i ++) { if ( containi ( MapName, RMaps ) == 0 ) { new PluginName [32]; format ( PluginName, charsmax ( PluginName ), "[Dezactivat] %s", PLUGIN ); register_plugin ( PluginName, VERSION, "EnTeR_" ); server_print ( "Pluginul ^"Ultimate Vip System^" a fost dezactivat automat !" ); pause ( "ad" ); break; } } register_plugin ( PLUGIN, VERSION, "EnTeR_" ); register_clcmd ( "say /vips", "ClCmdVipsOnline", -1 ); register_clcmd ( "say /vip", "ClCmdVipBenefits", -1 ); register_clcmd ( "say /rd", "ClCmdResetDeaths", -1 ); register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" ); register_logevent ( "leRoundStart", 2, "1=Round_Start" ); RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawn", 1 ); RegisterHam ( Ham_Player_ResetMaxSpeed, "player", "fwResetMaxSpeed", 1 ) register_event ( "DeathMsg", "evDeathMsg", "a" ); // ---- Cvar's ---- // getCvars [ShowMenuOnRound] = register_cvar ( "uvs_show_menu_on_round", "3" ); getCvars [HealthOnHs] = register_cvar ( "uvs_health_on_hs", "10" ); getCvars [ArmorOnHs] = register_cvar ( "uvs_armor_on_hs", "10" ); getCvars [MoneyOnHs] = register_cvar ( "uvs_money_on_hs", "100" ); getCvars [HealthOnKill] = register_cvar ( "uvs_health_on_kill", "5" ); getCvars [ArmorOnKill] = register_cvar ( "uvs_armor_on_kill", "5" ); getCvars [MoneyOnKill] = register_cvar ( "uvs_money_on_kill", "50" ); getCvars [HealthLimit] = register_cvar ( "uvs_health_limit", "150" ); getCvars [ArmorLimit] = register_cvar ( "uvs_armor_limit", "150" ); getCvars [MoneyLimit] = register_cvar ( "uvs_money_limit", "16000" ); getCvars [VipSpeed] = register_cvar ( "uvs_vip_speed", "270.0" ); getCvars [VipMaxJumps] = register_cvar ( "uvs_vip_jumps", "1" ); iSize = sizeof ( iCoords ); MsgSync = CreateHudSyncObj ( ); MaxPlayers = get_maxplayers ( ); set_task ( random_float ( 40.0, 60.0 ), "TaskSendMessage_01", 0, _, _, "b" ); set_task ( random_float ( 70.0, 100.0 ), "TaskSendMessage_02", 0, _, _, "b" ); } public TaskSendMessage_01 ( ) ColorChat ( 0, NORMAL, "%s Pentru mai multe detalii despre beneficiile unui^4 cont vip^1 tastati in chat^4 /vip.", CHAT_PREFIX ); public TaskSendMessage_02 ( ) ColorChat ( 0, GREY, "%s Acest server foloseste^4 UVS (ultimate vip system)^1 creat de^4 EnTeR_", CHAT_PREFIX ); public client_PreThink ( id ) { if ( IsUserVip ( id ) && is_user_alive ( id ) ) { new Float: FallSpeed = 100.0 * -1.0 new Button = get_user_button ( id ); new OldButton = get_user_oldbutton ( id ); if ( Button & IN_USE ) { new Float: Velocity [3]; entity_get_vector ( id, EV_VEC_velocity, Velocity ); if ( Velocity [2] < 0.0 ) { entity_set_int ( id, EV_INT_sequence, 3 ); entity_set_int ( id, EV_INT_gaitsequence, 1 ); entity_set_float ( id, EV_FL_frame, 1.0 ); entity_set_float ( id, EV_FL_framerate, 1.0 ); Velocity [2] = ( Velocity [2] + 40.0 < FallSpeed ) ? Velocity [2] + 40.0 : FallSpeed; entity_set_vector ( id, EV_VEC_velocity, Velocity ); } } if ( ( Button & IN_JUMP ) && !( get_entity_flags ( id ) & FL_ONGROUND ) && !( OldButton & IN_JUMP ) ) { if ( JumpNum [id] < get_pcvar_num ( getCvars [VipMaxJumps] ) ) { DoJump [id] = true; JumpNum [id] ++; } } if ( ( Button & IN_JUMP ) && ( get_entity_flags ( id ) & FL_ONGROUND ) ) { JumpNum [id] = 0; } } } public client_PostThink ( id ) { if ( IsUserVip ( id ) && is_user_alive ( id ) ) { if ( DoJump [id] ) { 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 } } } public client_damage ( iAttacker, iVictim, iDamage ) { if ( !IsUserVip ( iAttacker ) ) return; if ( ++ iPosition [iAttacker] == iSize ) iPosition [iAttacker] = 0; set_hudmessage ( 0, 40, 80, Float: iCoords [iPosition [iAttacker]] [0], Float: iCoords [iPosition [iAttacker]] [1], 0, 0.1, 2.5, 0.02, 0.02, -1 ); ShowSyncHudMsg ( iAttacker, MsgSync, "%i", iDamage ); } public client_putinserver ( id ) { get_user_name ( id, PlayerName [id], charsmax ( PlayerName [ ] ) ); if ( IsUserVip ( id ) ) { JumpNum [id] = 0; DoJump [id] = false; ColorChat ( 0, GREY, "%s^1 Jucatorul^4 %s^1 ce detine^4 cont vip,^1 s-a conectat la server.", CHAT_PREFIX, PlayerName [id] ); } } public client_disconnect ( id ) { if ( IsUserVip ( id ) ) { JumpNum [id] = 0; DoJump [id] = false; ColorChat ( 0, GREY, "%s Jucatorul^4 %s^1 ce detine^4 cont vip,^1 s-a deconectat de la server.", CHAT_PREFIX, PlayerName [id] ); } } public evNewRound ( ) { RoundCount ++; } public leRoundStart ( ) { if ( RoundCount >= get_pcvar_num ( getCvars [ShowMenuOnRound] ) ) { for( new i = 1; i <= MaxPlayers; i ++ ) { if ( IsUserVip ( i ) && is_user_connected ( i ) ) { ClCmdShowVipMenu ( i ); } } RoundCount = 0; } } public ClCmdShowVipMenu ( id ) { if ( is_user_alive ( id ) ) { new Menu = menu_create ( "\rMeniul cu arme pentru membrii vip:", "ClCmdSelectedItem" ); menu_additem ( Menu, "Kalashnikov (ak47)", "", 0 ); menu_additem ( Menu, "M4 Carabine (m4a1)", "", 0 ); menu_additem ( Menu, "Arctic warfare police (awp)", "", 0 ); menu_setprop ( Menu, MPROP_EXIT, MEXIT_NEVER ); menu_display ( id, Menu, 0 ); } } public ClCmdSelectedItem ( id, Menu, Item ) { if ( IsUserVip ( id ) && is_user_alive ( id ) ) { switch ( Item ) { case 0: { if ( get_user_weapon ( id ) != CSW_AK47 ) { DropWeapons ( id, 1 ); give_item ( id, "weapon_ak47" ); } cs_set_user_bpammo ( id, CSW_AK47, 90 ); } case 1: { if ( get_user_weapon ( id ) != CSW_M4A1 ) { DropWeapons ( id, 1 ); give_item ( id, "weapon_m4a1" ); } cs_set_user_bpammo ( id, CSW_M4A1, 90 ); } case 2: { if ( get_user_weapon ( id ) != CSW_AWP ) { DropWeapons ( id, 1 ); give_item ( id, "weapon_awp" ); } cs_set_user_bpammo ( id, CSW_AWP, 30 ); } } } } public fwPlayerSpawn ( id ) { if ( IsUserVip ( id ) && is_user_alive ( id ) ) { DropWeapons ( id, 2 ); give_item ( id, "weapon_deagle" ); cs_set_user_bpammo ( id, CSW_DEAGLE, 35 ); cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM ); give_item ( id, "weapon_hegrenade" ); give_item ( id, "weapon_flashbang" ); give_item ( id, "weapon_smokegrenade" ); cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 ); if ( cs_get_user_team ( id ) == CS_TEAM_CT ) { give_item ( id, "item_thighpack" ); } } } public ClCmdResetDeaths ( id ) { if ( IsUserVip ( id ) ) { if ( ResetDeaths [id] >= 3 ) { ColorChat ( id, GREY, "%s Ai folosit de prea multe ori comanda^4/rd,^1 o poti folosii din nou^4 harta^1 viitoare.", CHAT_PREFIX ); return; } if ( get_user_deaths ( id ) == 0 ) { ColorChat ( id, NORMAL, "%s Salut^4 %s,^1 momentan nu ai niciun deces. Scorul tau actual este ^4[%d - %d].", CHAT_PREFIX, PlayerName [id], get_user_frags ( id ), get_user_deaths ( id ) ); return; } ResetDeaths [id] ++; cs_set_user_deaths ( id, 0 ); ColorChat ( id, NORMAL, "%s Salut^4 %s,^1 ti-ai resetat decesele, scorul tau este ^4[%d - %d].", CHAT_PREFIX, PlayerName [id], get_user_frags ( id ), get_user_deaths ( id ) ); if ( ResetDeaths [id] == 1 ) { ColorChat ( id, NORMAL, "%s Ai folosit comanda^4 o data, ^1mai este disponibila de^4 doua ori.", CHAT_PREFIX ); } else if ( ResetDeaths [id] == 2 ) { ColorChat ( id, NORMAL, "%s Ai folosit comanda de^4 doua ori,^1 mai este disponibila ^4o data.", CHAT_PREFIX ); } else if ( ResetDeaths [id] == 3 ) { ColorChat ( id, NORMAL, "%s Ai folosit comanda de^4 trei ori, ^1comanda nu mai este disponibila.", CHAT_PREFIX ); } } } public evDeathMsg ( ) { new Killer = read_data ( 1 ); new Victim = read_data ( 2 ); new HS = read_data ( 3 ); if ( is_user_connected ( Victim ) ) { show_menu ( Victim, 0, "\n", 1 ); } if ( !IsUserVip ( Killer ) || Killer == Victim || !is_user_alive ( Killer ) ) return; CurrentHealth = get_user_health ( Killer ); CurrentArmor = get_user_armor ( Killer ); CurrentMoney = cs_get_user_money ( Killer ); if ( HS ) { // --- HP --- // CurrentHealth += get_pcvar_num ( getCvars [HealthOnHs] ); if ( CurrentHealth > get_pcvar_num ( getCvars [HealthLimit] ) ) CurrentHealth = get_pcvar_num ( getCvars [HealthLimit] ); set_user_health ( Killer, CurrentHealth ); // --- AP --- // CurrentArmor += get_pcvar_num ( getCvars [ArmorOnHs] ); if ( CurrentArmor > get_pcvar_num ( getCvars [ArmorLimit] ) ) CurrentArmor = get_pcvar_num ( getCvars [ArmorLimit] ); set_user_armor ( Killer, CurrentArmor ); // --- Money --- // CurrentMoney += get_pcvar_num ( getCvars [MoneyOnHs] ); if ( CurrentMoney > get_pcvar_num ( getCvars [MoneyLimit] ) ) CurrentMoney = get_pcvar_num ( getCvars [MoneyLimit] ); cs_set_user_money ( Killer, CurrentMoney ); } else { // --- HP --- // CurrentHealth += get_pcvar_num ( getCvars [HealthOnKill] ); if ( CurrentHealth > get_pcvar_num ( getCvars [HealthLimit] ) ) CurrentHealth = get_pcvar_num ( getCvars [HealthLimit] ); set_user_health ( Killer, CurrentHealth ); // --- AP --- // CurrentArmor += get_pcvar_num ( getCvars [ArmorOnKill] ); if ( CurrentArmor > get_pcvar_num ( getCvars [ArmorLimit] ) ) CurrentArmor = get_pcvar_num ( getCvars [ArmorLimit] ) set_user_armor ( Killer, CurrentArmor ); // --- Money --- // CurrentMoney += get_pcvar_num ( getCvars [MoneyOnKill] ); if ( CurrentMoney > get_pcvar_num ( getCvars [MoneyLimit] ) ) CurrentMoney = get_pcvar_num ( getCvars [MoneyLimit] ); cs_set_user_money ( Killer, CurrentMoney ); } } public fwResetMaxSpeed ( id ) { if ( is_user_alive ( id ) && IsUserVip ( id ) ) { if ( pev ( id, pev_maxspeed ) < get_pcvar_float ( getCvars [VipSpeed] ) && pev ( id, pev_maxspeed ) > 1.0 ) { set_pev ( id, pev_maxspeed, get_pcvar_float ( getCvars [VipSpeed] ) ); } } } public ClCmdVipsOnline ( id ) { new Message [256], i, Count, x, Len; for ( i = 1 ; i <= MaxPlayers; i ++ ) { if ( is_user_connected ( i ) ) { if ( IsUserVip ( i ) ) { get_user_name ( i, PlayerName [Count ++], charsmax ( PlayerName [ ] ) ); } } } Len = format ( Message, charsmax ( Message ), "%s ^1Membrii vip online:^4 ", CHAT_PREFIX ); if ( Count > 0 ) { for ( x = 0 ; x < Count ; x ++ ) { Len += format ( Message [Len], 255 - Len, "%s%s ", PlayerName [x], x < ( Count - 1 ) ? "^4,^4 " : "" ); if ( Len > 96 ) { ColorChat ( id, NORMAL, Message ); Len = format ( Message, charsmax ( Message ), "^4 " ); } } ColorChat ( id, NORMAL, Message ); } else { Len += format ( Message [Len], 255 - Len, "%s No vip's online.", CHAT_PREFIX ); ColorChat ( id, NORMAL, Message ); } } public ClCmdVipBenefits ( id ) show_motd ( id, "addons/amxmodx/configs/info_vip.html", "Beneficiile membrilor cu cont vip" ); stock DropWeapons ( id, dropwhat ) { static Weapons [32], Num, i, WeaponID; Num = 0; get_user_weapons ( id, Weapons, Num ); for ( i = 0; i < Num; i ++ ) { WeaponID = Weapons ; if ( ( dropwhat == 1 && ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM ) ) || ( dropwhat == 2 && ( ( 1 << WeaponID ) & SECONDARY_WEAPONS_BIT_SUM ) ) ) { static DropName [32], WeaponEntity; get_weaponname ( WeaponID, DropName, charsmax ( DropName ) ); WeaponEntity = fmFindEntByOwner ( -1, DropName, id ); set_pev ( WeaponEntity, pev_iuser1, cs_get_user_bpammo ( id, WeaponID ) ); engclient_cmd ( id, "drop", DropName ); cs_set_user_bpammo ( id, WeaponID, 0 ); } } } stock bool: IsUserVip ( id ) { if ( get_user_flags ( id ) & ADMIN_LEVEL_H ) return true; return false; } stock fmFindEntByOwner ( entity, const classname[], owner ) { while ( ( entity = engfunc ( EngFunc_FindEntityByString, entity, "classname", classname ) ) && pev ( entity, pev_owner ) != owner ) { } return entity; } stock ColorChat ( id, iColor = NORMAL, const Msg [ ], any:... ) { if ( id && !is_user_connected ( id ) ) return 0; if ( iColor > GREY ) iColor = NORMAL; new Message [192]; if ( iColor == NORMAL ) Message [0] = 0x04; else Message [0] = 0x03; new iParams = numargs ( ) if ( id ) { if ( iParams == 3 ) copy ( Message [1], charsmax ( Message ) -1, Msg ); else vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 ); if ( iColor ) { new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) ); SendTeamInfo ( id, id, TeamName [iColor] ); SendSayText ( id, id, Message ); SendTeamInfo ( id, id, GetTeam ); } else SendSayText ( id, id, Message ); } else { new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" ); if ( !iNum ) return 0; new iFool = iPlayers [0]; if ( iParams == 3 ) copy ( Message [1], charsmax ( Message ) -1, Msg ); else vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 ); if ( iColor ) { new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) ); SendTeamInfo ( 0, iFool, TeamName [iColor] ); SendSayText ( 0, iFool, Message); SendTeamInfo ( 0, iFool, GetTeam ); } else SendSayText ( 0, iFool, Message ); } return 1; } stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] ) { static iTeamInfo = 0; if ( !iTeamInfo ) iTeamInfo = get_user_msgid ( "TeamInfo" ); message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver ); write_byte ( iPlayerId ); write_string ( GetTeam ); message_end ( ); } stock SendSayText ( iReceiver, iPlayerId, Message [ ] ) { static iSayText = 0; if ( !iSayText ) iSayText = get_user_msgid ( "SayText" ); message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver ); write_byte ( iPlayerId ); write_string ( Message ); message_end ( ); }