Chate nemato komandos

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Locked
Kanape
Jau po truputį tampa savu
Posts: 193
Joined: 2010 Oct 23 14:26
Skype: noway_lyderis
Location: Jonava
Contact:

Chate nemato komandos

Post by Kanape »

Sveiki,
Nezinau ar cia rasau, bet manau susija.
Kaip padaryti kad tarkim parasius /bhop nerodytu chate ir nefloodintu?

Code: Select all

     #include <amxmodx>    #include <engine>         #define FL_WATERJUMP    (1<<11) // player jumping out of water    #define FL_ONGROUND (1<<9)  // At rest / on the ground           new bool:Bhop;         public plugin_init() {        register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")        register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)             register_cvar("bh_enabled", "1")        register_cvar("bh_autojump", "1")        register_cvar("bh_showusage", "1")               register_clcmd("say /bhop", "OnSayBhop");        register_clcmd("say_team /bhop", "OnSayBhop");    }         public OnSayBhop(client)    {        if (get_user_flags(client) & ADMIN_SLAY)          Bhop = !Bhop;    }         public client_PreThink(id) {        if (!Bhop || !get_cvar_num("bh_enabled"))            return PLUGIN_CONTINUE             entity_set_float(id, EV_FL_fuser2, 0.0)     // Disable slow down after jumping             if (!get_cvar_num("bh_autojump"))            return PLUGIN_CONTINUE         // Code from CBasePlayer::Jump (player.cpp)     Make a player jump automatically        if (entity_get_int(id, EV_INT_button) & 2) {    // If holding jump            new flags = entity_get_int(id, EV_INT_flags)                 if (flags & FL_WATERJUMP)                return PLUGIN_CONTINUE            if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )                return PLUGIN_CONTINUE            if ( !(flags & FL_ONGROUND) )                return PLUGIN_CONTINUE                 new Float:velocity[3]            entity_get_vector(id, EV_VEC_velocity, velocity)            velocity[2] += 250.0            entity_set_vector(id, EV_VEC_velocity, velocity)                 entity_set_int(id, EV_INT_gaitsequence, 6)  // Play the Jump Animation        }        return PLUGIN_CONTINUE    } 
Image

User avatar
hleV
AMX Mod X ekspertai
Posts: 875
Joined: 2011 Apr 02 11:23
Skype: hlev.lt
Location: Šiauliai

Re: Chate nemato komandos

Post by hleV »

Code: Select all

public OnSayBhop(client){    if (get_user_flags(client) & ADMIN_SLAY)      Bhop = !Bhop;}

Code: Select all

public OnSayBhop(client){    if (get_user_flags(client) & ADMIN_SLAY)      Bhop = !Bhop;     return PLUGIN_HANDLED;}
Image ← RIP best userbar
DISKUSIJA: KIETAS PLUGIN'O UŽSAKOVAS
Privačios pagalbos neteikiu!

Kanape
Jau po truputį tampa savu
Posts: 193
Joined: 2010 Oct 23 14:26
Skype: noway_lyderis
Location: Jonava
Contact:

Re: Chate nemato komandos

Post by Kanape »

Labai aciu +rep
Image

Locked

Who is online

Users browsing this forum: No registered users and 1 guest