[rezolvat] Cerere plugin pet

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
Seve
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 555
Joined: 18 Aug 2012, 10:19
Detinator Steam: Da
Detinator server CS: GO.PLAYSIBIU.COM
SteamID: sevecsgo
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios (tepar)
Has thanked: 83 times
Been thanked: 39 times
Contact:

03 Nov 2013, 17:06

Doresc un plugin pet. Cu tot cu modele.
Va astept pe Go.PlaySibiu.Com [RO/128 tickrate]
Image
Zonek
User avatar
CaTa.
Fost moderator
Fost moderator
Posts: 420
Joined: 28 Jul 2013, 14:06
Detinator Steam: Nu
Detinator server CS: In curand !
Reputatie: Fost Moderator ajutator
Location: Targu-Mures
Has thanked: 99 times
Been thanked: 19 times
Contact:

03 Nov 2013, 17:42

Seve wrote:Doresc un plugin pet. Cu tot cu modele.
adica ? modele ?
eu cand l-am pus pe server n-am avut nevoie de modele !! :P
CLICK ! | Afiseaza codul
Ma gasesti pe Messenger la id :[/b] stelyistu_95@yahoo.com
Follow me on Instagram
Fa-ti cunoscut serverul de Counter-Strike pe facebook ! 
Fa-ti reclama gratis aici Click
My Plugin Furien Guns
User avatar
Seve
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 555
Joined: 18 Aug 2012, 10:19
Detinator Steam: Da
Detinator server CS: GO.PLAYSIBIU.COM
SteamID: sevecsgo
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios (tepar)
Has thanked: 83 times
Been thanked: 39 times
Contact:

03 Nov 2013, 18:46

Sorry, imi puteti da si mie un plugin de pet :)
Va astept pe Go.PlaySibiu.Com [RO/128 tickrate]
Image
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

03 Nov 2013, 18:49

Poftim o sa revin cu edit si iti dau si modelele ;)
| Afiseaza codul
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
#include <fun>
 

fcs_get_user_credits( iPlugin, iParams )
fcs_set_user_credits(  iPlugin, iParams  )
 



#define PLUGIN "Furien: Bat"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
 
#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_drop_to_floor(%1)            engfunc(EngFunc_DropToFloor,%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
 
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        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)    
        //RegisterHam(Ham_Touch, "info_target", "player_touch")
       
        register_clcmd("say /pet", "buypet")
        register_clcmd("say_team /pet", "buypet")
       
        maxplayers = get_maxplayers()
        g_msgSayText = get_user_msgid("SayText")
}
 
public plugin_natives()
        register_native("set_user_pet", "native_set_pet", 1)
       
public native_set_pet(id)
        create_pet(id)
 
public plugin_precache()
{
        new i = 0
       
        for(i = 0; i < sizeof pet_sounds; i++)
                fm_precache_sound(pet_sounds)
       
        fm_precache_model(pet_model)
}
 
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 DeathMsg()
{
        new id = read_data(2)
       
        if(item_have[id])
        {
                kill_pet(id)
                item_have[id] = 0
        }
               
        if(cs_get_user_team(id) == CS_TEAM_T)
                item_have[id] = 0
       
        if(g_has_speed[id])
                g_has_speed[id] = false
}
 
public buypet(id)
{
        if (!is_user_alive(id))
        {
                client_printcolor(id, "^4[Furien Pet]^1 Nu poti cumpara pet cand esti mort.");
                return PLUGIN_HANDLED;
        }
 
        if (cs_get_user_team(id) != CS_TEAM_CT)
        {
                client_printcolor(id, "^4[Furien Pet]^1 Numai^3 Anti-furienii^1 pot cumpara pet.");
                return PLUGIN_HANDLED;
        }
       
        if (!item_have[id])
        {      
                if (furien_get_user_credits(id) >= 30)
                {
                        furien_set_user_credits(id, furien_get_user_credits(id) - 30);
                        client_printcolor(id, "^4[Furien Pet]^1 Ai cumparat^3 PET.");
                        create_pet(id)
                }else
                        client_printcolor(id, "^4[Furien Pet]^1 Nu ai destule^3 credite.");
        }else
                        client_printcolor(id, "^4[Furien Pet]^1 Detii deja un pet!");
               
        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])
        {
                client_printcolor(id, "^4[Furien Pet]^1 Detii deja un^3 pet.")
                return PLUGIN_HANDLED
        }
        else if(!is_user_alive(id))
        {
                client_printcolor(id, "^4[Furien Pet]^1 Petul iti va aparea runda viitoare.")
                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, get_user_health(id) + 250)
                set_user_armor(id, get_user_armor(id) + 350)
               
                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)
}
 
// Get entity's speed (from fakemeta_util)
stock fm_get_speed(entity)
{
        static Float:velocity[3]
        pev(entity, pev_velocity, velocity)
       
        return floatround(vector_length(velocity));
}
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 client_printcolor(id, const input[], any:...)
{
        static iPlayersNum[32], iCount; iCount = 1
        static szMsg[191]
       
        vformat(szMsg, charsmax(szMsg), input, 3)
       
        replace_all(szMsg, 190, "/g", "^4") // green txt
        replace_all(szMsg, 190, "/y", "^1") // orange txt
        replace_all(szMsg, 190, "/ctr", "^3") // team txt
        replace_all(szMsg, 190, "/w", "^0") // 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()
                }
        }
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Assassin.
Membru, skill +1
Membru, skill +1
Posts: 173
Joined: 15 Sep 2013, 12:49
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 3 times
Contact:

