Jump to content
GIGN Forum

Zm Vip Plugin


Recommended Posts

Sveiki taisu ZM VIP pluginu un saku taisīt MJ a man izmet erroru

41 error 017: undefined symbol "MODE"

71 error 017: undefined symbol "MODE"

P.S 41 un 71 ir Rinda kurā vietā tas ir.

Reku plugins:


#include <amxmodx>

#include <cstrike>

#include <amxmisc>

#include <engine>

#include <hamsandwich>

#include <zombieplague>

#define FLAG_VIP ADMIN_LEVEL_F // "q"

/*========================NEWS===================================*/

new g_jumps

new jumpnum[33]

new bool:dojump[33]

new g_bit

/*===============================================================*/

enum

{

SCOREATTRIB_ARG_PLAYERID = 1,

SCOREATTRIB_ARG_FLAGS

};

enum ( <<= 1 )

{

SCOREATTRIB_FLAG_NONE = 0,

SCOREATTRIB_FLAG_DEAD = 1,

SCOREATTRIB_FLAG_BOMB,

SCOREATTRIB_FLAG_VIP

};

public plugin_init()

{

register_plugin("ZP VIP", "1.0", "Frozen Life");

register_event("HLTV", "eventNewRound", "a", "1=0", "2=0");

g_jumps = register_cvar("zp_vip_jumps", "1")

g_bit = get_pcvar_num(register_cvar("zp_vip_allow_jump", "3"))

}

public client_PreThink(id)

{

#if MODE & (1<<0)

if(!is_user_alive(id) || !g_jumps || (!(g_user_privileges[id] & FLAG_VIP))) return PLUGIN_CONTINUE

#else

if(!is_user_alive(id) || !g_jumps || (!(get_user_flags(id) & FLAG_VIP))) return PLUGIN_CONTINUE

#endif

new nbut = get_user_button(id)

new obut = get_user_oldbutton(id)

if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))

{

if(jumpnum[id] < get_pcvar_num(g_jumps) &&

((g_bit & FLAG_VIP && zp_get_user_nemesis(id)) ||

(g_bit & FLAG_VIP && zp_get_user_survivor(id)) ||

(g_bit & FLAG_VIP && !zp_get_user_zombie(id)) ||

(g_bit & FLAG_VIP && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))))

{

dojump[id] = true

jumpnum[id]++

return PLUGIN_CONTINUE

}

}

if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))

{

jumpnum[id] = 0

return PLUGIN_CONTINUE

}

return PLUGIN_CONTINUE

}

public client_PostThink(id)

{

#if MODE & (1<<0)

if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(g_user_privileges[id] & FLAG_VIP))) return PLUGIN_CONTINUE

#else

if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(get_user_flags(id) & FLAG_VIP))) return PLUGIN_CONTINUE

#endif

if(dojump[id] == true)

{

new Float:velocity[3]

entity_get_vector(id,EV_VEC_velocity,velocity)

velocity[2] = random_float(265.0,285.0)

entity_set_vector(id,EV_VEC_velocity,velocity)

dojump[id] = false

return PLUGIN_CONTINUE

}

return PLUGIN_CONTINUE

}

Link to comment
Share on other sites

Nav nodefinēts MODE. Lai to izdarītu, pieraksti #define MODE 1 plugina augšā.

Anyways, tas, ko tu pašlaik esi iesācis taisīt, neizskatās pārāk labi, un, ja tev izdosies nokompilēt pluginu, tas visticamāk patērēs daudz resursus un nedarbosies, kā tu vēlies.

Link to comment
Share on other sites

Prethink un Postthink vari aizvietot ar Fakemeta forwardu FM_CmdStart - register_forward(FM_CmdStart,"fwd_CmdStart"). Tālāk izveidot fwd_CmdStart funkciju un tajā attiecīgi pārbaudīt spēlētāja nospiestās pogas un, ja viss atbilst, piešķirt to velocity.


//iekš plugin_init()

register_forward(FM_CmdStart,"fwd_CmdStart")

public fwd_CmdStart(id, uc_handle, param)

{

if(!is_user_alive(id) /* && vai NAV VIPs ?*/ )

return FMRES_IGNORED

new buttons = get_uc(uc_handle,UC_Buttons)

new oldbuttons = get_user_oldbutton(id)

//viss pārējais

}

Edited by DeimoN
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...