Modificare plugin shop

Aici se vor face cererile de pluginuri AMXX sau AdminMod!
Post Reply
User avatar
LOLpgl
Nou Venit
Nou Venit
Posts: 8
Joined: Thu Apr 02, 2015 8:29 pm
Detinator Steam: Nu
Cunostinte CS: Nu prea bune
Contact:

Modificare plugin shop

Post by LOLpgl »

As vrea ca:

- HP si AP sa poate fi cumparate odata la 3 secunde
- sa rezolvati bugul de la grenazi deoarece merge cumparata una pe runda si ar trbuie sa merga odata la 5 sec
- Packul sa poata fi luat odata pe runda
[code]#include < amxmodx > #include < amxmisc> #include < engine > #include < cstrike > #include < fun > #include < hamsandwich > #include < fakemeta_util > native fcs_get_user_credits(id); native fcs_set_user_credits(id, credits); #define PLUGIN "Furien Shop" #define VERSION "0.1" #define IsPlayer(%0) ( 1 <= %0 <= g_iMaxPlayers ) // -- | Shop | -- // new const Prefix[ ] = "^x04[SHOP]^x01"; // == | Super-Knife | == // new bool:Katana [ 33 ]; new v_Katana [ 66 ] = "models/v_sk2.mdl"; //new p_Katana [ 66 ] = "models/lolpgl/p_dfknife.mdl"; // -- | Take Damage | -- // new g_iMaxPlayers; new bool: HaveNoFlash [ 33 ]; new g_msgScreenFade; // -- | Pet | -- // #define fm_precache_model(%1) engfunc(EngFunc_PrecacheModel,%1) #define fm_precache_sound(%1) engfunc(EngFunc_PrecacheSound,%1) #define fm_remove_entity(%1) engfunc(EngFunc_RemoveEntity, %1) #define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2) #define fm_set_user_gravity(%1,%2) set_pev(%1,pev_gravity,%2) #define PET_FLAG pev_flTimeStepSound #define PET_KILLED 389 static const pet_model[] = "models/stukabat.mdl" static const pet_sounds[][] = { "bullchicken/bc_die1.wav", "bullchicken/bc_die2.wav", "bullchicken/bc_die3.wav", "bullchicken/bc_idle1.wav", "bullchicken/bc_pain3.wav" } static const pet_idle = 13 static const pet_run = 13 static const pet_die = 5 static const Float:pet_idle_speed = 0.3 static const Float:pet_run_speed = 10.0 static const Float:player_gravity = 0.65 new item_pet[33] new item_have[33] new item_at_spawn[33] new Float:item_leaptime[33] new bool:g_has_speed[33] new maxplayers, g_msgSayText new Pet[33], Pack[33]; new CountF[33] = 0, CountH[33] = 0; new Restrict[33], RestrictF[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, "Truth"); //Register Shop register_clcmd("say /shop", "FurienShop" ); register_clcmd("say shop", "FurienShop" ); register_clcmd("say_team /shop", "FurienShop" ); register_clcmd("say_team shop", "FurienShop" ); //Register Arme register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" ); RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" ); RegisterHam ( Ham_Spawn, "player", "Spawn", true ); register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199") g_iMaxPlayers = get_maxplayers ( ); g_msgScreenFade = get_user_msgid("ScreenFade") //Pet register_event("DeathMsg","DeathMsg","a") register_event("HLTV","HLTV", "a","1=0", "2=0") register_forward(FM_Think,"FM_Think_hook") register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_hook") RegisterHam(Ham_Spawn, "player", "player_spawn", 1) maxplayers = get_maxplayers() g_msgSayText = get_user_msgid("SayText") } public plugin_precache ( ) { //Super-Knife precache_model ( v_Katana ); ///precache_model ( p_Katana ); //Pet new i = 0 for(i = 0; i < sizeof pet_sounds; i++) fm_precache_sound(pet_sounds) fm_precache_model(pet_model) } public Spawn( id ) { if ( !is_user_connected ( id ) ) return; strip_user_weapons(id) give_item(id, "weapon_knife" ); HaveNoFlash [ id ] = false; Katana [ id ] = false; Pet[id] = false; Pack[id] = false; CountF[id] = 0; CountH[id] = 0; Restrict[id] = false; RestrictF[id] = false; } public CurrWeapon ( id ) { if ( Katana [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) { set_pev ( id, pev_viewmodel2, v_Katana ); //set_pev ( id, pev_weaponmodel2, p_Katana ); } } public FurienShop ( id ) { if ( cs_get_user_team(id) == CS_TEAM_T ) { ShopFurien( id ) } if ( cs_get_user_team (id ) == CS_TEAM_CT ) { ShopAntiFurien ( id ) } } public ShopAntiFurien ( id ) { new Temp[101], credits = fcs_get_user_credits(id); formatex(Temp,100, "\yShop Anti-Furien \y:^nCreditele Tale:\r %d", credits); new menu = menu_create(Temp, "AntiFurien") menu_additem(menu, "\yPack HP si AP [\r9 Credite\y]", "1", 0); menu_additem(menu, "\y50AP [\r3 Credite\y]", "2", 0); menu_additem(menu, "\y50HP [\r3 Credite\y]", "3", 0); menu_additem(menu, "\yHe Grenade [\r3 Credite\y]", "4", 0); menu_additem(menu, "\yFrostNade [\r3 Credite\y]", "5", 0); menu_additem(menu, "\yNo Flash [\r5 Credite\y]^n", "6", 0); menu_additem(menu, "\yAnimal-Pet [\r15 Credite\y]", "7", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public ShopFurien( id ) { new Temp[101], credits = fcs_get_user_credits(id); formatex(Temp,100, "\yShop Furien \y:^nCreditele Tale:\r %d", credits); new menu = menu_create(Temp, "Furien") menu_additem(menu, "\ySuper Knife x2 DMG [\r15 Credite\y]", "1", 0); menu_additem(menu, "\yPack HP + AP [\r9 Credite\y]", "2", 0 ); menu_additem(menu, "\y50AP [\r3 Credite\y]", "3", 0); menu_additem(menu, "\y50HP [\r3 Credite\y]", "4", 0 ); menu_additem(menu, "\yHe Grenade [\r3 Credite\y]", "5", 0); menu_additem(menu, "\yFrostNade [\r3 Credite\y]", "6", 0); menu_additem(menu, "\yNo Flash [\r5 Credite\y]", "7", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public Furien(id, menu, item) { if( item == MENU_EXIT ) { return 1; } new data [ 6 ], szName [ 64 ]; new access, callback; menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback ); new key = str_to_num ( data ); switch ( key ) { case 1: { if( get_user_team(id) == 1 ) { if(Katana[ id ]) { ColorChat( id, "%s Ai deja acest item.", Prefix); return 1; } new iCredits = fcs_get_user_credits ( id ) - 15; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai credite suficiente.", Prefix); return 1; } else { Katana [ id ] = true; CurrWeapon(id); ColorChat(id, "%s Ai cumparat Super Knife x2 DMG.", Prefix ); fcs_set_user_credits(id, iCredits); } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 2: { if( get_user_team(id) == 1 ) { new iCredits = fcs_get_user_credits ( id ) - 9; if( iCredits < 0 ) { ColorChat( id, "!%s Nu ai suficiente credite.", Prefix); return 1; } else { new Health = get_user_health ( id ); if ( Health < 250 ) { fm_set_user_health( id, 250 ); fm_set_user_armor( id, 250 ); ColorChat(id, "%s Ai cumparat Pack HP si AP.", Prefix ); fcs_set_user_credits ( id, iCredits ); return 1; } if ( Health >= 250 ) { ColorChat( id, "%s Ai atins limita de HP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 3: { if( get_user_team(id) == 1 ) { new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix ); return 1; } else { new Armor = get_user_armor ( id ); if ( Armor < 300 ) { fm_set_user_armor( id, get_user_armor ( id ) + 50 ); ColorChat(id, "%s Ai cumparat 50 AP.", Prefix ); fcs_set_user_credits ( id, iCredits ); return 1; } if ( Armor >= 300 ) { ColorChat( id, "%s Ai atins limita de AP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 4: { if( get_user_team(id) == 1 ) { new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "!%s Nu ai suficiente credite.", Prefix); return 1; } else { new Health = get_user_health ( id ); if ( Health < 250 ) { fm_set_user_health( id, get_user_health ( id ) + 50 ); ColorChat(id, "%s Ai cumparat 50 HP.", Prefix ); fcs_set_user_credits ( id, iCredits ); return 1; } if ( Health >= 250 ) { ColorChat( id, "%s Ai atins limita de HP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 5: { if( get_user_team(id) == 1 ) { if(Restrict[id]) { ColorChat(id, "%s Poti cumpara doar odata la 5 secunde.", Prefix ); return 1; } if(CountH[id] == 4) { ColorChat(id, "%s Ai atins limita de HE.", Prefix ); return 1; } if( get_user_weapon(id) == CSW_HEGRENADE) { ColorChat(id, "%s Detii deja un HE.", Prefix ); } new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix); return 1; } else { CountH[id]++; Restrict[id] = true; set_task(4.0, "RestrictHE", id); fm_give_item(id, "weapon_hegrenade"); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 6: { if( get_user_team(id) == 1 ) { if(RestrictF[id]) { ColorChat(id, "%s Poti cumpara doar odata la 5 secunde.", Prefix ); return 1; } if(CountF[id] == 4) { ColorChat(id, "%s Ai atins limita de Forst Nade.", Prefix ); return 1; } if( get_user_weapon(id) == CSW_SMOKEGRENADE) { ColorChat(id, "%s Detii deja un FrostNade.", Prefix ); } new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix); return 1; } else { CountF[id]++; RestrictF[id] = true; set_task(4.0, "RestrictieFN", id); fm_give_item(id, "weapon_smokegrenade"); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } case 7: { if( get_user_team(id) == 1 ) { if(HaveNoFlash[id]) { ColorChat( id, "%s Ai deja NoFlash.", Prefix); return 1; } new iCredits = fcs_get_user_credits ( id ) - 5; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix); return 1; } else { HaveNoFlash [ id ] = true; ColorChat(id, "%s Ai cumparat No Flash.", Prefix ); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Teroristi au acces la accest meniu.", Prefix ); } } } menu_destroy(menu); return 1; } public AntiFurien(id, menu, item ) { if( item == MENU_EXIT ) { return 1; } new data [ 6 ], szName [ 64 ]; new access, callback; menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback ); new key = str_to_num ( data ); switch ( key ) { case 1: { if( get_user_team(id) == 2 ) { if(Pet[id]) { ColorChat(id, "%s Poti cumpara pack-ul doar fara pet.", Prefix); return 1; } new iCredits = fcs_get_user_credits ( id ) - 9; if( iCredits < 0 ) { ColorChat( id, "!%s Nu ai suficiente credite.", Prefix); return 1; } else { new Health = get_user_health ( id ); if ( Health < 250 ) { fm_set_user_health( id, 250 ); fm_set_user_armor( id, 250 ); ColorChat(id, "%s Ai cumparat Pack HP si AP.", Prefix ); Pack[id] = true; fcs_set_user_credits ( id, iCredits ); return 1; } if ( Health >= 250 ) { ColorChat( id, "%s Ai atins limita de HP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 2: { if( get_user_team(id) == 2 ) { new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix ); return 1; } else { new Armor = get_user_armor ( id ); if ( Armor < 300 ) { fm_set_user_armor( id, get_user_armor ( id ) + 50 ); ColorChat(id, "%s Ai cumparat 50 AP.", Prefix ); fcs_set_user_credits ( id, iCredits ); return 1; } if ( Armor >= 300 ) { ColorChat( id, "%s Ai atins limita de AP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 3: { if( get_user_team(id) == 2 ) { new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "!%s Nu ai suficiente credite.", Prefix); return 1; } else { new Health = get_user_health ( id ); if ( Health < 250 ) { fm_set_user_health( id, get_user_health ( id ) + 50 ); ColorChat(id, "%s Ai cumparat 50 HP.", Prefix ); fcs_set_user_credits ( id, iCredits ); return 1; } if ( Health >= 250 ) { ColorChat( id, "%s Ai atins limita de HP.", Prefix); return 1; } } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 4: { if( get_user_team(id) == 2 ){ if(CountH[id] == 4) { ColorChat(id, "%s Ai atins limita de HE.", Prefix ); return 1; } if( get_user_weapon(id) == CSW_HEGRENADE){ ColorChat(id, "%s Detii deja un HE.", Prefix ); return 1; } new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ){ ColorChat( id, "%s Nu ai credite suficiente.", Prefix); return 1; } else { CountH[id]++; Restrict[id] = true; set_task(4.0, "RestrictHE", id); fm_give_item(id, "weapon_hegrenade"); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 5: { if( get_user_team(id) == 2 ) { if(RestrictF[id]) { ColorChat(id, "%s Poti cumpara doar odata la 5 secunde.", Prefix ); return 1; } if( get_user_weapon(id) == CSW_SMOKEGRENADE) { ColorChat(id, "%s Detii deja un FrostNade.", Prefix ); return 1; } if(CountF[id] == 4) { ColorChat(id, "%s Ai atins limita de Forst Nade.", Prefix ); return 1; } new iCredits = fcs_get_user_credits ( id ) - 3; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai suficiente credite.", Prefix); return 1; } else { CountF[id]++; RestrictF[id] = true; set_task(4.0, "RestrictFN", id); fm_give_item(id, "weapon_smokegrenade"); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 6: { if( get_user_team(id) == 2 ) { new iCredits = fcs_get_user_credits ( id ) - 5; if( iCredits < 0 ) { ColorChat( id, "%s Nu ai credite suficiente.", Prefix); return 1; } else { HaveNoFlash [ id ] = true; ColorChat(id, "%s Ai cumparat No Flash.", Prefix ); fcs_set_user_credits(id, iCredits); return 1; } } else { ColorChat(id, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix ); } } case 7: { if(Pack[id]) { ColorChat(id, "%s Poti cumpara pet-ul doar fara pack.", Prefix); return 1; } buypet(id); } } menu_destroy(menu); return 1; } public RestrictHE ( id ) { Restrict[id] = false; return 1; } public RestrictFN ( id ) { Restrict[id] = false; return 1; } public eventFlash(id) { if(is_user_connected(id) && HaveNoFlash [ id ]) { message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id) write_short(1) write_short(1) write_short(1) write_byte(0) write_byte(0) write_byte(0) write_byte(255) message_end() } } public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) { if ( IsPlayer ( iAttacker ) ) { if( iInflictor == iAttacker && Katana [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T ) { SetHamParamFloat( 4, fDamage * 2.0); return HAM_HANDLED; } } return HAM_IGNORED; } public HLTV() { new entid = -1 while((entid = fm_find_ent_by_class(entid, "zp_bat"))) { if(pev(entid,PET_FLAG) == PET_KILLED) { fm_remove_entity(entid) } } } public client_disconnect(id) remove_task(id) public DeathMsg() { new id = read_data(2) if(item_have[id]) { kill_pet(id) item_have[id] = 0 } if (!is_user_alive(id)){ return PLUGIN_HANDLED } else { if(cs_get_user_team(id) == CS_TEAM_T) item_have[id] = 0 if(g_has_speed[id]) g_has_speed[id] = false } return PLUGIN_CONTINUE; } public buypet(id) { if (!is_user_alive(id)) { ColorChat(id, "%s Nu poti cumpara pet cand esti mort.", Prefix); return PLUGIN_HANDLED; } if (cs_get_user_team(id) != CS_TEAM_CT) { ColorChat(id, "%s Numai^x03 Anti-furienii^x01 pot cumpara pet.", Prefix); return PLUGIN_HANDLED; } if (!item_have[id]) { if (fcs_get_user_credits(id) >= 15) { fcs_set_user_credits(id, fcs_get_user_credits(id) - 15); ColorChat(id, "%s Ai cumparat^x03 PET.", Prefix); create_pet(id) }else ColorChat(id, "%s Nu ai destule^x03 credite.", Prefix); }else ColorChat(id, "%s Detii deja un pet!", Prefix); return PLUGIN_CONTINUE; } public kill_pet(id) { if(pev_valid(item_pet[id])) { set_pev(item_pet[id],pev_sequence,pet_die) set_pev(item_pet[id],pev_gaitsequence,pet_die) set_pev(item_pet[id],pev_framerate,1.0) set_pev(item_pet[id],PET_FLAG,PET_KILLED) fm_drop_to_floor(item_pet[id]) item_have[id] = 0 g_has_speed[id] = false } item_pet[id] = 0 } public player_spawn(player) { if(is_user_alive(player)) { if (cs_get_user_team(player) != CS_TEAM_CT) { kill_pet(player) item_have[player] = 0 } if(item_have[player]) { fm_set_user_gravity(player, player_gravity) set_user_health(player, get_user_health(player) + 250) set_user_armor(player, get_user_armor(player) + 350) g_has_speed[player] = true } else if(item_at_spawn[player]) { create_pet(player) item_at_spawn[player] = 0 g_has_speed[player] = true } } } public create_pet(id) { if(item_have[id]) { ColorChat(id, "%s Detii deja un^x03 pet.", Prefix) return PLUGIN_HANDLED } else if(!is_user_alive(id)) { ColorChat(id, "%s Petul iti va aparea runda viitoare.", Prefix) item_at_spawn[id] = 1 return PLUGIN_HANDLED } else { item_pet[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target")) set_pev(item_pet[id],pev_classname,"zp_bat") engfunc(EngFunc_SetModel,item_pet[id],pet_model) new Float:origin[3] pev(id,pev_origin,origin) set_pev(item_pet[id],pev_origin,origin) set_pev(item_pet[id],pev_solid,SOLID_TRIGGER) set_pev(item_pet[id],pev_movetype,MOVETYPE_FLY) set_pev(item_pet[id],pev_owner,33) set_pev(item_pet[id],pev_nextthink,1.0) set_pev(item_pet[id],pev_sequence,0) set_pev(item_pet[id],pev_gaitsequence,0) set_pev(item_pet[id],pev_framerate,1.0) set_pev(item_pet[id], pev_renderfx, kRenderFxGlowShell) set_pev(item_pet[id], pev_rendercolor, Float:{0.0, 0.0, 200.0}) fm_set_user_gravity(id,player_gravity) set_user_health(id, 400) set_user_armor(id, 400) engfunc(EngFunc_EmitSound,item_pet[id],CHAN_AUTO,pet_sounds[random_num(0,sizeof pet_sounds - 1)],1.0, 1.2, 0, PITCH_NORM) item_have[id] = 1 g_has_speed[id] = true } return PLUGIN_HANDLED } public FM_Think_hook(ent) { for(new i = 0; i <= maxplayers; i++) { if(ent == item_pet) { static Float:origin[3] static Float:origin2[3] static Float:velocity[3] pev(ent,pev_origin,origin2) get_offset_origin_body(i,Float:{50.0,0.0,0.0},origin) if(get_distance_f(origin,origin2) > 300.0) { set_pev(ent,pev_origin,origin) } else if(get_distance_f(origin,origin2) > 80.0) { get_speed_vector(origin2,origin,250.0,velocity) set_pev(ent,pev_velocity,velocity) if(pev(ent,pev_sequence) != pet_run || pev(ent,pev_framerate) != pet_run_speed) { set_pev(ent,pev_sequence,pet_run) set_pev(ent,pev_gaitsequence,pet_run) set_pev(ent,pev_framerate,pet_run_speed) } } else if(get_distance_f(origin,origin2) < 75.0) { if(pev(ent,pev_sequence) != pet_idle || pev(ent,pev_framerate) != pet_idle_speed) { set_pev(ent,pev_sequence,pet_idle) set_pev(ent,pev_gaitsequence,pet_idle) set_pev(ent,pev_framerate,pet_idle_speed) } set_pev(ent,pev_velocity,Float:{0.0,0.0,0.0}) } pev(i,pev_origin,origin) origin[2] = origin2[2] entity_set_aim(ent,origin) set_pev(ent,pev_nextthink,1.0) break } } } public FM_PlayerPreThink_hook(id) { if (!is_user_alive(id)) return if(allowed_leap(id)) { static Float:velocity[3] velocity_by_aim(id, 500, velocity) velocity[2] = 300.0 set_pev(id, pev_velocity, velocity) item_leaptime[id] = get_gametime() } } public allowed_leap(id) { if(!item_have[id]) return false if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80) return false static buttons buttons = pev(id, pev_button) if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK))) return false if (get_gametime() - item_leaptime[id] < 3) return false return true } public is_a_player(ent) { if(ent > 0 && ent < 33) return true return false } public remove_pet(ent) { if(pev_valid(ent)) fm_remove_entity(ent) } stock get_offset_origin_body(ent,const Float:offset[3],Float:origin[3]) { if(!pev_valid(ent)) return 0; new Float:angle[3] pev(ent,pev_angles,angle) pev(ent,pev_origin,origin) origin[0] += floatcos(angle[1],degrees) * offset[0] origin[1] += floatsin(angle[1],degrees) * offset[0] origin[1] += floatcos(angle[1],degrees) * offset[1] origin[0] += floatsin(angle[1],degrees) * offset[1] return 1; } stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3]) { new_velocity[0] = origin2[0] - origin1[0] new_velocity[1] = origin2[1] - origin1[1] new_velocity[2] = origin2[2] - origin1[2] new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2])) new_velocity[0] *= num new_velocity[1] *= num new_velocity[2] *= num return 1; } stock entity_set_aim(ent,const Float:origin2[3],bone=0) { if(!pev_valid(ent)) return 0; static Float:origin[3] origin[0] = origin2[0] origin[1] = origin2[1] origin[2] = origin2[2] static Float:ent_origin[3], Float:angles[3] if(bone) engfunc(EngFunc_GetBonePosition,ent,bone,ent_origin,angles) else pev(ent,pev_origin,ent_origin) origin[0] -= ent_origin[0] origin[1] -= ent_origin[1] origin[2] -= ent_origin[2] static Float:v_length v_length = vector_length(origin) static Float:aim_vector[3] aim_vector[0] = origin[0] / v_length aim_vector[1] = origin[1] / v_length aim_vector[2] = origin[2] / v_length static Float:new_angles[3] vector_to_angle(aim_vector,new_angles) new_angles[0] *= -1 if(new_angles[1]>180.0) new_angles[1] -= 360 if(new_angles[1]<-180.0) new_angles[1] += 360 if(new_angles[1]==180.0 || new_angles[1]==-180.0) new_angles[1]=-179.999999 set_pev(ent,pev_angles,new_angles) set_pev(ent,pev_fixangle,1) return 1; } stock ColorChat(id, const input[], any:...) { static iPlayersNum[32], iCount; iCount = 1 static szMsg[191] vformat(szMsg, charsmax(szMsg), input, 3) replace_all(szMsg, 190, "/g", "^x04") // green txt replace_all(szMsg, 190, "/y", "^x01") // orange txt replace_all(szMsg, 190, "/ctr", "^x03") // team txt replace_all(szMsg, 190, "/w", "^x00") // team txt if(id) iPlayersNum[0] = id else get_players(iPlayersNum, iCount, "ch") for (new i = 0; i < iCount; i++) { if (is_user_connected(iPlayersNum)) { message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum) write_byte(iPlayersNum) write_string(szMsg) message_end() } } }[/code]
Last edited by LOLpgl on Sun Apr 12, 2015 12:01 pm, edited 1 time in total.
.:: FURY.REALCS.RO ::. @ Furien V3.0