05 Nov 2013, 11:34

ne dai si modelele ???
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

05 Nov 2013, 12:17

P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Assassin.
Membru, skill +1
Membru, skill +1
Posts: 173
Joined: 15 Sep 2013, 12:49
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 3 times
Contact:

05 Nov 2013, 12:59

Dc nu mere eu am pluginul cu credite al lui askhanar si nu imi mere pluginu imi da error la compilat
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

05 Nov 2013, 13:10

Poftim acesta nu da nici o eroare :) :
| Afiseaza codul
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fcs>


#define PLUGIN "Furien: Bat"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
 
#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_drop_to_floor(%1)            engfunc(EngFunc_DropToFloor,%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
 
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        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)    
        //RegisterHam(Ham_Touch, "info_target", "player_touch")
       
        register_clcmd("say /pet", "buypet")
        register_clcmd("say_team /pet", "buypet")
       
        maxplayers = get_maxplayers()
        g_msgSayText = get_user_msgid("SayText")
}
 
public plugin_natives()
        register_native("set_user_pet", "native_set_pet", 1)
       
public native_set_pet(id)
        create_pet(id)
 
public plugin_precache()
{
        new i = 0
       
        for(i = 0; i < sizeof pet_sounds; i++)
                fm_precache_sound(pet_sounds)
       
        fm_precache_model(pet_model)
}
 
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 DeathMsg()
{
        new id = read_data(2)
       
        if(item_have[id])
        {
                kill_pet(id)
                item_have[id] = 0
        }
               
        if(cs_get_user_team(id) == CS_TEAM_T)
                item_have[id] = 0
       
        if(g_has_speed[id])
                g_has_speed[id] = false
}
 
public buypet(id)
{
        if (!is_user_alive(id))
        {
                client_printcolor(id, "^4[Furien Pet]^1 Nu poti cumpara pet cand esti mort.");
                return PLUGIN_HANDLED;
        }
 
        if (cs_get_user_team(id) != CS_TEAM_CT)
        {
                client_printcolor(id, "^4[Furien Pet]^1 Numai^3 Anti-furienii^1 pot cumpara pet.");
                return PLUGIN_HANDLED;
        }
       
        if (!item_have[id])
        {      
                if (fcs_get_user_credits(id) >= 30)
                {
                        fcs_set_user_credits(id, fcs_get_user_credits(id) - 30);
                        client_printcolor(id, "^4[Furien Pet]^1 Ai cumparat^3 PET.");
                        create_pet(id)
                }else
                        client_printcolor(id, "^4[Furien Pet]^1 Nu ai destule^3 credite.");
        }else
                        client_printcolor(id, "^4[Furien Pet]^1 Detii deja un pet!");
               
        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])
        {
                client_printcolor(id, "^4[Furien Pet]^1 Detii deja un^3 pet.")
                return PLUGIN_HANDLED
        }
        else if(!is_user_alive(id))
        {
                client_printcolor(id, "^4[Furien Pet]^1 Petul iti va aparea runda viitoare.")
                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, get_user_health(id) + 250)
                set_user_armor(id, get_user_armor(id) + 350)
               
                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)
}
 
// Get entity's speed (from fakemeta_util)
stock fm_get_speed(entity)
{
        static Float:velocity[3]
        pev(entity, pev_velocity, velocity)
       
        return floatround(vector_length(velocity));
}
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 client_printcolor(id, const input[], any:...)
{
        static iPlayersNum[32], iCount; iCount = 1
        static szMsg[191]
       
        vformat(szMsg, charsmax(szMsg), input, 3)
       
        replace_all(szMsg, 190, "/g", "^4") // green txt
        replace_all(szMsg, 190, "/y", "^1") // orange txt
        replace_all(szMsg, 190, "/ctr", "^3") // team txt
        replace_all(szMsg, 190, "/w", "^0") // 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()
                }
        }
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Assassin.
Membru, skill +1
Membru, skill +1
Posts: 173
Joined: 15 Sep 2013, 12:49
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 3 times
Contact:

05 Nov 2013, 13:14

Ms Am rezolvat dar sti cum sa il pun in shop adica sa il cumperi din shop
User avatar
Seve
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 555
Joined: 18 Aug 2012, 10:19
Detinator Steam: Da
Detinator server CS: GO.PLAYSIBIU.COM
SteamID: sevecsgo
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios (tepar)
Has thanked: 83 times
Been thanked: 39 times
Contact:

05 Nov 2013, 13:47

Vorbesti cu un scripter sau faci o cerere in modificare pluginuri!
Va astept pe Go.PlaySibiu.Com [RO/128 tickrate]
Image
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

05 Nov 2013, 14:35

Fa o cerere de shop daca vrei sa ti-l puna cineva in shop...
Cererea acceasta a fost de pet si sa rezolvat :) Daca vrei shop cu pet fa si tu o cerere ;)
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Post Reply

Return to “Cereri”

  • Information