New XP Mod tutorial
First of all, full credit goes to fxfighter, he revised it. All im doing is releasing this so that people wont go to the other xp mod tutorial (which doesnt work). And i added a little bit of extras so that it would be better. Anyways, on to the tutorial :) ...
Im going to show you have to make an XP mod. Before starting, you should have basic scripting Knowledge. Inculde all the important modules PHP Code:
Here there is 5, but if you want to add 2 more animals, like a bird and a fish, then you can put 7. But we are dealing with 5 PHP Code:
PHP Code:
Code: PHP Code:
Now we create the levels, and how many xp you ned to gain a level. There is 7 levels Code: PHP Code:
PHP Code:
Code: PHP Code:
PHP Code:
Here is the menu selector. It will give you the options to select your animal. It uses the new menu system. I dont feel like going into detail with the new menu system, here is the original tutorial on that PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Code:
#include <amxmodx> |
Re: New XP Mod tutorial
i read a little part, and your knife and hs pcvars are swapped :S
|
Re: New XP Mod tutorial
everything fixed :P thanks
|
Re: New XP Mod tutorial
Looks good, thanks a lot. The other one didn't work, so many people complained :roll:
|
Re: New XP Mod tutorial
Yeh many people were complaining so i was like "damn ill just make a New one" :D
|
Re: New XP Mod tutorial
You might want to change "client_connect" to "client_authorized".
Just to be safe. |
Re: New XP Mod tutorial
think you shuld add this to the death event so you cant get xp whit class none.
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: New XP Mod tutorial
Quote:
I did everything but the 3rd part because im very sleepy :P and i have to do other things. And u said it might bug, so yea. |
Re: New XP Mod tutorial
@flyen16
Can you tell me why are you using get_user_attacker() ? Code:
Using DeathMsg event, the killer is provided in the first argument ( read_data(1) ) and to know if it's a headshot, it's provided in the third argument ( read_data(3 ) ). And to know the weapon, see the fourth argument. |
Re: New XP Mod tutorial
Quote:
ill fix it, thx for telling me |
Re: New XP Mod tutorial
|
Re: New XP Mod tutorial
fixed
|
Re: New XP Mod tutorial
You have omitted the weapon.
|
Re: New XP Mod tutorial
fixed that problem
|
Re: New XP Mod tutorial
Is this for SQL or can It be used with a text file to save xp? Im working on a mod with these features but I dont know anything about SQL Databases. Thanks
LINKosc |
Re: New XP Mod tutorial
This isn't for sql, for sql view some of the sql tutorials, documentation, or plugin examples. I wrote an example last year using the older version of sql access, Hawk wrote information on how to use the newer SQL data access.
SQL Information, Code Examples, and Tutorials By: BAILOPAN Hawk552 TheNewt I recommend learning SQLx from Hawk's thread there. Mine's is the older version, and BAIL's there is an update to the API, not really a tutorial. |
Re: New XP Mod tutorial
my god... please someone just fix this tutorial !
There is NO "attacker" variable in the death func, and some other problems that occured upon compile... Please fix both the long and comented sections and the uncommented full code... :roll: |
Re: New XP Mod tutorial
Could you please post one without the classes and just leveling up with chosen names for each rank?:)
|
Re: New XP Mod tutorial
u forgot the attacker verible man use read_data (1)
and u used an id which is undeffined aswell |
Re: New XP Mod tutorial
i did use read_Data(1) read the code
Quote:
|
Re: New XP Mod tutorial
Quote:
|
Re: New XP Mod tutorial
Y thats why i fixed it.
|
Re: New XP Mod tutorial
Always wanted to make exp mod but never really knew how. Last tutorial didn't work. Thanks for making this.
I'd give you lots of respect and a +karma if you could add something though. This is nice and all, but it's pointless leveling up. Could you show everyone how to give people rewards at the certain levels? That way people actually WANT to level up and come back to the server :) |
Re: New XP Mod tutorial
simple, say you want to give them more damage on level 3 on damage event, check their level then if high enough level just add some damage.
|
Re: New XP Mod tutorial
you can hook roundstart or spawn to give at start like extra hp or ar.
You can check thare level after level up in the death msg to. |
Re: New XP Mod tutorial
basically you can do anything, just check if their level is high enough first, or if you have them choose skills to train that you have varriables to keep track of that:
psuedo: Code:
|
Re: New XP Mod tutorial
yes, so i just put in
[code] if(playerLevel[index] >= 10) { whatever i want to give them } and where do i put this? |
Re: New XP Mod tutorial
Quote:
|
Re: New XP Mod tutorial
Uh. Hi.
I'm new too amxx scripting so I was just wondring if there is somthing wrong with the code, or maybe I compile it wrong? :p I tried to compile it but I get the error: Code:
/home/groups/amxmodx/tmp3/phpXo7cEB.sma(43) : error 017: undefined symbol "id" Edit: Got everything to work :] |
Re: New XP Mod tutorial
There's an error in the code. You can either wait for a reply in the relevant topic or you can post the code that you're trying to compile in Scripting Help.
|
Re: New XP Mod tutorial
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..
|
Re: New XP Mod tutorial
it saves xp in nvault by steamid and i posted a small fix on page 2 in this thread.
|
Re: New XP Mod tutorial
Oh right ;).
Well I fixed it myself too hehe. :) |
Re: New XP Mod tutorial
How would I make it give different things for different classes at different levels?
|
Re: New XP Mod tutorial
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 . |
Re: New XP Mod tutorial
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:
PHP Code:
PHP Code:
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 } |
Re: New XP Mod tutorial
Nice , your learning fast
|
Re: New XP Mod tutorial
Except '||' signifies 'logical or' and not 'logical and' - you were looking for '&&'.
|
Re: New XP Mod tutorial
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:
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? |
Re: New XP Mod tutorial
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. |
All times are GMT -4. The time now is 01:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.