Image
User avatar
CryWolf
Sys Admin
Sys Admin
Posts: 398
Joined: Tue Dec 15, 2009 11:32 am
Detinator Steam: Da
Cunostinte CS: Excelente
Reputatie: Detinator
Webmaster
Scripter
Trance Fan
Location: Botosani
Contact:

Re: Modificare plugin shop

Post by CryWolf »

Sincer eu nu vad in .SMA restrictiile de care mentionezi tu , esti singur ca exista ?
Info: NU IMI DATI PM PENTRU CERERI AJUTOR ETC (NU RASPUND) FOLOSITI FORUMUL.
Image

Image
CUM SA NU LUPTI PENTRU IUBIRE ????
Daca lupti,inseamna ca vrei sa castigi ceva.Iubirea nu-i o miza.
User avatar
LOLpgl
Nou Venit
Nou Venit
Posts: 8
Joined: Thu Apr 02, 2015 8:29 pm
Detinator Steam: Nu
Cunostinte CS: Nu prea bune
Contact:

Re: Modificare plugin shop

Post by LOLpgl »

Da exista cauta pe acolo e ceva cu Restrict :)
.:: FURY.REALCS.RO ::. @ Furien V3.0

Image
User avatar
LOLpgl
Nou Venit
Nou Venit
Posts: 8
Joined: Thu Apr 02, 2015 8:29 pm
Detinator Steam: Nu
Cunostinte CS: Nu prea bune
Contact:

Re: Modificare plugin shop

Post by LOLpgl »

UP!!!
.:: FURY.REALCS.RO ::. @ Furien V3.0

Image
Post Reply