Raised This Month: $ Target: $400
 0% 

KZ Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-02-2009 , 06:10   KZ Menu
Reply With Quote #1

KZ Menu
Version 1.0.2

Description:

KZ Menu is a type of training plugin for the mod KZ for CS 1.6.
When you type /kzmenu in the chat, a menu comes up with different
options for KZ training. Semiclip, godmode and noclip included.

Commands:

say /kzmenu
  • Brings up the main menu
say /checkpoint - /cp
  • Creates a checkpoint
say /gocheck - /tp
  • Go to your checkpoint
say /stuck
  • Revert to your previous checkpoint
say /respawn
  • Enable/Disable Respawning (also first time respawn)
say /reset
  • Resets your checkpoints

Cvars:

kzmenu_enabled ( 1 | 0 )
  • State of the plugin (enabled | disabled) - Default Value: 1 (enabled)
kzmenu_respawndelay ( integer )
  • Delay in seconds - Default Value: 2 (seconds)
kzmenu_semiclip ( 1 | 0 )
  • State of semiclip (enabled | disabled) - Default Value: 1 (enabled)
kzmenu_semiclip_color ( R G B A )
  • Colors in RGB format (ie. 0 255 0 150) - Default Value: 255 255 255 85 (White and 85 alpha)

End Note:

This is my first plugin, ever. So I would be glad to recieve constructive criticism instead of flaming, please.

Views: 259
Attached Files
File Type: sma Get Plugin or Get Source (KZMenu.sma - 9495 views - 12.7 KB)

Last edited by Xellath; 01-13-2010 at 17:05. Reason: Re-uploaded Version 1.0.2.
Xellath is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-02-2009 , 06:18   Re: KZMenu v0.4
Reply With Quote #2

realy nice
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-02-2009 , 06:20   Re: KZMenu v0.4
Reply With Quote #3

Thank you, One!

EDIT:
Quote:
There is already an allmighty plugin ProKreedz.
Give you my mod version:
prokreedz.sma
Yes, but this offers other things like weapons, godmode and noclip.

Last edited by Xellath; 05-02-2009 at 06:22.
Xellath is offline
fantasist
Member
Join Date: Mar 2009
Old 05-02-2009 , 06:20   Re: KZMenu v0.4
Reply With Quote #4

There is already an allmighty plugin ProKreedz.
Give you my mod version:
prokreedz.sma
fantasist is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 05-02-2009 , 06:29   Re: KZMenu v0.4
Reply With Quote #5

Good job.

I definitely think that you should make it multilingual.
It's just a couple of lines that change and it makes the foreign people on your server understand it better.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-02-2009 , 06:33   Re: KZMenu v0.4
Reply With Quote #6

Ok, thank you DarkGod.
I will update it later.
Xellath is offline
HE Ice
Junior Member
Join Date: Mar 2009
Old 05-02-2009 , 07:04   Re: KZMenu v0.4
Reply With Quote #7

Add some pic. please.
HE Ice is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-02-2009 , 07:20   Re: KZMenu v0.4
Reply With Quote #8

PHP Code:
for(new i=0;i<3;i++)
        
sOrigin[id][i] = Origin[i]

// ->

// this works at least in amxx 1.8, former versions give you a tagmismatch if i remember correct
sOrigin[id] = Origin 
also, stuck always used to be the former checkpoint you created. imagine falling down. your near to the finish, fall, gocheck and get stucked. you say /stuck and get teleported to the start. look again at paddys code, he also made the last cp the stuck origin before a saved the new cp origin on creating a checkpoint.

furthermore you could add mroe features for your checkpoints like checkpointing while ducking and/or disallowing it in the air. there are a few kz maps where you can jump down somewhere, checkpoint->gocheck to reset your velocity and lan safly (shortcut).

PHP Code:
// connorr tested this and found out that it actually works
// for checkpoint while being ducked
new const Float:VEC_DUCK_HULL_MIN[3] = { -16.0, -16.0, -18.0 };
new const 
Float:VEC_DUCK_HULL_MAX[3] = { 16.016.018.0 };

stock set_user_duckingplr )
{
    
set_pevplrpev_flagspevplrpev_flags ) | FL_DUCKING );
    
engfuncEngFunc_SetSizeplrVEC_DUCK_HULL_MINVEC_DUCK_HULL_MAX );
}

// for not checkpointing while being in air
if( !( pevplrpev_flags ) & FL_ONGROUND ) ) 
you do not reset checked[id] which means a new player might be able to use another palyers checkpoints.
the noblock var itself is unnecessary in your plugin. you set it twice to true (putinserver and disconnect) and the only time is used in your plugin is the following:

