- | Afiseaza codul
/*///-----------------------------------------------------------------------------------// // ----- || Furien XP System || ----- // // // // --- || Author || --- ----- || Multimuri || ----- // // -- || Truth || -- -- || Hades Ownage || -- // // -- || Argon || -- // // -- || P34nut || -- // // -- || Ulquiorra || -- // // // // --- || Cvar-uri || --- // // -- || Sunt Explicate in plugin // // // *///------------------------------------------------------------------------------------// #include < amxmodx > #include < amxmisc > #include < cstrike > #include < engine > #include < hamsandwich > #include < fakemeta_util > #include < dhudmessage > #include < nvault > #include < xs > #define PLUGIN "Furien XP System" #define VERSION "1.3.3" #define AUTHOR "Truth" #define MAX_LEVELS 30 #define ADMIN_FLAG "a" #define LEVELUP_SOUND "fxs/levelup.wav" #define CLASSUP_SOUND "fxs/classup.wav" #define TASK_SHOWHUD 2674 #define ID_SHOWHUD (TaskIndex - TASK_SHOWHUD) // -- || Variabile || -- // new const szPrefix [ ] = "[XP System]"; // -- || Comenzi new RoundGive[33], RoundTake2[33]; // -- || HUD new MesajSync; // -- || XP enum _: UserStats { XP, Level, }; new User [ 33 ] [ UserStats ]; new None[33], Phoenix[33], Agent_X[33], eXtream[33], God[33]; // -- || Power // Phoenix #define PEV_ENT_TIME pev_fuser1 new HasPower[33]; new const fire_classname_could[] = "fire_salamander"; new const fire_spr_name_cloud[] = "sprites/fxs/fire.spr"; new FireAmmo [ 33 ]; //Agent X new Inv_Cooldown[33] = 0; new Inv_DurationCooldown[33] = 0; // eXtream #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4) #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1) //Cvars new pHook, pThrowSpeed, pSpeed, pWidth, pSound, pColor; new pInterrupt, pHookSky, pOpenDoors, pPlayers; new pUseButtons, pHostage, pWeapons, pInstant, pHookNoise; new pMaxHooks, pRndStartDelay; // Sprite new sprBeam; // Players hook entity new Hook[33]; // MaxPlayers new gMaxPlayers; // some booleans new bool:gHooked[33]; new bool:canThrowHook[33]; new bool:rndStarted; // Player Spawn new bool:gRestart[33] = {false, ...}; new bool:gUpdate[33] = {false, ...}; new gHooksUsed[33]; new bool:g_bHookAllowed[33]; // God new GodMode_Cooldown[33] = 0; new GodMode_DurationCooldown[33] = 0; // -- || Constante || -- // // -- || XP new const LEVELES[ MAX_LEVELS ] = { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000 }; // -- || Cvaruri || --- // // -- || XP new KillXp, HsXp, HeXp, KnifeXp, BombXP_E, BombXP_P, BombXP_D; // -- || Level new hp, money, health, max_hp, time_hp, armor; // -- || Power new Phoenix_hp, Phoenix_ap, Phoenix_fire, agent_hp, agent_ap, eXtream_hp, eXtream_ap, God_hp, God_ap; new CvarGodModeCooldown, CvarGodModeDuration, CvarInvCooldown, CvarInvDuration; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); // -- || Register CMD register_clcmd("say /class", "ClassMenuCmd" ); register_clcmd("say_team /class", "ClassMenuCmd"); // -- || Comenzi Admin register_clcmd( "amx_give_xp", "ClCmdGiveXP" ); register_clcmd( "amx_take_xp", "ClCmdTakeXP" ); // -- || Death Event register_event("DeathMsg", "eDeath", "a"); // -- || Cvar's //XP KillXp = register_cvar("fxs_kill_xp", "5"); // -- || Cat XP da pentru kill HsXp = register_cvar("fxs_hs_xp", "20"); // -- || Cat XP da pentru hs HeXp = register_cvar("fxs_he_xp", "10"); // -- || Cat XP da cand omori cu grenada KnifeXp = register_cvar("fxs_knife_xp", "15"); // -- || Cat XP da cand omori cu cutitul BombXP_E = register_cvar("fxs_bmb_explode_xp", "100"); // -- || Cat XP da cand explodeaza bomba BombXP_P = register_cvar("fxs_bmb_plant_xp", "100"); // -- || Cat XP da cand planteaza bomba BombXP_D = register_cvar("fxs_bmb_defuse_xp", "20"); // -- || Cat XP da cand dezamorseaza bomba //Level hp = register_cvar("fxs_level_regenerator_hp", "5"); // -- || Cat HP da in X secunde [ Regenerator HP ] money = register_cvar("fxs_level_money", "1000"); // -- || Cati bani da pe fiecare level health = register_cvar("fxs_level_health", "15"); // -- || Cat HP da pe fiecare level max_hp = register_cvar("fxs_level__regenerator_max_hp", "250"); // -- || Seteaza maximul de HP pentru Regenerator time_hp = register_cvar("fxs_level_regenerator_time", "5"); // -- || Timpul pentru regenerator [ Da viata in timpul setat ] armor = register_cvar("fxs_level_armor", "10"); // -- || Cat AP da pe fiecare level // - | Class //Phoenix Phoenix_hp = register_cvar("fxs_class_phoenix_hp", "150"); // -- || Cat hp seteaza clasei Phoenix Phoenix_ap = register_cvar("fxs_class_phoenix_ap", "50"); // -- || Cat ap seteaza clasei Phoenix Phoenix_fire = register_cvar("fxs_class_phoenix_fire", "30"); // -- || Cat ammo sa aiba la fire ( Power ) //Agent agent_hp = register_cvar("fxs_class_agent_hp", "175"); // -- || Cat hp seteaza clasei Agent X agent_ap = register_cvar("fxs_class_agent_ap", "75"); // -- || Cat ap seteaza clasei Agent X CvarInvCooldown = register_cvar("fxs_class_agent_time_remain", "30"); // -- || In cat timp se incarca puterea CvarInvDuration = register_cvar("fxs_class_agent_time_power", "3"); // -- || Cat timp dureaza puterea //eXtream eXtream_hp = register_cvar("fxs_class_extream_hp", "200"); // -- || Cat hp seteaza clasei eXtream Player eXtream_ap = register_cvar("fxs_class_extream_ap", "100"); // -- || Cat ap seteaza clasei eXtream Player //God God_hp = register_cvar("fxs_class_god_hp", "255"); // -- || Cat hp seteaza clasei God God_ap = register_cvar("fxs_class_god_ap", "255"); // -- || Cat ap seteaza clasei God CvarGodModeCooldown = register_cvar("fxs_class_god_time_remain", "25"); // -- || In cat timp se incarca puterea CvarGodModeDuration = register_cvar("fxs_class_god_time_power", "5"); // -- || Cat timp dureaza puterea // Hook commands register_clcmd("+hook", "make_hook") register_clcmd("-hook", "del_hook") // Events for roundstart register_event("HLTV", "round_bstart", "a", "1=0", "2=0") register_logevent("round_estart", 2, "1=Round_Start") // Player spawn stuff register_event("TextMsg", "Restart", "a", "2=#Game_will_restart_in") register_clcmd("fullupdate", "Update") register_event("ResetHUD", "ResetHUD", "b") // Register cvars pHook = register_cvar("sv_hook", "1"); pThrowSpeed = register_cvar("sv_hookthrowspeed", "1000"); pSpeed = register_cvar("sv_hookspeed", "600"); pWidth = register_cvar("sv_hookwidth", "32"); pSound = register_cvar("sv_hooksound", "1"); pColor = register_cvar("sv_hookcolor", "1"); pPlayers = register_cvar("sv_hookplayers", "0"); pInterrupt = register_cvar("sv_hookinterrupt", "0"); pHookSky = register_cvar("sv_hooksky", "1"); pOpenDoors = register_cvar("sv_hookopendoors", "1"); pUseButtons = register_cvar("sv_hookusebuttons", "1"); pHostage = register_cvar("sv_hookhostflollow", "1"); pWeapons = register_cvar("sv_hookpickweapons", "1"); pInstant = register_cvar("sv_hookinstant", "0"); pHookNoise = register_cvar("sv_hooknoise", "0"); pMaxHooks = register_cvar("sv_hookmax", "0"); pRndStartDelay = register_cvar("sv_hookrndstartdelay", "0.0"); // Touch forward register_forward(FM_Touch, "fwTouch") // Get maxplayers gMaxPlayers = get_maxplayers() // -- || Power register_clcmd("power", "PowerCmd"); register_touch(fire_classname_could, "*", "fw_touch_fire"); register_think(fire_classname_could, "fw_think_fire"); RegisterHam(Ham_Spawn, "player", "Spawn", true ); static id; for ( id = 1; id <= get_maxplayers ( ); id++ ) { ClassFalse(id); None[id] = true; } MesajSync = CreateHudSyncObj(); } // ------------------------ || Plugin Precache || ------------------------ // public plugin_precache() { // Sounds precache_sound( LEVELUP_SOUND ); precache_sound( CLASSUP_SOUND ); //Fire precache_model(fire_spr_name_cloud); precache_sound ( "fxs/flamegun-2.wav" ); // Hook // Hook Model engfunc(EngFunc_PrecacheModel, "models/fxs/rpgrocket.mdl") // Hook Beam sprBeam = engfunc(EngFunc_PrecacheModel, "sprites/fxs/zbeam4.spr") // Hook Sounds engfunc(EngFunc_PrecacheSound, "fxs/xbow_hit1.wav") // good hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_hit2.wav") // wrong hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_hitbod1.wav") // player hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_fire1.wav") // deploy } // ------------------------ || Plugin Native || ------------------------ // public plugin_natives() { register_native ( "set_user_xp", "set_user_xp", 1 ); register_native ( "set_user_level", "set_user_level", 1 ); register_native ( "get_user_xp", "get_user_xp", 1 ); register_native ( "get_user_level", "get_user_level", 1 ); } public set_user_xp ( id, xp ) User [ id ] [ XP ] = xp; public set_user_level ( id, level ) User [ id ] [ Level ] = level; public get_user_xp ( id ) return User [ id ] [ XP ]; public get_user_level ( id ) return User [ id ] [ Level ]; // ------------------------ || Client Connect || ------------------------ // public client_putinserver(id) { LoadData(id); RefreshLevel ( id ); set_task(1.0, "MesajHUD", id+TASK_SHOWHUD, .flags = "b"); } // ------------------------ || Client Disconnect || ------------------------ // public client_disconnect(id) { SaveData(id); } // ------------------------ || Spawn || ------------------------ // public Spawn( id ) { HasPower[ id ] = false; RoundGive[ id ] = false; RoundTake2[ id ] = false; if ( Phoenix [ id ] ) { FireAmmo [ id ] = get_pcvar_num(Phoenix_fire); fm_set_user_health(id, get_pcvar_num(Phoenix_hp) ); fm_set_user_armor(id, get_pcvar_num(Phoenix_ap) ); } if(Agent_X[id]) { fm_set_user_health(id, get_pcvar_num(agent_hp) ); fm_set_user_armor(id, get_pcvar_num(agent_ap) ); } if(eXtream[id]) { fm_set_user_health(id, get_pcvar_num(eXtream_hp) ); fm_set_user_armor(id, get_pcvar_num(eXtream_ap) ); g_bHookAllowed[id] = true; } if(God[id]) { fm_set_user_health(id, get_pcvar_num(God_hp) ); fm_set_user_armor(id, get_pcvar_num(God_ap) ); } } // ------------------------ || Comenzi Admin || ------------------------ // public ClCmdGiveXP( id ) { if( !( get_user_flags( id ) & read_flags( ADMIN_FLAG ) ) ) { client_cmd( id, "echo NU ai acces la aceasta comanda!" ); return 1; } if( RoundGive[ id ] ) { client_cmd( id, "echo Ai dat odata XP pe aceasta runda!" ); return 1; } new szFirstArg[ 32 ], szSecondArg[ 10 ]; read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 ); read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 ); if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) ) { client_cmd( id, "echo amx_give_xp < nume/ @ALL/ @T/ @CT > < xp >" ); return 1; } new iPlayers[ 32 ]; new iPlayersNum; new iXP = str_to_num( szSecondArg ); if( iXP <= 0 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mare decat 0!" ); return 1; } if( iXP > 1000 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mica decat 1000!" ); return 1; } if( szFirstArg[ 0 ] == '@' ) { switch ( szFirstArg[ 1 ] ) { case 'A': { if( equal( szFirstArg, "@ALL" ) ) { get_players( iPlayers, iPlayersNum, "ch" ); for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP tuturor jucatorilor!", szPrefix, szName, iXP ); return 1; } } case 'T': { if( equal( szFirstArg, "@T" ) ) { get_players( iPlayers, iPlayersNum, "ceh", "TERRORIST" ); if( iPlayersNum == 0 ) { client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa!" ); return 1; } for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP jucatorilor de la^x03 TERO^x01!", szPrefix, szName, iXP ); return 1; } } case 'C': { if( equal( szFirstArg, "@CT" ) ) { get_players( iPlayers, iPlayersNum, "ceh", "CT" ); if( iPlayersNum == 0 ) { client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa!" ); return 1; } for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP jucatorilor de la^x03 CT^x01!", szPrefix, szName, iXP ); return 1; } } } } new iPlayer = cmd_target( id, szFirstArg, 8 ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg ); return 1; } if(User[ iPlayer ] [XP] == 3000) { client_cmd( id, "echo Valoare XP-ul a atins limita!" ); return 1; } User[iPlayer] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayer] [XP] / 100; LevelGive = LevelGive2; User [ iPlayer ] [ Level ] = LevelGive; RoundGive[ iPlayer ] = true; SaveData( iPlayer ); RefreshLevel ( iPlayer ); new szName[ 32 ], _szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 ); ColorChat( 0, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 XP lui^x03 %s^x01.", szPrefix, szName, iXP, _szName ); return 1; } public ClCmdTakeXP( id ) { if( !( get_user_flags( id ) & read_flags( ADMIN_FLAG ) ) ) { client_cmd( id, "echo NU ai acces la aceasta comanda!" ); return 1; } if( RoundTake2[ id ] ) { client_cmd( id, "echo Ai luat odata XP pe aceasta runda!" ); return 1; } new szFirstArg[ 32 ], szSecondArg[ 10 ]; read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 ); read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 ); if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) ) { client_cmd( id, "echo amx_take_xp < nume > < xp >" ); return 1; } new iXP = str_to_num( szSecondArg ); if( iXP <= 0 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mare decat 0!" ); return 1; } if( iXP > 1000 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mica decat 1000!" ); return 1; } new iPlayer = cmd_target( id, szFirstArg, 8 ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg ); return 1; } if( User[iPlayer] [XP] < iXP ) { client_cmd( id, "echo Jucatorul %s nu are atata XP!Are doar %i", szFirstArg, User[iPlayer] [XP] ); return 1; } RoundTake2[id] = true; new LevelTake, LevelTake2; User[iPlayer] [XP] -= iXP; LevelTake2 = User[iPlayer] [XP] / 100; LevelTake = LevelTake2; User [ iPlayer ] [ Level ] = LevelTake; SaveData( iPlayer ); RefreshLevel ( iPlayer ); new szName[ 32 ], _szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 ); ColorChat( 0, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 XP-ul lui^x03 %s^x01.", szPrefix, szName, iXP, _szName ); return 1; } // ------------------------ || Clase CMD || ------------------------ // public ClassMenuCmd ( id ) { if(HasPower[id]) { ColorChat(id, "^x04%s^x01 Ai ales clasa pe runda aceasta.", szPrefix); return 1; } new Title[101]; formatex(Title, 100, "\y Meniul de Clase"); new ClaseMenu = menu_create(Title, "give_class"); if(User [ id ] [ Level ] >= 5) { menu_additem(ClaseMenu, "\yPhoenix - \r Level 5", "1", 0); } else { menu_additem(ClaseMenu, "\dPhoenix - Level 5", "1", 0); } if(User [ id ] [ Level ] >= 10) { menu_additem(ClaseMenu, "\yAgent X - \r Level 10", "1", 0); } else { menu_additem(ClaseMenu, "\dAgent X - Level 10", "1", 0); } if(User [ id ] [ Level ] >= 20) { menu_additem(ClaseMenu, "\yeXtream Player - \r Level 20", "1", 0); } else { menu_additem(ClaseMenu, "\deXtream Player - Level 20", "1", 0); } if(User [ id ] [ Level ] >= 30) { menu_additem(ClaseMenu, "\yGod - \r Level 30", "1", 0); } else { menu_additem(ClaseMenu, "\dGod - Level 30", "1", 0); } menu_setprop(ClaseMenu, MPROP_EXIT, MEXIT_ALL ); menu_display(id, ClaseMenu, 0); return 1; } public give_class ( id, ClaseMenu, item ) { if(item == MENU_EXIT) { return 1; } switch( item ) { case 0: { if(User [ id ] [ Level ] >= 5) { ClassFalse(id); Phoenix[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(Phoenix_hp) ); fm_set_user_armor(id, get_pcvar_num(Phoenix_ap) ); FireAmmo [ id ] = get_pcvar_num(Phoenix_fire); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 5 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 1: { if(User [ id ] [ Level ] >= 10) { ClassFalse(id); Agent_X[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(agent_hp) ); fm_set_user_armor(id, get_pcvar_num(agent_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 10 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 2: { if(User [ id ] [ Level ] >= 20) { ClassFalse(id); eXtream[id] = true; HasPower[id] = true; g_bHookAllowed[id] = true; fm_set_user_health(id, get_pcvar_num(eXtream_hp) ); fm_set_user_armor(id, get_pcvar_num(eXtream_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 20 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 3: { if(User [ id ] [ Level ] >= 30) { ClassFalse(id); God[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(God_hp) ); fm_set_user_armor(id, get_pcvar_num(God_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 30 !", szPrefix ); ClassMenuCmd(id); return 1; } } } menu_destroy(ClaseMenu); return 1; } // ------------------------ || SaveData & LoadData || ------------------------ // public SaveData(id) { new Nvault = nvault_open("FurienXPSystem"); new szName [ 32 ]; get_user_name ( id, szName, 31 ); new vaultkey[64],vaultdata[256]; format(vaultkey,63,"%s-Mod", szName); format(vaultdata,255,"%i#%i#",User [ id ] [ XP ], User [ id ] [ Level ]); nvault_set(Nvault,vaultkey,vaultdata); return PLUGIN_CONTINUE; } public LoadData(id) { new Nvault = nvault_open("FurienXPSystem"); new szName [ 32 ]; get_user_name ( id, szName, 31 ); new vaultkey[64],vaultdata[256]; format(vaultkey,63,"%s-Mod",szName); format(vaultdata,255,"%i#%i#", User [ id ] [ XP ], User [ id ] [ Level ]); nvault_get(Nvault,vaultkey,vaultdata,255); replace_all(vaultdata, 255, "#", " "); new xp[32], level[32]; parse(vaultdata, xp, 31, level, 31); User [ id ] [ XP ] = str_to_num(xp); User [ id ] [ Level ] = str_to_num(level); return PLUGIN_CONTINUE; } // ------------------------ || Show HUD || ------------------------ // public MesajHUD(TaskIndex) { static id; id = ID_SHOWHUD; if (!is_user_alive(id)) { id = pev(id, pev_iuser2); if(!is_user_alive(id)) return; } if(id != ID_SHOWHUD) { new nume[32]; get_user_name(id, nume, 31); if(None[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: None", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(Phoenix[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: Phoenix", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(Agent_X[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: Agent X", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(eXtream[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: eXtream Player", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(God[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: God", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } } else { if(None[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: None", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(Phoenix[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: Phoenix", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(Agent_X[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: Agent X", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(eXtream[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: eXtream Player", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(God[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: God", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } } } // ------------------------ || Death XP || ------------------------ // public eDeath( ) { new Killer = read_data( 1 ); new HS = read_data( 3 ); new Weapon = get_user_weapon( Killer ); if(!(User [ Killer ] [ Level ] == 30)) { User [ Killer ] [ XP ] += get_pcvar_num( KillXp ); if(HS) User [ Killer ] [ XP ] += get_pcvar_num( HsXp ); if(Weapon == CSW_KNIFE) User [ Killer ] [ XP ] += get_pcvar_num( KnifeXp ); if(Weapon == CSW_HEGRENADE) User [ Killer ] [ XP ] += get_pcvar_num( HeXp ); SaveData( Killer ); RefreshLevel ( Killer ); } else { return 1; } return 1; } // ------------------------ || Bomb XP || ------------------------ // public bomb_planted(id){ if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_P ); SaveData( id ); RefreshLevel ( id ); } else { return 1; } return 1; } public bomb_explode(id){ if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_E ); SaveData( id ); RefreshLevel ( id ); } else { return 1; } return 1; } public bomb_defused(id){ if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_D ); SaveData( id ); RefreshLevel ( id ); } else { return 1; } return 1; } public RefreshLevel ( id ) { if ( User [ id ] [ Level ] < MAX_LEVELS ) { while ( User [ id ] [ XP ] >= LEVELES [ User [ id ] [ Level ] ] ) { User [ id ] [ Level ] += 1; if(User [ id ] [ Level ] == 30) { User [ id ] [ XP ] = 3000; return 1; } if(RoundGive[ id ]) return 1; if(RoundTake2[ id ]) return 1; ColorChat(id, "^x04%s^x01 Felicitari! Acum ai level^x04 %d^x01 !", szPrefix, User [ id ] [ Level ] ); if(User[ id ] [ Level ] == 5) { ClassFalse(id); Phoenix[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa Pheonix !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 Phoenix^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 10) { ClassFalse(id); Agent_X[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa Agent X !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 Agent X^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 20) { ClassFalse(id); eXtream[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa eXtream Player !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 eXtream Player^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 30) { ClassFalse(id); God[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa God !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 God^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 5 || User[ id ] [ Level ] == 10 || User[ id ] [ Level ] == 20 || User[ id ] [ Level ] == 30 ) { return 1; } else { client_cmd ( id, "spk ^"%s^"", LEVELUP_SOUND ); } if(User [ id ] [ Level ] < 5) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); } else if (User [ id ] [ Level ] < 10) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); } else if ( User [ id ] [ Level ] < 20 ) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_smokegrenade"); fm_give_item(id, "weapon_flashbang"); } else if ( User [ id ] [ Level ] < 30 ) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_smokegrenade"); fm_give_item(id, "weapon_flashbang"); set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); } } } else { if(User [ id ] [ Level ] == 30) { User [ id ] [ XP ] = 3000; return 1; } return 1; } return 1; } // --------------------------------- ||| Regenator HP ||| --------------------------------- // public RegeneratorHP ( id ) { new Health = get_user_health(id); if(Health >= get_pcvar_num( max_hp )) { set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); return 1; } else { fm_set_user_health(id, Health + get_pcvar_num( hp ) ); set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); } return 1; } // --------------------------------- ||| Power ||| --------------------------------- // public PowerCmd ( id ) { if ( Phoenix [ id ] && is_user_alive(id) ) { cloudfire ( id ); } if(Agent_X[id] && !Inv_DurationCooldown[id] && is_user_alive(id)) { if (Inv_Cooldown[id]) { ColorChat(id,"^x03%s^x04 Puterea iti va reveni in^x03 %d secunde.", szPrefix,Inv_Cooldown[id]); return PLUGIN_CONTINUE; } set_entity_visibility(id, 0); Inv_DurationCooldown[id] = get_pcvar_num(CvarInvDuration) set_task(1.0, "InvShowHUD", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(get_pcvar_num(CvarInvDuration) != 1) { show_hudmessage(id, "Esti invizibil pentru: %d secunde",get_pcvar_num(CvarInvDuration)); } if(get_pcvar_num(CvarInvDuration) == 1) { show_hudmessage(id, "Esti invizibil pentru: %d secunda",get_pcvar_num(CvarInvDuration)); } return PLUGIN_HANDLED; } if(God[id] && !GodMode_DurationCooldown[id] && is_user_alive(id)) { if (GodMode_Cooldown[id]) { ColorChat(id, "^x03%s^x04 Puterea iti va reveni in^x03 %d secunde.", szPrefix,GodMode_Cooldown[id]); return PLUGIN_CONTINUE; } fm_set_user_godmode(id, 1); GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration) set_task(1.0, "GodModeShowHUD", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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; } return 1; } // --------------------------------- ||| Class Phoenix | Fire Power ||| --------------------------------- // public cloudfire(id) { set_hudmessage(0, 170, 255, 0.02, 0.87, 0, 6.0, 1.0) show_hudmessage(id, "Ammo: %d", FireAmmo [ id ]) if ( FireAmmo [ id ] > 0 ) { new iEnt = create_entity("env_sprite") new Float:vfVelocity[3] velocity_by_aim(id, 500, vfVelocity) xs_vec_mul_scalar(vfVelocity, 0.4, vfVelocity) // add velocity of Owner for ent new Float:fOwnerVel[3], Float:vfAttack[3], Float:vfAngle[3] pev(id, pev_angles, vfAngle) //pev(id, pev_origin, vfAttack) get_weapon_attackment(id, vfAttack, 20.0) vfAttack[2] -= 7.0 //vfAttack[1] += 7.0 pev(id, pev_velocity, fOwnerVel) fOwnerVel[2] = 0.0 xs_vec_add(vfVelocity, fOwnerVel, vfVelocity) // set info for ent set_pev(iEnt, pev_movetype, MOVETYPE_FLY) set_pev(iEnt, pev_rendermode, kRenderTransAdd) set_pev(iEnt, pev_renderamt, 150.0) set_pev(iEnt, PEV_ENT_TIME, get_gametime() + 1.5) // time remove set_pev(iEnt, pev_scale, 0.2) set_pev(iEnt, pev_nextthink, halflife_time() + 0.05) set_pev(iEnt, pev_classname, fire_classname_could) engfunc(EngFunc_SetModel, iEnt, fire_spr_name_cloud) set_pev(iEnt, pev_mins, Float:{-1.0, -1.0, -1.0}) set_pev(iEnt, pev_maxs, Float:{1.0, 1.0, 1.0}) set_pev(iEnt, pev_origin, vfAttack) set_pev(iEnt, pev_gravity, 0.01) set_pev(iEnt, pev_velocity, vfVelocity) vfAngle[1] += 30.0 set_pev(iEnt, pev_angles, vfAngle) set_pev(iEnt, pev_solid, SOLID_BBOX) set_pev(iEnt, pev_owner, id) set_pev(iEnt, pev_iuser2, 1) emit_sound(id, CHAN_WEAPON, "weapons/flamegun-2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) --FireAmmo [ id ]; } else { set_hudmessage(0, 170, 255, -1.0, 0.13, 0, 6.0, 2.0) show_hudmessage(id, "No ammo !") return 1; } return 0; } public fw_think_fire(iEnt) { if ( !pev_valid(iEnt) ) return; new Float:fFrame, Float:fScale, Float:fNextThink pev(iEnt, pev_frame, fFrame) pev(iEnt, pev_scale, fScale) // effect exp new iMoveType = pev(iEnt, pev_movetype) if (iMoveType == MOVETYPE_NONE) { fNextThink = 0.015 fFrame += 1.0 if (fFrame > 21.0) { engfunc(EngFunc_RemoveEntity, iEnt) return } } // effect normal else { fNextThink = 0.045 fFrame += 1.0 fFrame = floatmin(21.0, fFrame) } fScale = (entity_range(iEnt, pev(iEnt, pev_owner)) / 500) * 3.0 set_pev(iEnt, pev_frame, fFrame) set_pev(iEnt, pev_scale, fScale) set_pev(iEnt, pev_nextthink, halflife_time() + fNextThink) // time remove new Float:fTimeRemove pev(iEnt, PEV_ENT_TIME, fTimeRemove) if (get_gametime() >= fTimeRemove) { engfunc(EngFunc_RemoveEntity, iEnt) return; } } public fw_touch_fire(ent, id) { set_pev(ent, pev_movetype, MOVETYPE_NONE) set_pev(ent, pev_solid, SOLID_NOT) if(!is_valid_ent(id)) return FMRES_IGNORED if(!is_user_alive(id) || !is_user_connected(id) ) return FMRES_IGNORED if(pev(ent, pev_iuser2) == 1) { set_pev(ent, pev_iuser2, 0) static attacker, ent_kill attacker = pev(ent, pev_owner) ent_kill = fm_get_user_weapon_entity(id, CSW_KNIFE) ExecuteHam(Ham_TakeDamage, id, ent_kill, attacker, random_float(70.0, 100.0), DMG_BULLET) } return FMRES_HANDLED } // --------------------------------- ||| Class Agent X | Invizibility Power ||| --------------------------------- // public InvShowHUD(id) { if (!is_user_alive(id) || !Agent_X[id]) { remove_task(id); Inv_DurationCooldown[id] = 0; fm_set_user_godmode(id, 0); return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(is_user_alive(id) && Inv_DurationCooldown[id] == 1) { Inv_DurationCooldown[id] --; show_hudmessage(id, "Esti invizibil pentru: %d secunda",Inv_DurationCooldown[id]); } if(is_user_alive(id) && Inv_DurationCooldown[id] > 1) { Inv_DurationCooldown[id] --; show_hudmessage(id, "Esti invizibil pentru: %d secunde",Inv_DurationCooldown[id]); } if(Inv_DurationCooldown[id] <= 0) { show_hudmessage(id, "Nu mai ai GodMode"); ColorChat(id, "^x03%s^x04 Nu mai esti invizibil.", szPrefix); remove_task(id); set_entity_visibility(id, 1); Inv_DurationCooldown[id] = 0; Inv_Cooldown[id] = get_pcvar_num(CvarInvCooldown); set_task(1.0, "InvShowHUD2", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(get_pcvar_num(CvarInvCooldown) != 1) { show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarInvCooldown)); } if(get_pcvar_num(CvarInvCooldown) == 1) { show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarInvCooldown)); } return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public InvShowHUD2(id) { if (!is_user_alive(id) || !Agent_X[id]) { remove_task(id); Inv_Cooldown[id] = 0; return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(is_user_alive(id) && Inv_Cooldown[id] == 1) { Inv_Cooldown[id] --; show_hudmessage(id, "Puterea iti va reveni in: %d secunda",Inv_Cooldown[id]); } if(is_user_alive(id) && Inv_Cooldown[id] > 1) { Inv_Cooldown[id] --; show_hudmessage(id, "Puterea iti va reveni in: %d secunde",Inv_Cooldown[id]); } if(Inv_Cooldown[id] <= 0) { show_hudmessage(id, "Ti-a revenit puterea"); ColorChat(id, "^x03%s^x04 Iti poti folosi din nou puterea.", szPrefix); remove_task(id); Inv_Cooldown[id] = 0; } return PLUGIN_HANDLED; } // --------------------------------- ||| Class eXtream | Hook Power ||| --------------------------------- // public make_hook(id) { if(!eXtream[id]) return 1; if (get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) { new iMaxHooks = get_pcvar_num(pMaxHooks) if (iMaxHooks > 0) { if (gHooksUsed[id] >= iMaxHooks) { client_print(id, print_chat, "[Hook] You already used your maximum ammount of hooks") statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) return PLUGIN_HANDLED } else { gHooksUsed[id]++ statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) } } new Float:fDelay = get_pcvar_float(pRndStartDelay) if (fDelay > 0 && !rndStarted) client_print(id, print_chat, "[Hook] You cannot use the hook in the first %0.0f seconds of the round", fDelay) throw_hook(id) } return PLUGIN_HANDLED } public del_hook(id) { if(!eXtream[id]) return 1; // Remove players hook if (!canThrowHook[id]) remove_hook(id) return PLUGIN_HANDLED } public round_bstart() { // Round is not started anymore if (rndStarted) rndStarted = false // Remove all hooks for (new i = 1; i <= gMaxPlayers; i++) { if (is_user_connected(i)) { if(!canThrowHook) remove_hook(i) } } } public round_estart() { new Float:fDelay = get_pcvar_float(pRndStartDelay) if (fDelay > 0.0) set_task(fDelay, "rndStartDelay") else { // Round is started... if (!rndStarted) rndStarted = true } } public rndStartDelay() { if (!rndStarted) rndStarted = true } public Restart() { for (new id = 0; id < gMaxPlayers; id++) { if (is_user_connected(id)) gRestart[id] = true } } public Update(id) { if (!gUpdate[id]) gUpdate[id] = true return PLUGIN_CONTINUE } public ResetHUD(id) { if (gRestart[id]) { gRestart[id] = false return } if (gUpdate[id]) { gUpdate[id] = false return } if (gHooked[id]) { remove_hook(id) } if (get_pcvar_num(pMaxHooks) > 0) { gHooksUsed[id] = 0 statusMsg(0, "[Hook] 0 of %d hooks used.", get_pcvar_num(pMaxHooks)) } } public fwTouch(pentru, ptd) { if (!pev_valid(pentru)) return FMRES_IGNORED new id = pev(pentru, pev_owner) // Get classname static szPtrClass[32] pev(pentru, pev_classname, szPtrClass, charsmax(szPtrClass)) if (equali(szPtrClass, "Hook")) { static Float:fOrigin[3] pev(pentru, pev_origin, fOrigin) if (pev_valid(ptd)) { static szPtdClass[32] pev(ptd, pev_classname, szPtdClass, charsmax(szPtdClass)) if (!get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd)) { // Hit a player if (get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) return FMRES_HANDLED } else if (equali(szPtdClass, "hostage_entity")) { // Makes an hostage follow if (get_pcvar_num(pHostage) && get_user_team(id) == 2) { //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id) // With the use function we have the sounds! dllfunc(DLLFunc_Use, ptd, id) } if (!get_pcvar_num(pPlayers)) { if(get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) } return FMRES_HANDLED } else if (get_pcvar_num(pOpenDoors) && equali(szPtdClass, "func_door") || equali(szPtdClass, "func_door_rotating")) { // Open doors // Double doors tested in de_nuke and de_wallmart static szTargetName[32] pev(ptd, pev_targetname, szTargetName, charsmax(szTargetName)) if (strlen(szTargetName) > 0) { static ent while ((ent = engfunc(EngFunc_FindEntityByString, ent, "target", szTargetName)) > 0) { static szEntClass[32] pev(ent, pev_classname, szEntClass, charsmax(szEntClass)) if (equali(szEntClass, "trigger_multiple")) { dllfunc(DLLFunc_Touch, ent, id) goto stopdoors // No need to touch anymore } } } // No double doors.. just touch it dllfunc(DLLFunc_Touch, ptd, id) stopdoors: } else if (get_pcvar_num(pUseButtons) && equali(szPtdClass, "func_button")) { if (pev(ptd, pev_spawnflags) & SF_BUTTON_TOUCH_ONLY) dllfunc(DLLFunc_Touch, ptd, id) // Touch only else dllfunc(DLLFunc_Use, ptd, id) // Use Buttons } } // If cvar sv_hooksky is 0 and hook is in the sky remove it! new iContents = engfunc(EngFunc_PointContents, fOrigin) if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY) { if(get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) return FMRES_HANDLED } // Pick up weapons.. if (get_pcvar_num(pWeapons)) { static ent while ((ent = engfunc(EngFunc_FindEntityInSphere, ent, fOrigin, 15.0)) > 0) { static szentClass[32] pev(ent, pev_classname, szentClass, charsmax(szentClass)) if (equali(szentClass, "weaponbox") || equali(szentClass, "armoury_entity")) dllfunc(DLLFunc_Touch, ent, id) } } // Player is now hooked gHooked[id] = true // Play sound if (get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) // Make some sparks :D message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0) write_byte(9) // TE_SPARKS write_coord_f(fOrigin[0]) // Origin write_coord_f(fOrigin[1]) write_coord_f(fOrigin[2]) message_end() // Stop the hook from moving set_pev(pentru, pev_velocity, Float:{0.0, 0.0, 0.0}) set_pev(pentru, pev_movetype, MOVETYPE_NONE) //Task if (!task_exists(id + 856)) { static TaskData[2] TaskData[0] = id TaskData[1] = pentru gotohook(TaskData) set_task(0.1, "gotohook", id + 856, TaskData, 2, "b") } } return FMRES_HANDLED } public hookthink(param[]) { new id = param[0] new HookEnt = param[1] if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) { remove_task(id + 890) return PLUGIN_HANDLED } static Float:entOrigin[3] pev(HookEnt, pev_origin, entOrigin) // If user is behind a box or something.. remove it // only works if sv_interrupt 1 or higher is if (get_pcvar_num(pInterrupt) && rndStarted) { static Float:usrOrigin[3] pev(id, pev_origin, usrOrigin) static tr engfunc(EngFunc_TraceLine, usrOrigin, entOrigin, 1, -1, tr) static Float:fFraction get_tr2(tr, TR_flFraction, fFraction) if (fFraction != 1.0) remove_hook(id) } // If cvar sv_hooksky is 0 and hook is in the sky remove it! new iContents = engfunc(EngFunc_PointContents, entOrigin) if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY) { if(get_pcvar_num(pSound)) emit_sound(HookEnt, CHAN_STATIC, "fxs/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) } return PLUGIN_HANDLED } public gotohook(param[]) { new id = param[0] new HookEnt = param[1] if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) { remove_task(id + 856) return PLUGIN_HANDLED } // If the round isnt started velocity is just 0 static Float:fVelocity[3] fVelocity = Float:{0.0, 0.0, 1.0} // If the round is started and player is hooked we can set the user velocity! if (rndStarted && gHooked[id]) { static Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist pev(HookEnt, pev_origin, fHookOrigin) pev(id, pev_origin, fUsrOrigin) fDist = vector_distance(fHookOrigin, fUsrOrigin) if (fDist >= 30.0) { new Float:fSpeed = get_pcvar_float(pSpeed) fSpeed *= 0.52 fVelocity[0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 * fSpeed) / fDist fVelocity[1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 * fSpeed) / fDist fVelocity[2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 * fSpeed) / fDist } } // Set the velocity set_pev(id, pev_velocity, fVelocity) return PLUGIN_HANDLED } public throw_hook(id) { // Get origin and angle for the hook static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3] static Float:fStart[3] pev(id, pev_origin, fOrigin) pev(id, pev_angles, fAngle) pev(id, pev_v_angle, fvAngle) if (get_pcvar_num(pInstant)) { get_user_hitpoint(id, fStart) if (engfunc(EngFunc_PointContents, fStart) != CONTENTS_SKY) { static Float:fSize[3] pev(id, pev_size, fSize) fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 + fSize[0]) fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 + fSize[1]) fOrigin[2] = fStart[2] } else xs_vec_copy(fStart, fOrigin) } // Make the hook! Hook[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) if (Hook[id]) { // Player cant throw hook now canThrowHook[id] = false static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000} static const Float:fMaxs[3] = {2.840000, 0.020000, 2.840000} //Set some Data set_pev(Hook[id], pev_classname, "Hook") engfunc(EngFunc_SetModel, Hook[id], "models/fxs/rpgrocket.mdl") engfunc(EngFunc_SetOrigin, Hook[id], fOrigin) engfunc(EngFunc_SetSize, Hook[id], fMins, fMaxs) //set_pev(Hook[id], pev_mins, fMins) //set_pev(Hook[id], pev_maxs, fMaxs) set_pev(Hook[id], pev_angles, fAngle) set_pev(Hook[id], pev_solid, 2) set_pev(Hook[id], pev_movetype, 5) set_pev(Hook[id], pev_owner, id) //Set hook velocity static Float:fForward[3], Float:Velocity[3] new Float:fSpeed = get_pcvar_float(pThrowSpeed) engfunc(EngFunc_MakeVectors, fvAngle) global_get(glb_v_forward, fForward) Velocity[0] = fForward[0] * fSpeed Velocity[1] = fForward[1] * fSpeed Velocity[2] = fForward[2] * fSpeed set_pev(Hook[id], pev_velocity, Velocity) // Make the line between Hook and Player message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, Float:{0.0, 0.0, 0.0}, 0) if (get_pcvar_num(pInstant)) { write_byte(1) // TE_BEAMPOINT write_short(id) // Startent write_coord_f(fStart[0]) // End pos write_coord_f(fStart[1]) write_coord_f(fStart[2]) } else { write_byte(8) // TE_BEAMENTS write_short(id) // Start Ent write_short(Hook[id]) // End Ent } write_short(sprBeam) // Sprite write_byte(1) // StartFrame write_byte(1) // FrameRate write_byte(600) // Life write_byte(get_pcvar_num(pWidth)) // Width write_byte(get_pcvar_num(pHookNoise)) // Noise // Colors now if (get_pcvar_num(pColor)) { if (get_user_team(id) == 1) { // Terrorist write_byte(255) // R write_byte(0) // G write_byte(0) // B } else if(get_user_team(id) == 2) { // CT write_byte(0) // R write_byte(0) // G write_byte(255) // B } else { write_byte(255) // R write_byte(255) // G write_byte(255) // B } } else { write_byte(255) // R write_byte(255) // G write_byte(255) // B } write_byte(192) // Brightness write_byte(0) // Scroll speed message_end() if (get_pcvar_num(pSound) && !get_pcvar_num(pInstant)) emit_sound(id, CHAN_BODY, "fxs/xbow_fire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_HIGH) static TaskData[2] TaskData[0] = id TaskData[1] = Hook[id] set_task(0.1, "hookthink", id + 890, TaskData, 2, "b") } else client_print(id, print_chat, "Can't create hook") } public remove_hook(id) { //Player can now throw hooks canThrowHook[id] = true // Remove the hook if it is valid if (pev_valid(Hook[id])) engfunc(EngFunc_RemoveEntity, Hook[id]) Hook[id] = 0 // Remove the line between user and hook if (is_user_connected(id)) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY, {0,0,0}, id) write_byte(99) // TE_KILLBEAM write_short(id) // entity message_end() } // Player is not hooked anymore gHooked[id] = false return 1 } // --------------------------------- ||| Class God | God Mode Power ||| --------------------------------- // public GodModeShowHUD(id) { if (!is_user_alive(id) || !God[id]) { remove_task(id); GodMode_DurationCooldown[id] = 0; fm_set_user_godmode(id, 0); return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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%s^x04 Nu mai ai GodMode.", szPrefix); remove_task(id); fm_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(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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) || !God[id]) { remove_task(id); GodMode_Cooldown[id] = 0; return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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%s^x04 Iti poti folosi din nou puterea.", szPrefix); remove_task(id); GodMode_Cooldown[id] = 0; } return PLUGIN_HANDLED; } // --------------------------------- ||| Stock-uri ||| --------------------------------- // // ------------------------ || Color Chat || ------------------------ // 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)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players); write_byte(players); write_string(msg); message_end(); } } } } stock ClassFalse( id ) { None[id] = false; Phoenix[id] = false; Agent_X[id] = false; eXtream[id] = false; God[id] = false; } stock get_weapon_attackment(id, Float:output[3], Float:fDis = 40.0) { new Float:vfEnd[3], viEnd[3] get_user_origin(id, viEnd, 3) IVecFVec(viEnd, vfEnd) new Float:fOrigin[3], Float:fAngle[3] pev(id, pev_origin, fOrigin) pev(id, pev_view_ofs, fAngle) xs_vec_add(fOrigin, fAngle, fOrigin) new Float:fAttack[3] xs_vec_sub(vfEnd, fOrigin, fAttack) xs_vec_sub(vfEnd, fOrigin, fAttack) new Float:fRate fRate = fDis / vector_length(fAttack) xs_vec_mul_scalar(fAttack, fRate, fAttack) xs_vec_add(fOrigin, fAttack, output) } // Stock by Chaosphere stock get_user_hitpoint(id, Float:hOrigin[3]) { if (!is_user_alive(id)) return 0 static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3] static Float:fTemp[3] pev(id, pev_origin, fOrigin) pev(id, pev_v_angle, fvAngle) pev(id, pev_view_ofs, fvOffset) xs_vec_add(fOrigin, fvOffset, fvOrigin) engfunc(EngFunc_AngleVectors, fvAngle, feOrigin, fTemp, fTemp) xs_vec_mul_scalar(feOrigin, 8192.0, feOrigin) xs_vec_add(fvOrigin, feOrigin, feOrigin) static tr engfunc(EngFunc_TraceLine, fvOrigin, feOrigin, 0, id, tr) get_tr2(tr, TR_vecEndPos, hOrigin) //global_get(glb_trace_endpos, hOrigin) return 1 } stock statusMsg(id, szMsg[], {Float,_}:...) { static iStatusText if (!iStatusText) iStatusText = get_user_msgid("StatusText") static szBuffer[512] vformat(szBuffer, charsmax(szBuffer), szMsg, 3) message_begin((id == 0) ? MSG_ALL : MSG_ONE, iStatusText, _, id) write_byte(0) // Unknown write_string(szBuffer) // Message message_end() return 1 } public plugin_end() { new Nvault = nvault_open("FurienXPSystem"); nvault_close( Nvault ); }
Modificare furien XP
Modificari necesare ale pluginurilor
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
-
- Membru, skill 0
- Posts: 15
- Joined: 15 Jan 2020, 23:35
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
Vreau si eu pluginul asta furien xp system daca se poate sa fie accesibil doar la vip si xp primit sa fie doar la vip
-
- Membru, skill 0
- Posts: 15
- Joined: 15 Jan 2020, 23:35
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
- ciprian3213
- Membru, skill +1
- Posts: 191
- Joined: 23 Mar 2015, 17:17
- Detinator Steam: Da
- CS Status: Nothing here !
- Fond eXtream: 0
- Location: Dorohoi, Botosani
- Contact:
Încearcă așa.
- | Afiseaza codul
/*///-----------------------------------------------------------------------------------// // ----- || Furien XP System || ----- // // // // --- || Author || --- ----- || Multimuri || ----- // // -- || Truth || -- -- || Hades Ownage || -- // // -- || Argon || -- // // -- || P34nut || -- // // -- || Ulquiorra || -- // // // // --- || Cvar-uri || --- // // -- || Sunt Explicate in plugin // // // *///------------------------------------------------------------------------------------// #include < amxmodx > #include < amxmisc > #include < cstrike > #include < engine > #include < hamsandwich > #include < fakemeta_util > #include < dhudmessage > #include < nvault > #include < xs > #define PLUGIN "Furien XP System" #define VERSION "1.3.3" #define AUTHOR "Truth" #define MAX_LEVELS 30 #define ADMIN_FLAG "a" #define LEVELUP_SOUND "fxs/levelup.wav" #define CLASSUP_SOUND "fxs/classup.wav" #define TASK_SHOWHUD 2674 #define ID_SHOWHUD (TaskIndex - TASK_SHOWHUD) // -- || Variabile || -- // new const szPrefix [ ] = "[XP System]"; // -- || Comenzi new RoundGive[33], RoundTake2[33]; // -- || HUD new MesajSync; // -- || XP enum _: UserStats { XP, Level, }; new User [ 33 ] [ UserStats ]; new None[33], Phoenix[33], Agent_X[33], eXtream[33], God[33]; // -- || Power // Phoenix #define PEV_ENT_TIME pev_fuser1 new HasPower[33]; #define is_user_vip(%1) (get_user_flags(%1) & ADMIN_LEVEL_H) new const fire_classname_could[] = "fire_salamander"; new const fire_spr_name_cloud[] = "sprites/fxs/fire.spr"; new FireAmmo [ 33 ]; //Agent X new Inv_Cooldown[33] = 0; new Inv_DurationCooldown[33] = 0; // eXtream #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4) #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1) //Cvars new pHook, pThrowSpeed, pSpeed, pWidth, pSound, pColor; new pInterrupt, pHookSky, pOpenDoors, pPlayers; new pUseButtons, pHostage, pWeapons, pInstant, pHookNoise; new pMaxHooks, pRndStartDelay; // Sprite new sprBeam; // Players hook entity new Hook[33]; // MaxPlayers new gMaxPlayers; // some booleans new bool:gHooked[33]; new bool:canThrowHook[33]; new bool:rndStarted; // Player Spawn new bool:gRestart[33] = {false, ...}; new bool:gUpdate[33] = {false, ...}; new gHooksUsed[33]; new bool:g_bHookAllowed[33]; // God new GodMode_Cooldown[33] = 0; new GodMode_DurationCooldown[33] = 0; // -- || Constante || -- // // -- || XP new const LEVELES[ MAX_LEVELS ] = { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000 }; // -- || Cvaruri || --- // // -- || XP new KillXp, HsXp, HeXp, KnifeXp, BombXP_E, BombXP_P, BombXP_D; // -- || Level new hp, money, health, max_hp, time_hp, armor; // -- || Power new Phoenix_hp, Phoenix_ap, Phoenix_fire, agent_hp, agent_ap, eXtream_hp, eXtream_ap, God_hp, God_ap; new CvarGodModeCooldown, CvarGodModeDuration, CvarInvCooldown, CvarInvDuration; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); // -- || Register CMD register_clcmd("say /class", "ClassMenuCmd" ); register_clcmd("say_team /class", "ClassMenuCmd"); // -- || Comenzi Admin register_clcmd( "amx_give_xp", "ClCmdGiveXP" ); register_clcmd( "amx_take_xp", "ClCmdTakeXP" ); // -- || Death Event register_event("DeathMsg", "eDeath", "a"); // -- || Cvar's //XP KillXp = register_cvar("fxs_kill_xp", "5"); // -- || Cat XP da pentru kill HsXp = register_cvar("fxs_hs_xp", "20"); // -- || Cat XP da pentru hs HeXp = register_cvar("fxs_he_xp", "10"); // -- || Cat XP da cand omori cu grenada KnifeXp = register_cvar("fxs_knife_xp", "15"); // -- || Cat XP da cand omori cu cutitul BombXP_E = register_cvar("fxs_bmb_explode_xp", "100"); // -- || Cat XP da cand explodeaza bomba BombXP_P = register_cvar("fxs_bmb_plant_xp", "100"); // -- || Cat XP da cand planteaza bomba BombXP_D = register_cvar("fxs_bmb_defuse_xp", "20"); // -- || Cat XP da cand dezamorseaza bomba //Level hp = register_cvar("fxs_level_regenerator_hp", "5"); // -- || Cat HP da in X secunde [ Regenerator HP ] money = register_cvar("fxs_level_money", "1000"); // -- || Cati bani da pe fiecare level health = register_cvar("fxs_level_health", "15"); // -- || Cat HP da pe fiecare level max_hp = register_cvar("fxs_level__regenerator_max_hp", "250"); // -- || Seteaza maximul de HP pentru Regenerator time_hp = register_cvar("fxs_level_regenerator_time", "5"); // -- || Timpul pentru regenerator [ Da viata in timpul setat ] armor = register_cvar("fxs_level_armor", "10"); // -- || Cat AP da pe fiecare level // - | Class //Phoenix Phoenix_hp = register_cvar("fxs_class_phoenix_hp", "150"); // -- || Cat hp seteaza clasei Phoenix Phoenix_ap = register_cvar("fxs_class_phoenix_ap", "50"); // -- || Cat ap seteaza clasei Phoenix Phoenix_fire = register_cvar("fxs_class_phoenix_fire", "30"); // -- || Cat ammo sa aiba la fire ( Power ) //Agent agent_hp = register_cvar("fxs_class_agent_hp", "175"); // -- || Cat hp seteaza clasei Agent X agent_ap = register_cvar("fxs_class_agent_ap", "75"); // -- || Cat ap seteaza clasei Agent X CvarInvCooldown = register_cvar("fxs_class_agent_time_remain", "30"); // -- || In cat timp se incarca puterea CvarInvDuration = register_cvar("fxs_class_agent_time_power", "3"); // -- || Cat timp dureaza puterea //eXtream eXtream_hp = register_cvar("fxs_class_extream_hp", "200"); // -- || Cat hp seteaza clasei eXtream Player eXtream_ap = register_cvar("fxs_class_extream_ap", "100"); // -- || Cat ap seteaza clasei eXtream Player //God God_hp = register_cvar("fxs_class_god_hp", "255"); // -- || Cat hp seteaza clasei God God_ap = register_cvar("fxs_class_god_ap", "255"); // -- || Cat ap seteaza clasei God CvarGodModeCooldown = register_cvar("fxs_class_god_time_remain", "25"); // -- || In cat timp se incarca puterea CvarGodModeDuration = register_cvar("fxs_class_god_time_power", "5"); // -- || Cat timp dureaza puterea // Hook commands register_clcmd("+hook", "make_hook") register_clcmd("-hook", "del_hook") // Events for roundstart register_event("HLTV", "round_bstart", "a", "1=0", "2=0") register_logevent("round_estart", 2, "1=Round_Start") // Player spawn stuff register_event("TextMsg", "Restart", "a", "2=#Game_will_restart_in") register_clcmd("fullupdate", "Update") register_event("ResetHUD", "ResetHUD", "b") // Register cvars pHook = register_cvar("sv_hook", "1"); pThrowSpeed = register_cvar("sv_hookthrowspeed", "1000"); pSpeed = register_cvar("sv_hookspeed", "600"); pWidth = register_cvar("sv_hookwidth", "32"); pSound = register_cvar("sv_hooksound", "1"); pColor = register_cvar("sv_hookcolor", "1"); pPlayers = register_cvar("sv_hookplayers", "0"); pInterrupt = register_cvar("sv_hookinterrupt", "0"); pHookSky = register_cvar("sv_hooksky", "1"); pOpenDoors = register_cvar("sv_hookopendoors", "1"); pUseButtons = register_cvar("sv_hookusebuttons", "1"); pHostage = register_cvar("sv_hookhostflollow", "1"); pWeapons = register_cvar("sv_hookpickweapons", "1"); pInstant = register_cvar("sv_hookinstant", "0"); pHookNoise = register_cvar("sv_hooknoise", "0"); pMaxHooks = register_cvar("sv_hookmax", "0"); pRndStartDelay = register_cvar("sv_hookrndstartdelay", "0.0"); // Touch forward register_forward(FM_Touch, "fwTouch") // Get maxplayers gMaxPlayers = get_maxplayers() // -- || Power register_clcmd("power", "PowerCmd"); register_touch(fire_classname_could, "*", "fw_touch_fire"); register_think(fire_classname_could, "fw_think_fire"); RegisterHam(Ham_Spawn, "player", "Spawn", true ); static id; for ( id = 1; id <= get_maxplayers ( ); id++ ) { ClassFalse(id); None[id] = true; } MesajSync = CreateHudSyncObj(); } // ------------------------ || Plugin Precache || ------------------------ // public plugin_precache() { // Sounds precache_sound( LEVELUP_SOUND ); precache_sound( CLASSUP_SOUND ); //Fire precache_model(fire_spr_name_cloud); precache_sound ( "fxs/flamegun-2.wav" ); // Hook // Hook Model engfunc(EngFunc_PrecacheModel, "models/fxs/rpgrocket.mdl") // Hook Beam sprBeam = engfunc(EngFunc_PrecacheModel, "sprites/fxs/zbeam4.spr") // Hook Sounds engfunc(EngFunc_PrecacheSound, "fxs/xbow_hit1.wav") // good hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_hit2.wav") // wrong hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_hitbod1.wav") // player hit engfunc(EngFunc_PrecacheSound, "fxs/xbow_fire1.wav") // deploy } // ------------------------ || Plugin Native || ------------------------ // public plugin_natives() { register_native ( "set_user_xp", "set_user_xp", 1 ); register_native ( "set_user_level", "set_user_level", 1 ); register_native ( "get_user_xp", "get_user_xp", 1 ); register_native ( "get_user_level", "get_user_level", 1 ); } public set_user_xp ( id, xp ) User [ id ] [ XP ] = xp; public set_user_level ( id, level ) User [ id ] [ Level ] = level; public get_user_xp ( id ) return User [ id ] [ XP ]; public get_user_level ( id ) return User [ id ] [ Level ]; // ------------------------ || Client Connect || ------------------------ // public client_putinserver(id) { LoadData(id); RefreshLevel ( id ); set_task(1.0, "MesajHUD", id+TASK_SHOWHUD, .flags = "b"); } // ------------------------ || Client Disconnect || ------------------------ // public client_disconnect(id) { SaveData(id); } // ------------------------ || Spawn || ------------------------ // public Spawn( id ) { HasPower[ id ] = false; RoundGive[ id ] = false; RoundTake2[ id ] = false; if ( Phoenix [ id ] ) { FireAmmo [ id ] = get_pcvar_num(Phoenix_fire); fm_set_user_health(id, get_pcvar_num(Phoenix_hp) ); fm_set_user_armor(id, get_pcvar_num(Phoenix_ap) ); } if(Agent_X[id]) { fm_set_user_health(id, get_pcvar_num(agent_hp) ); fm_set_user_armor(id, get_pcvar_num(agent_ap) ); } if(eXtream[id]) { fm_set_user_health(id, get_pcvar_num(eXtream_hp) ); fm_set_user_armor(id, get_pcvar_num(eXtream_ap) ); g_bHookAllowed[id] = true; } if(God[id]) { fm_set_user_health(id, get_pcvar_num(God_hp) ); fm_set_user_armor(id, get_pcvar_num(God_ap) ); } } // ------------------------ || Comenzi Admin || ------------------------ // public ClCmdGiveXP( id ) { if( !( get_user_flags( id ) & read_flags( ADMIN_FLAG ) ) ) { client_cmd( id, "echo NU ai acces la aceasta comanda!" ); return 1; } if( RoundGive[ id ] ) { client_cmd( id, "echo Ai dat odata XP pe aceasta runda!" ); return 1; } new szFirstArg[ 32 ], szSecondArg[ 10 ]; read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 ); read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 ); if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) ) { client_cmd( id, "echo amx_give_xp < nume/ @ALL/ @T/ @CT > < xp >" ); return 1; } new iPlayers[ 32 ]; new iPlayersNum; new iXP = str_to_num( szSecondArg ); if( iXP <= 0 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mare decat 0!" ); return 1; } if( iXP > 1000 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mica decat 1000!" ); return 1; } if( szFirstArg[ 0 ] == '@' ) { switch ( szFirstArg[ 1 ] ) { case 'A': { if( equal( szFirstArg, "@ALL" ) ) { get_players( iPlayers, iPlayersNum, "ch" ); for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP tuturor jucatorilor!", szPrefix, szName, iXP ); return 1; } } case 'T': { if( equal( szFirstArg, "@T" ) ) { get_players( iPlayers, iPlayersNum, "ceh", "TERRORIST" ); if( iPlayersNum == 0 ) { client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa!" ); return 1; } for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP jucatorilor de la^x03 TERO^x01!", szPrefix, szName, iXP ); return 1; } } case 'C': { if( equal( szFirstArg, "@CT" ) ) { get_players( iPlayers, iPlayersNum, "ceh", "CT" ); if( iPlayersNum == 0 ) { client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa!" ); return 1; } for( new i = 0; i < iPlayersNum ; i++ ) { User[iPlayers[ i ]] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayers[ i ]] [XP] / 100; LevelGive = LevelGive2; User [ iPlayers[ i ] ] [ Level ] = LevelGive; RoundGive[ iPlayers[ i ] ] = true; SaveData( iPlayers[ i ] ); RefreshLevel ( iPlayers[ i ] ); } new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 XP jucatorilor de la^x03 CT^x01!", szPrefix, szName, iXP ); return 1; } } } } new iPlayer = cmd_target( id, szFirstArg, 8 ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg ); return 1; } if(User[ iPlayer ] [XP] == 3000) { client_cmd( id, "echo Valoare XP-ul a atins limita!" ); return 1; } User[iPlayer] [XP] += iXP; new LevelGive, LevelGive2; LevelGive2 = User[iPlayer] [XP] / 100; LevelGive = LevelGive2; User [ iPlayer ] [ Level ] = LevelGive; RoundGive[ iPlayer ] = true; SaveData( iPlayer ); RefreshLevel ( iPlayer ); new szName[ 32 ], _szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 ); ColorChat( 0, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 XP lui^x03 %s^x01.", szPrefix, szName, iXP, _szName ); return 1; } public ClCmdTakeXP( id ) { if( !( get_user_flags( id ) & read_flags( ADMIN_FLAG ) ) ) { client_cmd( id, "echo NU ai acces la aceasta comanda!" ); return 1; } if( RoundTake2[ id ] ) { client_cmd( id, "echo Ai luat odata XP pe aceasta runda!" ); return 1; } new szFirstArg[ 32 ], szSecondArg[ 10 ]; read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 ); read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 ); if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) ) { client_cmd( id, "echo amx_take_xp < nume > < xp >" ); return 1; } new iXP = str_to_num( szSecondArg ); if( iXP <= 0 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mare decat 0!" ); return 1; } if( iXP > 1000 ) { client_cmd( id, "echo Valoare XP-ului trebuie sa fie mai mica decat 1000!" ); return 1; } new iPlayer = cmd_target( id, szFirstArg, 8 ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg ); return 1; } if( User[iPlayer] [XP] < iXP ) { client_cmd( id, "echo Jucatorul %s nu are atata XP!Are doar %i", szFirstArg, User[iPlayer] [XP] ); return 1; } RoundTake2[id] = true; new LevelTake, LevelTake2; User[iPlayer] [XP] -= iXP; LevelTake2 = User[iPlayer] [XP] / 100; LevelTake = LevelTake2; User [ iPlayer ] [ Level ] = LevelTake; SaveData( iPlayer ); RefreshLevel ( iPlayer ); new szName[ 32 ], _szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 ); ColorChat( 0, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 XP-ul lui^x03 %s^x01.", szPrefix, szName, iXP, _szName ); return 1; } // ------------------------ || Clase CMD || ------------------------ // public ClassMenuCmd ( id ) { if(HasPower[id]) { ColorChat(id, "^x04%s^x01 Ai ales clasa pe runda aceasta.", szPrefix); return 1; } if(!is_user_vip(id)) { ColorChat(id, "^x04%s^x01 Nu ai vip.", szPrefix); return PLUGIN_HANDLED; } new Title[101]; formatex(Title, 100, "\y Meniul de Clase"); new ClaseMenu = menu_create(Title, "give_class"); if(User [ id ] [ Level ] >= 5) { menu_additem(ClaseMenu, "\yPhoenix - \r Level 5", "1", 0); } else { menu_additem(ClaseMenu, "\dPhoenix - Level 5", "1", 0); } if(User [ id ] [ Level ] >= 10) { menu_additem(ClaseMenu, "\yAgent X - \r Level 10", "1", 0); } else { menu_additem(ClaseMenu, "\dAgent X - Level 10", "1", 0); } if(User [ id ] [ Level ] >= 20) { menu_additem(ClaseMenu, "\yeXtream Player - \r Level 20", "1", 0); } else { menu_additem(ClaseMenu, "\deXtream Player - Level 20", "1", 0); } if(User [ id ] [ Level ] >= 30) { menu_additem(ClaseMenu, "\yGod - \r Level 30", "1", 0); } else { menu_additem(ClaseMenu, "\dGod - Level 30", "1", 0); } menu_setprop(ClaseMenu, MPROP_EXIT, MEXIT_ALL ); menu_display(id, ClaseMenu, 0); return 1; } public give_class ( id, ClaseMenu, item ) { if(item == MENU_EXIT) { return 1; } switch( item ) { case 0: { if(User [ id ] [ Level ] >= 5) { ClassFalse(id); Phoenix[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(Phoenix_hp) ); fm_set_user_armor(id, get_pcvar_num(Phoenix_ap) ); FireAmmo [ id ] = get_pcvar_num(Phoenix_fire); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 5 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 1: { if(User [ id ] [ Level ] >= 10) { ClassFalse(id); Agent_X[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(agent_hp) ); fm_set_user_armor(id, get_pcvar_num(agent_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 10 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 2: { if(User [ id ] [ Level ] >= 20) { ClassFalse(id); eXtream[id] = true; HasPower[id] = true; g_bHookAllowed[id] = true; fm_set_user_health(id, get_pcvar_num(eXtream_hp) ); fm_set_user_armor(id, get_pcvar_num(eXtream_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 20 !", szPrefix ); ClassMenuCmd(id); return 1; } } case 3: { if(User [ id ] [ Level ] >= 30) { ClassFalse(id); God[id] = true; HasPower[id] = true; fm_set_user_health(id, get_pcvar_num(God_hp) ); fm_set_user_armor(id, get_pcvar_num(God_ap) ); } else { ColorChat(id, "^x04%s^x01 Pentru a selecta aceasta clasa iti trebuie minim level 30 !", szPrefix ); ClassMenuCmd(id); return 1; } } } menu_destroy(ClaseMenu); return 1; } // ------------------------ || SaveData & LoadData || ------------------------ // public SaveData(id) { new Nvault = nvault_open("FurienXPSystem"); new szName [ 32 ]; get_user_name ( id, szName, 31 ); new vaultkey[64],vaultdata[256]; format(vaultkey,63,"%s-Mod", szName); format(vaultdata,255,"%i#%i#",User [ id ] [ XP ], User [ id ] [ Level ]); nvault_set(Nvault,vaultkey,vaultdata); return PLUGIN_CONTINUE; } public LoadData(id) { new Nvault = nvault_open("FurienXPSystem"); new szName [ 32 ]; get_user_name ( id, szName, 31 ); new vaultkey[64],vaultdata[256]; format(vaultkey,63,"%s-Mod",szName); format(vaultdata,255,"%i#%i#", User [ id ] [ XP ], User [ id ] [ Level ]); nvault_get(Nvault,vaultkey,vaultdata,255); replace_all(vaultdata, 255, "#", " "); new xp[32], level[32]; parse(vaultdata, xp, 31, level, 31); User [ id ] [ XP ] = str_to_num(xp); User [ id ] [ Level ] = str_to_num(level); return PLUGIN_CONTINUE; } // ------------------------ || Show HUD || ------------------------ // public MesajHUD(TaskIndex) { static id; id = ID_SHOWHUD; if (!is_user_alive(id)) { id = pev(id, pev_iuser2); if(!is_user_alive(id)) return; } if(id != ID_SHOWHUD) { new nume[32]; get_user_name(id, nume, 31); if(None[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: None", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(Phoenix[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: Phoenix", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(Agent_X[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: Agent X", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(eXtream[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: eXtream Player", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } if(God[id]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nLevel: %d | XP: %d | Clasa: God", nume, User [ id ] [ Level ], User [ id ] [ XP ] ); } } else { if(None[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: None", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(Phoenix[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: Phoenix", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(Agent_X[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: Agent X", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(eXtream[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: eXtream Player", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } if(God[ID_SHOWHUD]) { set_hudmessage ( 255, 255, 0, -1.0, 0.80, 0, 6.0, 12.0 ); ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Level: %d | XP: %d | Clasa: God", User [ ID_SHOWHUD ] [ Level ], User [ ID_SHOWHUD ] [ XP ] ); } } } // ------------------------ || Death XP || ------------------------ // public eDeath( ) { new Killer = read_data( 1 ); new HS = read_data( 3 ); new Weapon = get_user_weapon( Killer ); if(is_user_vip(killer)) { if(!(User [ Killer ] [ Level ] == 30)) { User [ Killer ] [ XP ] += get_pcvar_num( KillXp ); if(HS) User [ Killer ] [ XP ] += get_pcvar_num( HsXp ); if(Weapon == CSW_KNIFE) User [ Killer ] [ XP ] += get_pcvar_num( KnifeXp ); if(Weapon == CSW_HEGRENADE) User [ Killer ] [ XP ] += get_pcvar_num( HeXp ); SaveData( Killer ); RefreshLevel ( Killer ); } } else { return 1; } return 1; } // ------------------------ || Bomb XP || ------------------------ // public bomb_planted(id){ if(is_user_vip(id)) { if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_P ); SaveData( id ); RefreshLevel ( id ); } } else { return 1; } return 1; } public bomb_explode(id){ if(is_user_vip(id)) { if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_E ); SaveData( id ); RefreshLevel ( id ); } } else { return 1; } return 1; } public bomb_defused(id){ if(is_user_vip(id)) { if(!(User [ id ] [ Level ] == 30)) { User [ id ] [ XP ] += get_pcvar_num( BombXP_D ); SaveData( id ); RefreshLevel ( id ); } } else { return 1; } return 1; } public RefreshLevel ( id ) { if ( User [ id ] [ Level ] < MAX_LEVELS ) { while ( User [ id ] [ XP ] >= LEVELES [ User [ id ] [ Level ] ] ) { User [ id ] [ Level ] += 1; if(User [ id ] [ Level ] == 30) { User [ id ] [ XP ] = 3000; return 1; } if(RoundGive[ id ]) return 1; if(RoundTake2[ id ]) return 1; ColorChat(id, "^x04%s^x01 Felicitari! Acum ai level^x04 %d^x01 !", szPrefix, User [ id ] [ Level ] ); if(User[ id ] [ Level ] == 5) { ClassFalse(id); Phoenix[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa Pheonix !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 Phoenix^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 10) { ClassFalse(id); Agent_X[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa Agent X !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 Agent X^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 20) { ClassFalse(id); eXtream[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa eXtream Player !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 eXtream Player^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 30) { ClassFalse(id); God[id] = true; client_cmd ( id, "spk ^"%s^"", CLASSUP_SOUND ); set_dhudmessage( 0, 100, 200, -1.0, -1.0, random_num( 0, 2 ), 6.0, 8.0 ); show_dhudmessage( id, "Felicitari tocmai ai deblocat clasa God !"); ColorChat(id, "^x04%s^x01 Felicitari tocmai ai deblocat clasa^x04 God^x01 !", szPrefix); ColorChat(id, "^x04%s^x01 Pentru a accesa meniul scrie in chat ^x04 /class^x01 .", szPrefix); } if(User[ id ] [ Level ] == 5 || User[ id ] [ Level ] == 10 || User[ id ] [ Level ] == 20 || User[ id ] [ Level ] == 30 ) { return 1; } else { client_cmd ( id, "spk ^"%s^"", LEVELUP_SOUND ); } if(User [ id ] [ Level ] < 5) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); } else if (User [ id ] [ Level ] < 10) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); } else if ( User [ id ] [ Level ] < 20 ) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_smokegrenade"); fm_give_item(id, "weapon_flashbang"); } else if ( User [ id ] [ Level ] < 30 ) { cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num( money ) ); fm_set_user_health(id, get_user_health(id) + get_pcvar_num( health ) ); fm_set_user_armor(id, get_user_armor(id) + get_pcvar_num(armor) ); fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_smokegrenade"); fm_give_item(id, "weapon_flashbang"); set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); } } } else { if(User [ id ] [ Level ] == 30 && is_user_vip(id)) { User [ id ] [ XP ] = 3000; return 1; } return 1; } return 1; } // --------------------------------- ||| Regenator HP ||| --------------------------------- // public RegeneratorHP ( id ) { new Health = get_user_health(id); if(Health >= get_pcvar_num( max_hp )) { set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); return 1; } else { fm_set_user_health(id, Health + get_pcvar_num( hp ) ); set_task(float(get_pcvar_num( time_hp )), "RegeneratorHP", id); } return 1; } // --------------------------------- ||| Power ||| --------------------------------- // public PowerCmd ( id ) { if ( Phoenix [ id ] && is_user_alive(id) ) { cloudfire ( id ); } if(Agent_X[id] && !Inv_DurationCooldown[id] && is_user_alive(id)) { if (Inv_Cooldown[id]) { ColorChat(id,"^x03%s^x04 Puterea iti va reveni in^x03 %d secunde.", szPrefix,Inv_Cooldown[id]); return PLUGIN_CONTINUE; } set_entity_visibility(id, 0); Inv_DurationCooldown[id] = get_pcvar_num(CvarInvDuration) set_task(1.0, "InvShowHUD", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(get_pcvar_num(CvarInvDuration) != 1) { show_hudmessage(id, "Esti invizibil pentru: %d secunde",get_pcvar_num(CvarInvDuration)); } if(get_pcvar_num(CvarInvDuration) == 1) { show_hudmessage(id, "Esti invizibil pentru: %d secunda",get_pcvar_num(CvarInvDuration)); } return PLUGIN_HANDLED; } if(God[id] && !GodMode_DurationCooldown[id] && is_user_alive(id)) { if (GodMode_Cooldown[id]) { ColorChat(id, "^x03%s^x04 Puterea iti va reveni in^x03 %d secunde.", szPrefix,GodMode_Cooldown[id]); return PLUGIN_CONTINUE; } fm_set_user_godmode(id, 1); GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration) set_task(1.0, "GodModeShowHUD", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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; } return 1; } // --------------------------------- ||| Class Phoenix | Fire Power ||| --------------------------------- // public cloudfire(id) { set_hudmessage(0, 170, 255, 0.02, 0.87, 0, 6.0, 1.0) show_hudmessage(id, "Ammo: %d", FireAmmo [ id ]) if ( FireAmmo [ id ] > 0 ) { new iEnt = create_entity("env_sprite") new Float:vfVelocity[3] velocity_by_aim(id, 500, vfVelocity) xs_vec_mul_scalar(vfVelocity, 0.4, vfVelocity) // add velocity of Owner for ent new Float:fOwnerVel[3], Float:vfAttack[3], Float:vfAngle[3] pev(id, pev_angles, vfAngle) //pev(id, pev_origin, vfAttack) get_weapon_attackment(id, vfAttack, 20.0) vfAttack[2] -= 7.0 //vfAttack[1] += 7.0 pev(id, pev_velocity, fOwnerVel) fOwnerVel[2] = 0.0 xs_vec_add(vfVelocity, fOwnerVel, vfVelocity) // set info for ent set_pev(iEnt, pev_movetype, MOVETYPE_FLY) set_pev(iEnt, pev_rendermode, kRenderTransAdd) set_pev(iEnt, pev_renderamt, 150.0) set_pev(iEnt, PEV_ENT_TIME, get_gametime() + 1.5) // time remove set_pev(iEnt, pev_scale, 0.2) set_pev(iEnt, pev_nextthink, halflife_time() + 0.05) set_pev(iEnt, pev_classname, fire_classname_could) engfunc(EngFunc_SetModel, iEnt, fire_spr_name_cloud) set_pev(iEnt, pev_mins, Float:{-1.0, -1.0, -1.0}) set_pev(iEnt, pev_maxs, Float:{1.0, 1.0, 1.0}) set_pev(iEnt, pev_origin, vfAttack) set_pev(iEnt, pev_gravity, 0.01) set_pev(iEnt, pev_velocity, vfVelocity) vfAngle[1] += 30.0 set_pev(iEnt, pev_angles, vfAngle) set_pev(iEnt, pev_solid, SOLID_BBOX) set_pev(iEnt, pev_owner, id) set_pev(iEnt, pev_iuser2, 1) emit_sound(id, CHAN_WEAPON, "weapons/flamegun-2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) --FireAmmo [ id ]; } else { set_hudmessage(0, 170, 255, -1.0, 0.13, 0, 6.0, 2.0) show_hudmessage(id, "No ammo !") return 1; } return 0; } public fw_think_fire(iEnt) { if ( !pev_valid(iEnt) ) return; new Float:fFrame, Float:fScale, Float:fNextThink pev(iEnt, pev_frame, fFrame) pev(iEnt, pev_scale, fScale) // effect exp new iMoveType = pev(iEnt, pev_movetype) if (iMoveType == MOVETYPE_NONE) { fNextThink = 0.015 fFrame += 1.0 if (fFrame > 21.0) { engfunc(EngFunc_RemoveEntity, iEnt) return } } // effect normal else { fNextThink = 0.045 fFrame += 1.0 fFrame = floatmin(21.0, fFrame) } fScale = (entity_range(iEnt, pev(iEnt, pev_owner)) / 500) * 3.0 set_pev(iEnt, pev_frame, fFrame) set_pev(iEnt, pev_scale, fScale) set_pev(iEnt, pev_nextthink, halflife_time() + fNextThink) // time remove new Float:fTimeRemove pev(iEnt, PEV_ENT_TIME, fTimeRemove) if (get_gametime() >= fTimeRemove) { engfunc(EngFunc_RemoveEntity, iEnt) return; } } public fw_touch_fire(ent, id) { set_pev(ent, pev_movetype, MOVETYPE_NONE) set_pev(ent, pev_solid, SOLID_NOT) if(!is_valid_ent(id)) return FMRES_IGNORED if(!is_user_alive(id) || !is_user_connected(id) ) return FMRES_IGNORED if(pev(ent, pev_iuser2) == 1) { set_pev(ent, pev_iuser2, 0) static attacker, ent_kill attacker = pev(ent, pev_owner) ent_kill = fm_get_user_weapon_entity(id, CSW_KNIFE) ExecuteHam(Ham_TakeDamage, id, ent_kill, attacker, random_float(70.0, 100.0), DMG_BULLET) } return FMRES_HANDLED } // --------------------------------- ||| Class Agent X | Invizibility Power ||| --------------------------------- // public InvShowHUD(id) { if (!is_user_alive(id) || !Agent_X[id]) { remove_task(id); Inv_DurationCooldown[id] = 0; fm_set_user_godmode(id, 0); return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(is_user_alive(id) && Inv_DurationCooldown[id] == 1) { Inv_DurationCooldown[id] --; show_hudmessage(id, "Esti invizibil pentru: %d secunda",Inv_DurationCooldown[id]); } if(is_user_alive(id) && Inv_DurationCooldown[id] > 1) { Inv_DurationCooldown[id] --; show_hudmessage(id, "Esti invizibil pentru: %d secunde",Inv_DurationCooldown[id]); } if(Inv_DurationCooldown[id] <= 0) { show_hudmessage(id, "Nu mai ai GodMode"); ColorChat(id, "^x03%s^x04 Nu mai esti invizibil.", szPrefix); remove_task(id); set_entity_visibility(id, 1); Inv_DurationCooldown[id] = 0; Inv_Cooldown[id] = get_pcvar_num(CvarInvCooldown); set_task(1.0, "InvShowHUD2", id, _, _, "b"); set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(get_pcvar_num(CvarInvCooldown) != 1) { show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarInvCooldown)); } if(get_pcvar_num(CvarInvCooldown) == 1) { show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarInvCooldown)); } return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public InvShowHUD2(id) { if (!is_user_alive(id) || !Agent_X[id]) { remove_task(id); Inv_Cooldown[id] = 0; return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); if(is_user_alive(id) && Inv_Cooldown[id] == 1) { Inv_Cooldown[id] --; show_hudmessage(id, "Puterea iti va reveni in: %d secunda",Inv_Cooldown[id]); } if(is_user_alive(id) && Inv_Cooldown[id] > 1) { Inv_Cooldown[id] --; show_hudmessage(id, "Puterea iti va reveni in: %d secunde",Inv_Cooldown[id]); } if(Inv_Cooldown[id] <= 0) { show_hudmessage(id, "Ti-a revenit puterea"); ColorChat(id, "^x03%s^x04 Iti poti folosi din nou puterea.", szPrefix); remove_task(id); Inv_Cooldown[id] = 0; } return PLUGIN_HANDLED; } // --------------------------------- ||| Class eXtream | Hook Power ||| --------------------------------- // public make_hook(id) { if(!eXtream[id]) return 1; if (get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) { new iMaxHooks = get_pcvar_num(pMaxHooks) if (iMaxHooks > 0) { if (gHooksUsed[id] >= iMaxHooks) { client_print(id, print_chat, "[Hook] You already used your maximum ammount of hooks") statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) return PLUGIN_HANDLED } else { gHooksUsed[id]++ statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) } } new Float:fDelay = get_pcvar_float(pRndStartDelay) if (fDelay > 0 && !rndStarted) client_print(id, print_chat, "[Hook] You cannot use the hook in the first %0.0f seconds of the round", fDelay) throw_hook(id) } return PLUGIN_HANDLED } public del_hook(id) { if(!eXtream[id]) return 1; // Remove players hook if (!canThrowHook[id]) remove_hook(id) return PLUGIN_HANDLED } public round_bstart() { // Round is not started anymore if (rndStarted) rndStarted = false // Remove all hooks for (new i = 1; i <= gMaxPlayers; i++) { if (is_user_connected(i)) { if(!canThrowHook) remove_hook(i) } } } public round_estart() { new Float:fDelay = get_pcvar_float(pRndStartDelay) if (fDelay > 0.0) set_task(fDelay, "rndStartDelay") else { // Round is started... if (!rndStarted) rndStarted = true } } public rndStartDelay() { if (!rndStarted) rndStarted = true } public Restart() { for (new id = 0; id < gMaxPlayers; id++) { if (is_user_connected(id)) gRestart[id] = true } } public Update(id) { if (!gUpdate[id]) gUpdate[id] = true return PLUGIN_CONTINUE } public ResetHUD(id) { if (gRestart[id]) { gRestart[id] = false return } if (gUpdate[id]) { gUpdate[id] = false return } if (gHooked[id]) { remove_hook(id) } if (get_pcvar_num(pMaxHooks) > 0) { gHooksUsed[id] = 0 statusMsg(0, "[Hook] 0 of %d hooks used.", get_pcvar_num(pMaxHooks)) } } public fwTouch(pentru, ptd) { if (!pev_valid(pentru)) return FMRES_IGNORED new id = pev(pentru, pev_owner) // Get classname static szPtrClass[32] pev(pentru, pev_classname, szPtrClass, charsmax(szPtrClass)) if (equali(szPtrClass, "Hook")) { static Float:fOrigin[3] pev(pentru, pev_origin, fOrigin) if (pev_valid(ptd)) { static szPtdClass[32] pev(ptd, pev_classname, szPtdClass, charsmax(szPtdClass)) if (!get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd)) { // Hit a player if (get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) return FMRES_HANDLED } else if (equali(szPtdClass, "hostage_entity")) { // Makes an hostage follow if (get_pcvar_num(pHostage) && get_user_team(id) == 2) { //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id) // With the use function we have the sounds! dllfunc(DLLFunc_Use, ptd, id) } if (!get_pcvar_num(pPlayers)) { if(get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) } return FMRES_HANDLED } else if (get_pcvar_num(pOpenDoors) && equali(szPtdClass, "func_door") || equali(szPtdClass, "func_door_rotating")) { // Open doors // Double doors tested in de_nuke and de_wallmart static szTargetName[32] pev(ptd, pev_targetname, szTargetName, charsmax(szTargetName)) if (strlen(szTargetName) > 0) { static ent while ((ent = engfunc(EngFunc_FindEntityByString, ent, "target", szTargetName)) > 0) { static szEntClass[32] pev(ent, pev_classname, szEntClass, charsmax(szEntClass)) if (equali(szEntClass, "trigger_multiple")) { dllfunc(DLLFunc_Touch, ent, id) goto stopdoors // No need to touch anymore } } } // No double doors.. just touch it dllfunc(DLLFunc_Touch, ptd, id) stopdoors: } else if (get_pcvar_num(pUseButtons) && equali(szPtdClass, "func_button")) { if (pev(ptd, pev_spawnflags) & SF_BUTTON_TOUCH_ONLY) dllfunc(DLLFunc_Touch, ptd, id) // Touch only else dllfunc(DLLFunc_Use, ptd, id) // Use Buttons } } // If cvar sv_hooksky is 0 and hook is in the sky remove it! new iContents = engfunc(EngFunc_PointContents, fOrigin) if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY) { if(get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) return FMRES_HANDLED } // Pick up weapons.. if (get_pcvar_num(pWeapons)) { static ent while ((ent = engfunc(EngFunc_FindEntityInSphere, ent, fOrigin, 15.0)) > 0) { static szentClass[32] pev(ent, pev_classname, szentClass, charsmax(szentClass)) if (equali(szentClass, "weaponbox") || equali(szentClass, "armoury_entity")) dllfunc(DLLFunc_Touch, ent, id) } } // Player is now hooked gHooked[id] = true // Play sound if (get_pcvar_num(pSound)) emit_sound(pentru, CHAN_STATIC, "fxs/xbow_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) // Make some sparks :D message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0) write_byte(9) // TE_SPARKS write_coord_f(fOrigin[0]) // Origin write_coord_f(fOrigin[1]) write_coord_f(fOrigin[2]) message_end() // Stop the hook from moving set_pev(pentru, pev_velocity, Float:{0.0, 0.0, 0.0}) set_pev(pentru, pev_movetype, MOVETYPE_NONE) //Task if (!task_exists(id + 856)) { static TaskData[2] TaskData[0] = id TaskData[1] = pentru gotohook(TaskData) set_task(0.1, "gotohook", id + 856, TaskData, 2, "b") } } return FMRES_HANDLED } public hookthink(param[]) { new id = param[0] new HookEnt = param[1] if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) { remove_task(id + 890) return PLUGIN_HANDLED } static Float:entOrigin[3] pev(HookEnt, pev_origin, entOrigin) // If user is behind a box or something.. remove it // only works if sv_interrupt 1 or higher is if (get_pcvar_num(pInterrupt) && rndStarted) { static Float:usrOrigin[3] pev(id, pev_origin, usrOrigin) static tr engfunc(EngFunc_TraceLine, usrOrigin, entOrigin, 1, -1, tr) static Float:fFraction get_tr2(tr, TR_flFraction, fFraction) if (fFraction != 1.0) remove_hook(id) } // If cvar sv_hooksky is 0 and hook is in the sky remove it! new iContents = engfunc(EngFunc_PointContents, entOrigin) if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY) { if(get_pcvar_num(pSound)) emit_sound(HookEnt, CHAN_STATIC, "fxs/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) remove_hook(id) } return PLUGIN_HANDLED } public gotohook(param[]) { new id = param[0] new HookEnt = param[1] if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) { remove_task(id + 856) return PLUGIN_HANDLED } // If the round isnt started velocity is just 0 static Float:fVelocity[3] fVelocity = Float:{0.0, 0.0, 1.0} // If the round is started and player is hooked we can set the user velocity! if (rndStarted && gHooked[id]) { static Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist pev(HookEnt, pev_origin, fHookOrigin) pev(id, pev_origin, fUsrOrigin) fDist = vector_distance(fHookOrigin, fUsrOrigin) if (fDist >= 30.0) { new Float:fSpeed = get_pcvar_float(pSpeed) fSpeed *= 0.52 fVelocity[0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 * fSpeed) / fDist fVelocity[1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 * fSpeed) / fDist fVelocity[2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 * fSpeed) / fDist } } // Set the velocity set_pev(id, pev_velocity, fVelocity) return PLUGIN_HANDLED } public throw_hook(id) { // Get origin and angle for the hook static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3] static Float:fStart[3] pev(id, pev_origin, fOrigin) pev(id, pev_angles, fAngle) pev(id, pev_v_angle, fvAngle) if (get_pcvar_num(pInstant)) { get_user_hitpoint(id, fStart) if (engfunc(EngFunc_PointContents, fStart) != CONTENTS_SKY) { static Float:fSize[3] pev(id, pev_size, fSize) fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 + fSize[0]) fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 + fSize[1]) fOrigin[2] = fStart[2] } else xs_vec_copy(fStart, fOrigin) } // Make the hook! Hook[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) if (Hook[id]) { // Player cant throw hook now canThrowHook[id] = false static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000} static const Float:fMaxs[3] = {2.840000, 0.020000, 2.840000} //Set some Data set_pev(Hook[id], pev_classname, "Hook") engfunc(EngFunc_SetModel, Hook[id], "models/fxs/rpgrocket.mdl") engfunc(EngFunc_SetOrigin, Hook[id], fOrigin) engfunc(EngFunc_SetSize, Hook[id], fMins, fMaxs) //set_pev(Hook[id], pev_mins, fMins) //set_pev(Hook[id], pev_maxs, fMaxs) set_pev(Hook[id], pev_angles, fAngle) set_pev(Hook[id], pev_solid, 2) set_pev(Hook[id], pev_movetype, 5) set_pev(Hook[id], pev_owner, id) //Set hook velocity static Float:fForward[3], Float:Velocity[3] new Float:fSpeed = get_pcvar_float(pThrowSpeed) engfunc(EngFunc_MakeVectors, fvAngle) global_get(glb_v_forward, fForward) Velocity[0] = fForward[0] * fSpeed Velocity[1] = fForward[1] * fSpeed Velocity[2] = fForward[2] * fSpeed set_pev(Hook[id], pev_velocity, Velocity) // Make the line between Hook and Player message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, Float:{0.0, 0.0, 0.0}, 0) if (get_pcvar_num(pInstant)) { write_byte(1) // TE_BEAMPOINT write_short(id) // Startent write_coord_f(fStart[0]) // End pos write_coord_f(fStart[1]) write_coord_f(fStart[2]) } else { write_byte(8) // TE_BEAMENTS write_short(id) // Start Ent write_short(Hook[id]) // End Ent } write_short(sprBeam) // Sprite write_byte(1) // StartFrame write_byte(1) // FrameRate write_byte(600) // Life write_byte(get_pcvar_num(pWidth)) // Width write_byte(get_pcvar_num(pHookNoise)) // Noise // Colors now if (get_pcvar_num(pColor)) { if (get_user_team(id) == 1) { // Terrorist write_byte(255) // R write_byte(0) // G write_byte(0) // B } else if(get_user_team(id) == 2) { // CT write_byte(0) // R write_byte(0) // G write_byte(255) // B } else { write_byte(255) // R write_byte(255) // G write_byte(255) // B } } else { write_byte(255) // R write_byte(255) // G write_byte(255) // B } write_byte(192) // Brightness write_byte(0) // Scroll speed message_end() if (get_pcvar_num(pSound) && !get_pcvar_num(pInstant)) emit_sound(id, CHAN_BODY, "fxs/xbow_fire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_HIGH) static TaskData[2] TaskData[0] = id TaskData[1] = Hook[id] set_task(0.1, "hookthink", id + 890, TaskData, 2, "b") } else client_print(id, print_chat, "Can't create hook") } public remove_hook(id) { //Player can now throw hooks canThrowHook[id] = true // Remove the hook if it is valid if (pev_valid(Hook[id])) engfunc(EngFunc_RemoveEntity, Hook[id]) Hook[id] = 0 // Remove the line between user and hook if (is_user_connected(id)) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY, {0,0,0}, id) write_byte(99) // TE_KILLBEAM write_short(id) // entity message_end() } // Player is not hooked anymore gHooked[id] = false return 1 } // --------------------------------- ||| Class God | God Mode Power ||| --------------------------------- // public GodModeShowHUD(id) { if (!is_user_alive(id) || !God[id]) { remove_task(id); GodMode_DurationCooldown[id] = 0; fm_set_user_godmode(id, 0); return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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%s^x04 Nu mai ai GodMode.", szPrefix); remove_task(id); fm_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(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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) || !God[id]) { remove_task(id); GodMode_Cooldown[id] = 0; return PLUGIN_HANDLED; } set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11); 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%s^x04 Iti poti folosi din nou puterea.", szPrefix); remove_task(id); GodMode_Cooldown[id] = 0; } return PLUGIN_HANDLED; } // --------------------------------- ||| Stock-uri ||| --------------------------------- // // ------------------------ || Color Chat || ------------------------ // 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)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players); write_byte(players); write_string(msg); message_end(); } } } } stock ClassFalse( id ) { None[id] = false; Phoenix[id] = false; Agent_X[id] = false; eXtream[id] = false; God[id] = false; } stock get_weapon_attackment(id, Float:output[3], Float:fDis = 40.0) { new Float:vfEnd[3], viEnd[3] get_user_origin(id, viEnd, 3) IVecFVec(viEnd, vfEnd) new Float:fOrigin[3], Float:fAngle[3] pev(id, pev_origin, fOrigin) pev(id, pev_view_ofs, fAngle) xs_vec_add(fOrigin, fAngle, fOrigin) new Float:fAttack[3] xs_vec_sub(vfEnd, fOrigin, fAttack) xs_vec_sub(vfEnd, fOrigin, fAttack) new Float:fRate fRate = fDis / vector_length(fAttack) xs_vec_mul_scalar(fAttack, fRate, fAttack) xs_vec_add(fOrigin, fAttack, output) } // Stock by Chaosphere stock get_user_hitpoint(id, Float:hOrigin[3]) { if (!is_user_alive(id)) return 0 static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3] static Float:fTemp[3] pev(id, pev_origin, fOrigin) pev(id, pev_v_angle, fvAngle) pev(id, pev_view_ofs, fvOffset) xs_vec_add(fOrigin, fvOffset, fvOrigin) engfunc(EngFunc_AngleVectors, fvAngle, feOrigin, fTemp, fTemp) xs_vec_mul_scalar(feOrigin, 8192.0, feOrigin) xs_vec_add(fvOrigin, feOrigin, feOrigin) static tr engfunc(EngFunc_TraceLine, fvOrigin, feOrigin, 0, id, tr) get_tr2(tr, TR_vecEndPos, hOrigin) //global_get(glb_trace_endpos, hOrigin) return 1 } stock statusMsg(id, szMsg[], {Float,_}:...) { static iStatusText if (!iStatusText) iStatusText = get_user_msgid("StatusText") static szBuffer[512] vformat(szBuffer, charsmax(szBuffer), szMsg, 3) message_begin((id == 0) ? MSG_ALL : MSG_ONE, iStatusText, _, id) write_byte(0) // Unknown write_string(szBuffer) // Message message_end() return 1 } public plugin_end() { new Nvault = nvault_open("FurienXPSystem"); nvault_close( Nvault ); }
Return to “Modificari pluginuri”
Jump to
- eXtream - Forum
- ↳ Steam
- ↳ Forum
- ↳ WebDesign
- ↳ Incepatori
- ↳ Cos de reciclare
- ↳ Discutii generale
- ↳ Anunturi
- ↳ Security zone
- ↳ Filme si seriale
- ↳ Reclamatii
- ↳ Entertainment
- ↳ Distractie
- ↳ Clubul eXtreamCS - Intra si tu ! [noi oportunitati]
- eXtream - Echipa
- ↳ Productia eXtream
- ↳ Harti eXtream
- ↳ CS.eXtreamCS.com - Server oficial eXtreamCS
- ↳ Zona administrativă
- ↳ Cereri acces
- ↳ Cereri unban
- ↳ Reclamații
- ↳ Admin zone
- ↳ CS2.eXtreamCS.com - Server official eXtreamCS
- ↳ XMAS.eXtreamCS.com
- ↳ Cereri admin
- ↳ Cereri unban
- ↳ Reclamatii / Sugestii
- ↳ eXtreamCS #PubMasters
- eXtream - Counter-Strike 2
- ↳ Counter-Strike 2
- eXtream - Counter-Strike 1.6
- ↳ Diverse
- ↳ Filme gaming
- ↳ Meciuri
- ↳ Tutoriale
- ↳ Tutoriale
- ↳ Cereri
- ↳ Discutii generale
- ↳ Probleme la servere dedicate de Counter-Strike
- ↳ Cereri admin / slot
- ↳ Probleme in jocul Counter-Strike
- ↳ Pluginuri
- ↳ Pluginuri eXtream
- ↳ Cereri
- ↳ AdminMod
- ↳ AmxModX
- ↳ Resurse
- ↳ Moduri
- ↳ Addon-uri
- ↳ Kit-uri
- ↳ Harti
- ↳ Diverse
- ↳ Cereri
- ↳ Servere
- ↳ Programarea CS-ului
- ↳ Scripting
- ↳ Modificari pluginuri
- ↳ CStrike
- ↳ Cereri
- eXtream - Counter Strike Global Offensive
- ↳ Diverse
- ↳ Meciuri
- ↳ Tutoriale
- ↳ Probleme la servere dedicate de Counter-Strike: Global Offensive
- ↳ Probleme in jocul Counter-Strike: Global Offensive
- ↳ Pluginuri
- ↳ Cereri
- ↳ Resurse
- ↳ Addons-uri
- ↳ Hărți
- ↳ Diverse
- ↳ Servere
- eXtream - Counter-Strike Source
- ↳ Tutoriale
- ↳ Pluginuri
- ↳ Servere
- ↳ Resurse
- ↳ Harti
- ↳ Moduri
- ↳ Diverse
- ↳ Classic » CS
- ↳ Anunțuri administrative
- ↳ Cereri admin/slot
- ↳ Cereri unban
- ↳ Reclamații
- ↳ Banlist
- ↳ Admins Only
- ↳ Discord