Senior Member
|
06-03-2017
, 09:30
Re: [REQ]Multijump
|
#2
|
I Just Adding The Native It's Okay And Simple No Trouble In This Here you go:
PHP Code:
#include <amxmodx> #include <amxmisc> #include <nvault> #include <fun> #include <cstrike> #include <fakemeta_util> #include <hamsandwich> #include <ColorChat> #include <engine>
native g_jump(id) #pragma tabsize 0
#define PLUGIN "dr" #define VERSION "3.2" #define AUTHOR "ss"
#define is_valid_player(%1) (1 <= %1 <= 32)
new g_level[32], g_level_data, g_frags_level, g_ScreenFade new g_level_max, g_level_num, g_levels[32] new level_exp[32], g_aim_info, buffer[32] new g_level_exp[32], g_Players, nameid[32], g_points[32] new g_trime[32], g_MsgSync, gGrads[32] new sound_level_up[] = { "Level_Up.wav"} const PEV_SPEC_TARGET = pev_iuser2 new Invi_time[32] new g_iTarget [33]; new g_Lifes[33]; new cvar_Invi_time;
public plugin_precache() { precache_sound( sound_level_up ) }
public plugin_init() { g_frags_level = register_cvar("zp_level_frags", "10") g_level_max = register_cvar("zp_level_max", "150") g_aim_info = register_cvar("xp_aim_info", "1") g_level_num = register_cvar("zp_level_number", "1") cvar_Invi_time = register_cvar("amxx_cvar_invi_time","10") register_clcmd("say /shop", "Shop_Items") register_clcmd("say shop", "Shop_Items") register_clcmd("say donate", "Donate_Menu" ); register_clcmd("say /donate", "Donate_Menu" ); register_clcmd("say /showpoint", "ShowPoints" ); register_clcmd("say /mypoints", "cmd_showgolds" ); register_concmd("point_", "cmd_set", ADMIN_IMMUNITY, "<name> <golds> - set golds to a player" ); register_concmd("rs_point_", "cmd_reset", ADMIN_IMMUNITY, "<name> <golds> - reset player golds" ); g_level_data = nvault_open("Leveling_Save") register_event("HLTV", "Round_Start", "a", "1=0", "2=0") register_event("DeathMsg", "Frags_Manager", "a", "1>0") register_event("DeathMsg", "eDeath", "a") g_ScreenFade = get_user_msgid( "ScreenFade" ) register_event("StatusValue","show_status","b e","1=2","2!0") register_event("StatusValue","hide_status","b e","1=1","2=0") g_Players =get_maxplayers() register_plugin(PLUGIN, VERSION, AUTHOR) g_MsgSync = CreateHudSyncObj() }
new const Grads[][] = { "Noob", "Noob", "Noob", "Noob", "Noob", "Noob", "Noob", "Noob", "Noob", "Noob", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Regular", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Super Bhoper", "Pro DeathRun" }
public Round_Start() { for(new id=1;id<=g_Players;id++) set_task(3.0, "Level", id) }
public Level(id) { if(is_user_alive(id) ) { g_trime[id] = false; new n = 1; while( n < g_level[id] ) { n = n + 1 } } }
public client_putinserver(id) { if(!is_user_bot(id) && is_valid_player(id)) Level_Load(id) g_level_exp[id] = get_pcvar_num(g_frags_level) new name[32] g_trime[id] = false; nameid[id] = get_user_name(id, name, sizeof name - 1) if(is_user_alive(id)) { g_trime[id] = false; new n = 1; while( n != g_level[id] ) { n = n + 1; } } if( g_level[id] == 0) g_level[id] = 1; if( level_exp[id] == g_level[id] ) level_exp[id] = 0; if(g_level[id] < get_pcvar_num(g_level_num)) g_levels[id] = get_pcvar_num(g_level_num); else { if(g_level[id] != g_levels[id]) { new x = 1; while( g_level[id] > ( x * get_pcvar_num(g_level_num)) ) { x = x + 1; g_levels[id] = x * get_pcvar_num(g_level_num); } } } new y = 1; while( g_level[id] != y ) { y = y + 1; g_level_exp[id] = y * get_pcvar_num(g_frags_level); } }
public hide_status(id) { set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4) show_hudmessage(id,"") }
public show_status(id) { new name[32],pid = read_data(2) get_user_name(pid,name,31) switch(get_user_team(pid)) { case 1: copy(buffer, 31, "Terrorist") case 2: copy(buffer, 31, "Counter-Terrorist") } if(get_pcvar_num(g_aim_info) == 1) { set_hudmessage(random_num(200,150),random_num (100,50),random_num(50,25),-1.0,0.60,1, 0.01, 4.0, 0.01, 0.01, 4) show_hudmessage(id, "%s^n[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",name, get_user_health(pid), buffer, Grads[gGrads[pid]], g_level[pid], level_exp[pid], g_level_exp[pid], g_points[pid]) } }
public eDeath() { new attacker = read_data(1) new victim = read_data(2) new headshot = read_data(3) if(cs_get_user_team(attacker) != cs_get_user_team(victim)) { g_points[attacker] += 1 } else { if(attacker == victim) { g_points[attacker] += 0 } else { if(!headshot) g_points[attacker] += 1 else g_points[attacker] += 1 } } }
public client_disconnect(id) { { new name[32], player_nick[32] player_nick[id] = get_user_name(id, name, sizeof name - 1) if(player_nick[id] == nameid[id]) Level_Save(id) } Level_Save(id) g_trime[id] = false; }
public level_status(id) { new Spec Spec = pev(id, PEV_SPEC_TARGET) new PlayerName[32] get_user_name(Spec, PlayerName, 31) switch(get_user_team(id)) { case 1: copy(buffer, 31, "Terrorist") case 2: copy(buffer, 31, "Counter-Terrorist") } if(is_user_alive(id)) { set_hudmessage(10, 180, 10, -1.0, 0.87, 0, 6.0, 1.1) ShowSyncHudMsg(id, g_MsgSync, "[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",get_user_health(id), buffer, Grads[gGrads[id]], g_level[id], level_exp[id], g_level_exp[id], g_points[id]) } else switch(get_user_team(Spec)) { case 1: copy(buffer, 31, "Terrorist") case 2: copy(buffer, 31, "Counter-Terrorist") } if(is_user_alive(Spec)) { set_hudmessage(200, 30, 200, -1.0, 0.79, 0, 6.0, 1.1) ShowSyncHudMsg(id, g_MsgSync, "Spectating: %s ^n[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",PlayerName, get_user_health(Spec), buffer, Grads[gGrads[id]], g_level[Spec], level_exp[Spec], g_level_exp[Spec], g_points[Spec]) } }
public Level_Save(id) { new key[64], data[256] new name[33] get_user_name(id,name,32) format(key, 63, "%s-/", name) format(data, 255, "%i#", g_level[id], level_exp[id], g_points[id], gGrads[id]) nvault_set(g_level_data, key, data) return PLUGIN_CONTINUE; }
public Level_Load(id) { new key[64], data[256] new name[33] get_user_name(id,name,32) format(key, 63, "%s-/", name) format(data, 255, "%i# %i# %d# %s#", g_level[id], level_exp[id], g_points[id], gGrads[id]) nvault_get(g_level_data, key, data, 255) replace_all(data, 255, "#", " ") new givelevel[32] parse(data, givelevel, 31) g_level[id] = str_to_num(givelevel) set_task(1.0 ,"level_status", id, _, _, "b") return PLUGIN_CONTINUE; }
public Frags_Manager() { new aname[32], attacker; attacker = read_data(1) new y; y = 1; get_user_name(attacker, aname, sizeof aname - 1) if( ( level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) ) { g_level[attacker] = g_level[attacker] + 1; level_exp[attacker] = 0; while( g_level[attacker] != y ) { y = y + 1; g_level_exp[attacker] = y * get_pcvar_num(g_frags_level); } message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, attacker) write_short(1<<12) // duration write_short(1) // hold time write_short(0x0000) // fade type write_byte(1) // red write_byte(200) // green write_byte(0) // blue write_byte(205) // alpha message_end() emit_sound(attacker, CHAN_STREAM, sound_level_up, 1.0, ATTN_NORM, 0, PITCH_HIGH ) set_hudmessage(0, 200, 0, 0.65, 0.5, 0, 0.0, 3.0, 2.0, 1.0, -1) show_hudmessage(0, "%s Has Cut Down %i Level", aname, g_level[attacker]) Level_Save(attacker); } else { if(g_level[attacker] == get_pcvar_num(g_level_max)) ColorChat(attacker,GREEN,"[MS] ^1You Have Reached A Maximum Level: ^4%i", g_level[attacker]) level_exp[attacker] = level_exp[attacker] + 1; Level_Save(attacker); } }
public Shop_Items(iPlayer) { new szText[555 char] formatex(szText, charsmax(szText), "\r[MS] \yDeathRun Shop \d[\rYour Points : %d\d]^n^n", g_points[iPlayer]) new AdminMenu = menu_create(szText, "Dr_Shop") formatex(szText, charsmax(szText), "%sRespawn \r[Only Dead] \y[2 Dr-Points]", g_points[iPlayer] >= 2 ? "\w":"\d") menu_additem(AdminMenu, szText, "1", 0) formatex(szText, charsmax(szText), "%sInvisblity \r[10 Seconds] \y[15 Dr-Points]", g_points[iPlayer] >= 15 ? "\w":"\d") menu_additem(AdminMenu, szText, "2", 0) formatex(szText, charsmax(szText), "%sHealth \r[100 HP] \y[5 Dr-Points]", g_points[iPlayer] >= 5 ? "\w":"\d") menu_additem(AdminMenu, szText, "3", 0) formatex(szText, charsmax(szText), "%sFlash Bang \r[] \y[4 Dr-Points]", g_points[iPlayer] >= 4 ? "\w":"\d") menu_additem(AdminMenu, szText, "4", 0) formatex(szText, charsmax(szText), "%sSmoke Grenade \r[] \y[4 Dr-Points]", g_points[iPlayer] >= 4 ? "\w":"\d") menu_additem(AdminMenu, szText, "5", 0) formatex(szText, charsmax(szText), "%sMultiJump \r[+1 Jump] \y[6 Dr-Points]^n", g_points[iPlayer] >= 6 ? "\w":"\d") menu_additem(AdminMenu, szText, "6", 0) menu_setprop(AdminMenu, MPROP_EXIT, MEXIT_ALL) menu_display(iPlayer, AdminMenu, 0) return PLUGIN_HANDLED } public Set_p(id) { g_points[id] += 6000 g_Lifes[id] += 600 }
public Dr_Shop(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new data[6], iName[64], access, callback menu_item_getinfo(menu, item, access, data, charsmax(data), iName, charsmax(iName), callback ) new key = str_to_num(data) switch(key) { case 1: { if( g_points[id] < 2 ) { ColorChat(id,GREEN,"[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 2 ) ColorChat(id,GREEN,"[MS] ^1You Bought ^4[Respawn]") ExecuteHamB(Ham_CS_RoundRespawn, id) } case 2: { if( g_points[id] < 15 ) { ColorChat(id,GREEN,"[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 15 ) ColorChat(id,GREEN,"[MS] ^1You Bought ^4[Invisblity 10 Sec]") g_points[id] -= 15 set_user_footsteps(id, 1) set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha , 0) set_user_maxspeed(id,get_user_maxspeed(id) + 500) set_task(10.0, "Set_Invi",id); set_task( 1.0, "Invi_Time", id, _, _, "a",Invi_time [ id ] ); Invi_time [ id ] = get_pcvar_num( cvar_Invi_time ) } case 3: { if( g_points[id] < 5 ) { ColorChat(id,GREEN,"[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 5 ) ColorChat(id,GREEN,"[MS] ^1You Bought ^4[100 HP]") g_points[id] -= 5 set_user_health(id, get_user_health(id) + 100) } case 4: { if( g_points[id] < 4 ) { ColorChat(id,GREEN,"[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 4 ) ColorChat(id,GREEN,"[MS] ^1You Bought ^4[Flash Bang]") g_points[id] -= 4 give_item (id,"weapon_flashbang") cs_set_user_bpammo(id, CSW_FLASHBANG, cs_get_user_bpammo(id, CSW_FLASHBANG) + 1) } case 5: { if( g_points[id] < 4 ) { ColorChat(id,GREEN,"^4[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 4 ) ColorChat(id,GREEN,"^4[MS] ^1You Bought ^4[Smoke Grenade]") g_points[id] -= 4 give_item (id,"weapon_smokegrenade") cs_set_user_bpammo(id, CSW_SMOKEGRENADE, cs_get_user_bpammo(id, CSW_SMOKEGRENADE) + 1) } case 6: { if( g_points[id] < 6 ) { ColorChat(id,GREEN,"[MS] ^1You Don't Have ^4[Points]") return PLUGIN_HANDLED } else if( g_points[id] >= 6 ) ColorChat(id,GREEN,"[MS] ^1You Bought ^4[MultiJump +1]") g_points[id] -= 6 g_jump(id) } } return PLUGIN_HANDLED } public Set_Invi(id) { ColorChat(id,GREEN,"[MS] ^1Invisblity Is ^4[OFF]") set_user_footsteps(id, 0) set_user_rendering(id, 0) return PLUGIN_HANDLED }
public Invi_Time(id) { if(is_valid_ent(id) && is_user_alive(id)) { Invi_time [ id ] = Invi_time [ id ] - 1; set_hudmessage(0, 255, 0, 0.75, 0.75, 0, 1.0, 1.1, 0.0, 0.0, -1) show_hudmessage(id, "Invisiblity Time: %d",Invi_time[ id ]) }else{ remove_task(id) } }
public ShowPoints(id) { static opcion[64] formatex(opcion, charsmax(opcion),"\r[MS] \yShow Players Points :") new iMenu = menu_create(opcion, "Handlegolds") new players[32], pnum, tempid new szName[32], szTempid[10] get_players(players, pnum, "ch") for( new i; i<pnum; i++ ) { tempid = players[i] get_user_name(tempid, szName, 31) num_to_str(tempid, szTempid, 9) formatex(opcion,127,"\w%s y- \d[\r%i Points\d]",szName, g_points[tempid]); menu_additem(iMenu, opcion, szTempid, 0) } menu_display(id, iMenu) return PLUGIN_HANDLED }
public Handlegolds(id, menu, item) { if(item == MENU_EXIT) { return PLUGIN_HANDLED } new data[6], name[64] new access, callback menu_item_getinfo (menu, item, access, data, 5, name, 63, callback) new tempid = str_to_num (data) new szName[33], szPlayerName[33] get_user_name(id, szName, 32) get_user_name(tempid, szPlayerName, 32) ColorChat(id, RED, "^4[MS] ^1User ^4%s ^1Have ^4%i ^3Points ^4!",szPlayerName, g_points[tempid]) ShowPoints(id); return PLUGIN_CONTINUE }
public Donate_Menu(id) { new iMenu = menu_create("\r[MS] \yDonate Players Menu", "handleDonate"); new iPlayers[32], szName[32], szKey[3], iNum, iPlayer; get_players(iPlayers, iNum,"ch"); for( new i; i < iNum; i++ ) { iPlayer = iPlayers[i]; num_to_str(iPlayer, szKey, charsmax(szKey)); get_user_name(iPlayer, szName, charsmax(szName)); menu_additem(iMenu, szName, szKey); } menu_setprop(iMenu, MPROP_EXITNAME, "Back"); menu_display(id, iMenu, 0); return 0; }
public handleDonate(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new szData[6], iAccess, iCallback; menu_item_getinfo(menu, item, iAccess, szData, charsmax(szData), _, _, iCallback); g_iTarget[id] = str_to_num(szData); new szName[32]; get_user_name(g_iTarget[id], szName, charsmax(szName)); client_cmd(id, "messagemode Donate"); return PLUGIN_HANDLED; }
public CmdDonate(id) { new szArg[5]; read_argv(1, szArg, charsmax(szArg)); new iValue = str_to_num(szArg); if( iValue > g_points[id] ) { ColorChat(id,GREEN, "^4[MS] ^1You Only Have ^4%i ^3Points ^4!",g_points[id]); return PLUGIN_HANDLED; } new iTarget = g_iTarget[id]; if( !iTarget ) { return PLUGIN_HANDLED; } if( iTarget == id ) { return PLUGIN_HANDLED; } g_points[id] -= iValue; g_points[iTarget] += iValue; new szName[2][32]; get_user_name(iTarget, szName[0], charsmax(szName[])); get_user_name(id, szName[1], charsmax(szName[])); ColorChat(id,GREEN, "^4[MS] ^1You Donated ^4%i^3 Points ^1To ^4%s !", iValue, szName[0]); ColorChat(iTarget,GREEN, "^4[MS] ^3%s^1 Gaves You ^4%i Points", szName[1], iValue); return PLUGIN_HANDLED; }
public cmd_showgolds(id) { set_hudmessage(0, 255, 255, 0.0, 0.87, 0, 6.0, 12.0) show_hudmessage(id, "You Have %d Points", g_points [id] ) ColorChat( id, GREEN, "^4[MS] ^1You Have ^4%d ^3Points ^4!", g_points[ id ] ); }
public cmd_set(id,level,cid) { if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED else { new target[32], pid read_argv(1,target,31) pid = cmd_target(id,target,2) new amountstr[10], amount read_argv(2,amountstr,9) amount = str_to_num(amountstr) new name[32], tname[32] get_user_name(id,name,31) get_user_name(pid,tname,31) g_points[pid] += amount ColorChat(id, GREEN, "^4[MS] ^1You Gave ^4%d ^3Points ^1To ^4%s ^1", amount, tname) ColorChat(pid, GREEN, "^4[MS] ^1Owner ^4%s ^1Gave ^4%d ^1Points ^1To ^3You ^4! ^1Now You Have ^4%d ^3Points ^4!", name, amount) } return PLUGIN_HANDLED }
public cmd_reset(id,level,cid) { if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED else { new target[32], pid read_argv(1,target,31) pid = cmd_target(id,target,2) new amountstr[10], amount read_argv(2,amountstr,9) amount = str_to_num(amountstr) new name[32], tname[32] get_user_name(id,name,31) get_user_name(pid,tname,31) if((g_points[pid] -= amount) < 0) amount = g_points[pid] g_points[pid] -= amount ColorChat(id, GREEN, "^4[MS] ^1You Removed ^4%d ^3Points ^1From ^4%s ^1!", amount, tname) ColorChat(pid, GREEN, "^4[MS] ^1Owner ^4%s ^1Removed From ^3You ^4%d ^3Points ^4! ^1Now You Have ^4%d ^3Points ^4!", name, amount) } return PLUGIN_HANDLED }
MULTIJUMP :
PHP Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich>
new jumpnum[33] = 0; new bool:dojump[33] = false; new g_multijumps[33] = 0; new bool:has_jump[33]
public plugin_init() { register_plugin("Jump", "1.5", "med*"); RegisterHam(Ham_Spawn, "player", "jump_off", 1) register_forward(FM_PlayerPreThink, "FW_PlayerPreThinkz"); register_forward(FM_PlayerPostThink, "FW_PlayerPostThinkz"); }
public client_connect(id) { if(get_user_flags(id) & ADMIN_KICK || has_jump[id]) { has_jump[id]=true } }
/*public client_PreThink(id) { if(get_user_flags(id) & ADMIN_KICK || has_jump[id]) { g_multijumps[id] = true } }*/
public jump_off(id) { for (new id; id <= 32; id++) g_multijumps[id] = false; }
public FW_PlayerPreThinkz(id) { if(!g_multijumps[id]) return PLUGIN_CONTINUE new nbut = pev(id,pev_button); new obut = pev(id,pev_oldbuttons); if((nbut & IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut & IN_JUMP)) { if(jumpnum[id] < 1) { dojump[id] = true; jumpnum[id]++; return PLUGIN_CONTINUE } } if((nbut & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND)) { jumpnum[id] = 0; return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
public FW_PlayerPostThinkz(id) { if(!g_multijumps[id]) return PLUGIN_CONTINUE if(dojump[id] == true) { new Float:velocity[3]; pev(id,pev_velocity,velocity); velocity[2] = random_float(265.0,285.0); set_pev(id,pev_velocity,velocity) dojump[id] = false return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
public plugin_natives() { register_native("g_jump", "native_jump", 1); }
public native_jump(id) { g_multijumps[id] = true; }
|
|