Raised This Month: $32 Target: $400
 8% 

New XP Mod tutorial


Post New Thread Reply   
 
Thread Tools Display Modes
Merko
Member
Join Date: Mar 2008
Old 03-27-2008 , 18:39   Re: New XP Mod tutorial
Reply With Quote #31

This code doesnt save xp right? When I change map ect I have my same XP. but if I reconnect on client I loose it..

Last edited by Merko; 03-27-2008 at 23:14.
Merko is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 03-29-2008 , 05:19   Re: New XP Mod tutorial
Reply With Quote #32

it saves xp in nvault by steamid and i posted a small fix on page 2 in this thread.
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Merko
Member
Join Date: Mar 2008
Old 03-30-2008 , 07:02   Re: New XP Mod tutorial
Reply With Quote #33

Oh right ;).

Well I fixed it myself too hehe.
Merko is offline
HexD
Member
Join Date: Nov 2005
Location: England
Old 03-30-2008 , 11:26   Re: New XP Mod tutorial
Reply With Quote #34

How would I make it give different things for different classes at different levels?
HexD is offline
Send a message via MSN to HexD
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-30-2008 , 11:30   Re: New XP Mod tutorial
Reply With Quote #35

it think the threath stater should update his xp mod tutorial ,
I have seen many topics last time all because of a bad tutorial ,
It is also very annoying for the newbies like me cause they think there going out the good way untill they see all the errors but they cant do a thing about it .
__________________
I am out of order!
grimvh2 is offline
Merko
Member
Join Date: Mar 2008
Old 03-30-2008 , 12:33   Re: New XP Mod tutorial
Reply With Quote #36

Well I started AMXX Scripting two days ago and this was my second tutorial. I got most of it to work.

HexD:
If you wanna give yourself somthing for each level and class you can do something like this:
PHP Code:
if(PlayerLevel[id] == 2// Checks level.
{
give_item(id,"weapon_awp"); // Give yourself AWP at level 2

If you wanna give something for a class only you can do..

PHP Code:
if (PlayerClass[id] == CLASS_COW// Checks if he's an cow or not
{
set_user_health(id250); // gives him 250 health if he's a Cow

If you wanna give an item to a class on a X level you could do somthing like this..

PHP Code:
if (PlayerClass[id] == CLASS_COW || PlayerLevel[id] == 5// Checks Class and Level.
{
set_user_health(id250); // gives him 250 health if he's a Cow on level 5
give_item(id,"weapon_awp"); // 

Edit: You also might want to add this on the top.

enum {
PLAYERLEVEL_1,
PLAYERLEVEL_2,
PLAYERLEVEL_3, // How many Levels
PLAYERLEVEL_4,
PLAYERLEVEL_5,
PLAYERLEVEL_6
}
enum {
CLASS_NONE = 0,
CLASS_COW,
CLASS_HORSE, // Add your Classes there..
CLASS_CAT,
CLASS_DOG
}

Last edited by Merko; 03-30-2008 at 12:38.
Merko is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-30-2008 , 14:39   Re: New XP Mod tutorial
Reply With Quote #37

Nice , your learning fast
__________________
I am out of order!
grimvh2 is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 03-30-2008 , 17:19   Re: New XP Mod tutorial
Reply With Quote #38

Except '||' signifies 'logical or' and not 'logical and' - you were looking for '&&'.
Lee is offline
HexD
Member
Join Date: Nov 2005
Location: England
Old 03-30-2008 , 20:31   Re: New XP Mod tutorial
Reply With Quote #39

Thanks for the reply, I've been trying all day to get it to work but I do not know how or where to add your changes.

Could you explain it a bit more please?

The other thing I was wondering is:
Code:
    if(PlayerLevel[id] >= 16) // Checks level.     {     set_user_health(id, 120);     }      if(PlayerLevel[id] >= 31) // Checks level.     {     set_user_health(id, 140);     }     if(PlayerLevel[id] >= 46) // Checks level.     {     set_user_health(id, 160);     }     if(PlayerLevel[id] >= 61) // Checks level.     {     set_user_health(id, 180);     }     if(PlayerLevel[id] >= 76) // Checks level.     {     set_user_health(id, 200);     }     if(PlayerLevel[id] == 90) // Checks level.     {     set_user_health(id, 255);     }

Will the above add the specified health for all levels above the one it checks for? I mean will it stack the health like at lvl 16 player will get 120 health, then at lvl 31 they will get 140, will the script give them both health bonuses? If it will how do I make it not?

Last edited by HexD; 03-30-2008 at 20:35.
HexD is offline
Send a message via MSN to HexD
Merko
Member
Join Date: Mar 2008
Old 03-30-2008 , 23:25   Re: New XP Mod tutorial
Reply With Quote #40

Hello.

As for your second Question no, they wont get their bonus for each level if they are like level 90+

However, if you wanna do that one time (lets say they can buy an item that adds 25 health)

Heres quick example.

Code:
if(PlayerLevel[id] <= 5) // If there user is level 1-5 or exactly 5.
{
new
health = get_user_health(id); // Setting the user's health in a variabel
set_user_health(id, health+25); // Set the users health to the 'old' health + gives him 25 extra health bonus.
}


To your first question.. give me some mins and I can see if Ican try explain it better : )

Edit: HexD What exactly are you trying to make that does not work? the code above should work.

Last edited by Merko; 03-30-2008 at 23:45.
Merko 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 15:50.


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