Ieskau parasiuto

Kalbos apie viską kas nesusiję su kitais forumais.
Post Reply
VdL
Ar galit patikėti? Jis jau parašė 20 žinučių
Posts: 21
Joined: 2016 Oct 07 15:57
Skype: agar.io707

Ieskau parasiuto

Post by VdL »

Sveiki ieskau parasiuto tarp public serverio pvz kaip paspaudi e raide tada skrenda ir kad butu parasiutas skirtas tik VIP,ADMIN ir taip t.t aciu uz pagalba

Terror
Senbūvis
Posts: 1086
Joined: 2015 Feb 27 19:29
Location: Alytus

Re: Ieskau parasiuto

Post by Terror »

Prašau gero naudojimo.

Code: Select all

#include <amxmodx>#include <fakemeta>#include <hamsandwich>#include <engine> new PLUGIN_NAME[]       = "Parasiutas"new PLUGIN_AUTHOR[]     = "GuM"new PLUGIN_VERSION[]    = "1.0" new const parachute_model[] = "models/parachute.mdl" new bool:has_parachute[33]new para_ent[33]new parachute_FallSpeed, parachute_Detach public plugin_init(){    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)     parachute_FallSpeed = register_cvar("parachute_fallspeed", "30")    parachute_Detach = register_cvar("parachute_detach", "1")     RegisterHam(Ham_Spawn, "player", "Ham_PlayerSpawn", 1);     register_forward(FM_PlayerPreThink,"PlayerPree_Think");}public plugin_precache(){    engfunc(EngFunc_PrecacheModel, parachute_model)} public Ham_PlayerSpawn(id){    if (!is_user_alive(id))        return     if (get_user_flags(id) & ADMIN_LEVEL_H)        has_parachute[id] = true} public PlayerPree_Think(id){     if (!is_user_alive(id) || !has_parachute[id] || !(get_user_flags(id) & ADMIN_LEVEL_H))        return     new Float:fallspeed = get_pcvar_float(parachute_FallSpeed) * -1.0    new Float:frame     new button = pev(id, pev_button)    new oldbutton = pev(id, pev_oldbuttons)    new flags = pev(id, pev_flags)     if (para_ent[id] > 0 && (flags & FL_ONGROUND))    {        set_view(id, CAMERA_NONE)               if (get_pcvar_num(parachute_Detach))        {            if ( pev(para_ent[id],pev_sequence) != 2 )            {                set_pev(para_ent[id], pev_sequence, 2)                set_pev(para_ent[id], pev_gaitsequence, 1)                set_pev(para_ent[id], pev_frame, 0.0)                set_pev(para_ent[id], pev_fuser1, 0.0)                set_pev(para_ent[id], pev_animtime, 0.0)                return            }                         pev(para_ent[id],pev_fuser1, frame)            frame += 2.0            set_pev(para_ent[id],pev_fuser1,frame)            set_pev(para_ent[id],pev_frame,frame)                       if ( frame > 254.0 )            {                engfunc(EngFunc_RemoveEntity, para_ent[id])                para_ent[id] = 0            }        }        else        {            engfunc(EngFunc_RemoveEntity, para_ent[id])            para_ent[id] = 0        }        return    }     if (button & IN_USE && get_user_team(id) == 2)    {        new Float:velocity[3]        pev(id, pev_velocity, velocity)               if (velocity[2] < 0.0)        {            if(para_ent[id] <= 0)            {                para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))                               if(para_ent[id] > 0)                {                    set_pev(para_ent[id],pev_classname,"parachute")                    set_pev(para_ent[id], pev_aiment, id)                    set_pev(para_ent[id], pev_owner, id)                    set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW)                    engfunc(EngFunc_SetModel, para_ent[id], parachute_model)                    set_pev(para_ent[id], pev_sequence, 0)                    set_pev(para_ent[id], pev_gaitsequence, 1)                    set_pev(para_ent[id], pev_frame, 0.0)                    set_pev(para_ent[id], pev_fuser1, 0.0)                }            }                       if (para_ent[id] > 0)            {                set_pev(id, pev_sequence, 3)                set_pev(id, pev_gaitsequence, 1)                set_pev(id, pev_frame, 1.0)                set_pev(id, pev_framerate, 1.0)                           velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed                set_pev(id, pev_velocity, velocity)                               if (pev(para_ent[id],pev_sequence) == 0)                {                    pev(para_ent[id],pev_fuser1, frame)                    frame += 1.0                    set_pev(para_ent[id],pev_fuser1,frame)                    set_pev(para_ent[id],pev_frame,frame)                                       if (frame > 100.0)                    {                        set_pev(para_ent[id], pev_animtime, 0.0)                        set_pev(para_ent[id], pev_framerate, 0.4)                        set_pev(para_ent[id], pev_sequence, 1)                        set_pev(para_ent[id], pev_gaitsequence, 1)                        set_pev(para_ent[id], pev_frame, 0.0)                        set_pev(para_ent[id], pev_fuser1, 0.0)                    }                }            }        }               else if (para_ent[id] > 0)        {            engfunc(EngFunc_RemoveEntity, para_ent[id])            para_ent[id] = 0        }    }       else if ((oldbutton & IN_USE) && para_ent[id] > 0 )    {        engfunc(EngFunc_RemoveEntity, para_ent[id])        para_ent[id] = 0    }}

User avatar
laimiukas3
Moderatorius
Posts: 4569
Joined: 2012 Aug 03 01:12
Skype: laimiukas3
Location: Vilnius
Contact:

Re: Ieskau parasiuto

Post by laimiukas3 »

Image

naudoti su ReAPI 0.1.62-dev arba naujesniu moduliu

jaigu su privilegija tai

Code: Select all

if (!(get_user_flags(playerIndex) & ADMIN_LEVEL_H)    || !(get_entvar(playerIndex, var_button) & IN_USE)    || get_entvar(playerIndex, var_waterlevel) > 0) {        return;    }
Attachments
parachute.sma
(732 Bytes) Downloaded 623 times
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests