Raised This Month: $51 Target: $400
 12% 

[REQ] ZP extra item: multijump with 1+ limit.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
airidas338
Member
Join Date: May 2010
Old 05-23-2010 , 08:09   [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #1

[REQ] ZP extra item: multijump with 1+ limit. (NO BUGS , NO ERRORS)

Last edited by airidas338; 05-23-2010 at 08:13.
airidas338 is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 05-23-2010 , 08:17   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #2

Why the hell are making threads for items that already exixt...??!!!
Search before posting..
Here is a list of plugin:
http://forums.alliedmods.net/showthread.php?t=92407
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 05-23-2010 at 08:22.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
airidas338
Member
Join Date: May 2010
Old 05-23-2010 , 08:22   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #3

becouse im learning how to script it.
airidas338 is offline
airidas338
Member
Join Date: May 2010
Old 05-23-2010 , 08:26   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #4

RIGHT
Quote:
/*============================================ ====================================

-------------------------------------------
-*- [ZPx] Extra Item: Multijump 1.0 -*-
-------------------------------------------

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

#include <amxmodx>
#include <fakemeta>
#include <zombieplague.inc>

/*============================================ ====================================
[Plugin Customization]
============================================= ====================================*/

new const g_item_name[] = { "Multijump +1 (max+1)" };
const g_item_cost = 9;
new g_maxJumps = 1; // maximum amount of jumps in mid air. If set to 0 then it is infinitely

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

new jumpnum[33] = 0;
new bool:dojump[33] = false;
new g_itemid_multijump;
new g_multijumps[33] = 0;

public plugin_init()
{
register_plugin("[ZPx] Extra Item: Multijump", "1.0", "ZPx");

g_itemid_multijump = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN);

register_forward(FM_PlayerPreThink, "FW_PlayerPreThink");
register_forward(FM_PlayerPostThink, "FW_PlayerPostThink");

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

public FW_PlayerPreThink(id)
{
if(!is_user_alive(id) || zp_get_user_zombie(id) || !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] < g_multijumps[id])
{
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_PlayerPostThink(id)
{
if(!is_user_alive(id) || zp_get_user_zombie(id) || !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
}

// Player buys our upgrade, add one multijump
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_multijump){
if (g_multijumps[player] < g_maxJumps || !g_maxJumps){
g_multijumps[player]++;
if (g_maxJumps)
client_print(player, print_center, "Now you can jump %d / %d times in mid air.", g_multijumps[player], g_maxJumps);
else
client_print(player, print_center, "Now you can jump %d times in mid air.", g_multijumps[player]);
}
else
client_print(player, print_center, "You can't jump more than %d times in mid air!", g_maxJumps);
}
}

// Reset multijump for all players on newround
public EVENT_round_start()
{
for (new id; id <= 32; id++) g_multijumps[id] = false;
}
airidas338 is offline
airidas338
Member
Join Date: May 2010
Old 05-23-2010 , 08:26   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #5

???
airidas338 is offline
fiendshard
Senior Member
Join Date: Dec 2009
Location: In Water
Old 05-23-2010 , 08:59   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #6

Why triple-post? use edit button

Seems like you are another candidate for bannage
__________________
fiendshard is offline
Xe3non
New Member
Join Date: Jun 2020
Old 06-02-2020 , 17:54   Re: [REQ] ZP extra item: multijump with 1+ limit.
Reply With Quote #7

Here is my error free version of multi jump. Hope it helps anyone!
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_multijump_fix.sma - 241 views - 3.3 KB)
Xe3non is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode