Raised This Month: $ Target: $400
 0% 

Skills For Xp Based Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-19-2007 , 15:32   Skills For Xp Based Mod
Reply With Quote #1

Hi I'm Frozen Usp!

ATM i'm working on a mod that with 4 classes.
The problem is i don't know how to put skill in the races.
Ex. Regeneration for HP and AP, Speed and gravity...




-= !Stay Frozen! =-

Last edited by Frozen Usp; 09-20-2007 at 09:24. Reason: Okey Sorry Didn't Know
Frozen Usp is offline
Send a message via MSN to Frozen Usp
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-20-2007 , 08:46   Re: Skills For Xp Based Mod
Reply With Quote #2

Don't ask for PM's / emails, the forum isn't just so you get help.
If someone else found your thread, looking for exactly the same answers, they want to see the answers, not "I've send you a PM of exactly what you need to know" :-D

Step one is to work out when the skills are required.

e.g. HP/Armour - on spawn
regen - starts on spawn, should get called every few seconds.
speed - changes whenever weapon changes.

I'll show you the examples you posted:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> // we include fun and cstrike, because it has useful functions // like setting a user's health and armour respectively #define TASK_REGEN 999 // this is sort of like a variable, only it is constant. // we use it to identify the "regen" task (tasks need an id) new curweapon[33] ; // stores the current weapon for each player // to check if they have changed it. public plugin_init() {     register_plugin("XP Plugin", "1.0", "Me")     register_event("ResetHUD","on_spawn","be")     // this is called on spawn, and a few other places     // "b" means "only hook if this is sent to just one player"     // "e" means "only if the player is alive"         register_clcmd("fullupdate","on_fullupdate")     // this *should* also call ResetHUD,     // we hook it so that it doesn't.         register_event("CurWeapon","on_weaponevent","be")     // hook the "weapon" event.     // this is called on shooting, and on change weapon } public on_fullupdate(id) {     return PLUGIN_HANDLED ; } public on_spawn(id) {     // give the user 50 extra health     set_user_health(id,150)         // and 100 points of armour + a helmet     cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)         // and reduce their gravity to half     set_user_gravity(id,0.5)         // and in 5 seconds, call the on_regen function     set_task(5.0,"on_regen",TASK_REGEN+id) } public on_weaponevent(id) {     new dummy ;     // a "dummy" variable - we don't care what happens to it, we just need one to call the next function     new tempweapon = get_user_weapon(id,dummy,dummy)     // get their current weapon     if ( tempweapon != curweapon[id] )     {         // if they have changed weapon         curweapon[id] = tempweapon         // store their new weapon                 set_user_maxspeed(id,(get_user_maxspeed(id)*1.5))         // and give them a 50% speed increase.     } } public on_regen(id) {     // here, we take away the constant part of the task's id ( 999 )     // and are left with just the player id     // (the task id is 999 + player's id )     if ( id > TASK_REGEN )         id -= TASK_REGEN ;     // don't regen dead people !     if ( !is_user_alive(id) )         return ;         // give user 5 hp     set_user_health(id,get_user_health(id)+5)         // and do it again in 5 seconds     set_task(5.0,"on_regen",TASK_REGEN+id) }
Also, check out the Scripting Tutorials for the XP Mod tutorial.

Last edited by purple_pixie; 09-20-2007 at 08:50.
purple_pixie is offline
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-20-2007 , 09:26   Re: Skills For Xp Based Mod
Reply With Quote #3

Okey,
i going to try to make it work but how about if you whant to putt like
speed on a special class?
Where can i find the scripting tutorials for XP Mod?
+karma

Last edited by Frozen Usp; 09-20-2007 at 09:32. Reason: Forgot a Question
Frozen Usp is offline
Send a message via MSN to Frozen Usp
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-20-2007 , 10:17   Re: Skills For Xp Based Mod
Reply With Quote #4

The tutorial is right here ( and on the first page of the code snippets / tutorials forum ... )

I recommend you read through that before thinking how skills apply based on character class.
purple_pixie is offline
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-20-2007 , 10:21   Re: Skills For Xp Based Mod
Reply With Quote #5

My Plugin is based 100% on that tutorial.
It works fine the thing is i got 4 classes but no skills in them
thats what i need help with
Frozen Usp is offline
Send a message via MSN to Frozen Usp
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-20-2007 , 11:07   Re: Skills For Xp Based Mod
Reply With Quote #6

Hehe.

What you need to do, is before each "skill" function, check if the user is the right class.

e.g.
Code:
set_user_health(id,150)
would be
Code:
if ( PlayerClass[id] == CLASS_THEONETHATGETSEXTRAHP )     set_user_health(id,150)
purple_pixie is offline
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-20-2007 , 13:11   Re: Skills For Xp Based Mod
Reply With Quote #7

Is There Any chance you can do something like this

Code:
if ( PlayerClass[id] == CLASS_SCOUT )
if ( PlayerClass[id] == CLASS_MEDIC )
set_user_maxspeed(id,(get_user_maxspeed(id)*1 .5))
// and give them a 50% speed increase.
Frozen Usp is offline
Send a message via MSN to Frozen Usp
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-20-2007 , 13:30   Re: Skills For Xp Based Mod
Reply With Quote #8

Quote:
if ( PlayerClass[id] == CLASS_SCOUT || PlayerClass[id] ==CLASS_MEDIC){
set_user_maxspeed(id,480.0)
}
320 normal you shuld use change weapon event for best effect
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-20-2007 , 13:39   Re: Skills For Xp Based Mod
Reply With Quote #9

What is the Change weapon effect?
if i post the code can you fix it?
Frozen Usp is offline
Send a message via MSN to Frozen Usp
Old 09-20-2007, 13:42
fxfighter
This message has been deleted by fxfighter. Reason: gfaw
Old 09-20-2007, 13:43
Frozen Usp
This message has been deleted by Frozen Usp.
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 09-20-2007 , 13:46   Re: Skills For Xp Based Mod
Reply With Quote #10

okey i got it working

can you fix the code so it works?
Frozen Usp is offline
Send a message via MSN to Frozen Usp
Old 09-20-2007, 13:46
fxfighter
This message has been deleted by fxfighter. Reason: gfaw
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 16:04.


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