PHP Code:
// since noblock is always true your semiclip cvar has no effect on the var
if(get_pcvar_num(cvar_kzmenu_semiclip) == || noblock[x]) 
also, cuz you added a cvar for semiclip you should add a check in gocheck whether the gocheckorigin is near to another player so the player wont get stucked (paddy does this in his plugin).

//edit: you check the cvar for semiclip twice in the semiclip task which means your cvar really works
PHP Code:
if(get_pcvar_num(cvar_kzmenu_semiclip) == || noblock[x])
{
     
// dont delete the code inside which is done here but the if/else clause becomes unnecessary
}
else if(!
solid[x])
{
     
set_pev(xpev_solidSOLID_BBOX);

// stop edit

PHP Code:
// the condition inside a loop (in this case i<= get_maxplayers() should always be cached
for(new i=1;i<=get_maxplayers();i++)

// ->

for(new i=1;i<=g_iMaxPlayers;i++)
// g_iMaxPlayers should be a global var (you could use a static in here too but since youre new to coding... forget about a static :D)



// if you leave your code as it is currently the for loop will work like this
create var i
set 
var to 1
get_maxpalyers
()
check whether condition is true
run the code inside the loop
increment i 
(set var to i+1)
get_maxpalyers()
check whether condition is true
run the code inside the loop
increment i 
(set var to i+1)
get_maxpalyers()
check whether condition is true
run the code inside the loop
increment i 
(set var to i+1)
get_maxpalyers()
check whether condition is true
run the code inside the loop
increment i 
(set var to i+1)
...

// as you can see, get_maxplayers() is done a lot of times, caching it will leave this out and only check whetehr the contion is true 
kinda good for your first plugin
__________________

Last edited by SchlumPF*; 05-02-2009 at 07:35.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 05-02-2009 , 07:26   Re: KZMenu v0.4
Reply With Quote #9

Quote:
ML (Yes/No?)
Yes, this is a too big plugin to not do it
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-02-2009 , 07:28   Re: KZMenu v0.4
Reply With Quote #10

I actually do this on my kz server :

PHP Code:
new Float:g_flCurPosition[MAX_PLAYERS+1][2][3]
new 
Float:g_flPrevPosition[MAX_PLAYERS+1][2][3// for /stuck cmd 
angles and v_angle is a 2 dimension array, so i use the 3rd cell to save gravity, save/restore gravity prevent bugs on a map where you could have ade a cp in a 800 gravity place, then reach a 200 gravity place and do gocheck.

Save position, angles and gravity :
PHP Code:
    entity_get_vector(idEV_VEC_origing_flCurPosition[id][0])
    
entity_get_vector(idEV_VEC_v_angleg_flCurPosition[id][1])
    
g_flCurPosition[id][1][2] = entity_get_float(idEV_FL_gravity
Restore position :

PHP Code:
Util_SetOrigin(idFloat:flOrigin[2][3])
{
    
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) | FL_DUCKING)
    
engfunc(EngFunc_SetSizeidVEC_DUCK_HULL_MINVEC_DUCK_HULL_MAX)
    
engfunc(EngFunc_SetOriginidflOrigin[0])

    
entity_set_vector(idEV_VEC_velocityFloat:{0.00.00.0})
    
entity_set_vector(idEV_VEC_anglesflOrigin[1])
    
entity_set_int(idEV_INT_fixangle1)
    
entity_set_float(idEV_FL_gravityflOrigin[1][2])

And for stuck cmd (you have the main code and can easily think about rest of it) :
PHP Code:
public ClientCommand_Stuck(id)
{
    if( 
bCheckFlood(id) )
    {
        return 
PLUGIN_HANDLED
    
}

    if( !
g_flPrevPosition[id][0][0] && !g_flPrevPosition[id][0][1] && !g_flPrevPosition[id][0][2] )
    {
        
client_print_center(id"No Previous CheckPoint !!")
        return 
PLUGIN_HANDLED
    
}

    for(new 
ii<3i++)
    {
        
g_flCurPosition[id][0][i] = g_flPrevPosition[id][0][i]
        
g_flCurPosition[id][1][i] = g_flPrevPosition[id][1][i]
        
g_flPrevPosition[id][0][i] = 0.0
    
}

    
ClientCommand_GoCheck(id)

    return 
PLUGIN_HANDLED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-02-2009 at 07:30.
ConnorMcLeod 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 20:00.


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