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

New XP Mod tutorial


Post New Thread Reply   
 
Thread Tools Display Modes
leon_devil94
Junior Member
Join Date: Oct 2008
Location: Kuala Lumpur , Malaysia
Old 11-25-2008 , 04:40   Re: New XP Mod tutorial
Reply With Quote #91

Can this save XP/Level/Rank by Nick/Name but not AuthID?
leon_devil94 is offline
Send a message via MSN to leon_devil94 Send a message via Yahoo to leon_devil94
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-27-2008 , 13:22   Re: New XP Mod tutorial
Reply With Quote #92

This is tutorial for saving xp, it's not a thing like: "can this do this and that?" You should learn from this, and then make your own plugins. If you read anything from the beginning, you should know that this saves the xp with AuthID. Thought that could be easily changed to save xp by name, still I can't imagine where you would need that.
SnoW is offline
Send a message via MSN to SnoW
leon_devil94
Junior Member
Join Date: Oct 2008
Location: Kuala Lumpur , Malaysia
Old 11-28-2008 , 06:27   Re: New XP Mod tutorial
Reply With Quote #93

By the way SnoW, I got a question to ask. I'm currently hosting a stupid + laggynes zombie server with a plugin that can save ammo pack but if i'm not mistaken,it save by AuthID and it can cause a lot of people's angry because sometimes they rejoin and their ammo packs gone and have to regain but if save with a name would be better in this case. Just need a tutorial on saving <something> by name
__________________
- This is what we do but the thing we do is not
- meant to be done.
- Life still carries on without it.
- So Guyz/Girlz, what you waiting for?! Wake up
- and ROCK the world where you belong to.
leon_devil94 is offline
Send a message via MSN to leon_devil94 Send a message via Yahoo to leon_devil94
Particlman
Member
Join Date: Nov 2005
Old 12-21-2008 , 15:21   Re: New XP Mod tutorial
Reply With Quote #94

I am getting an error and looking around i haven't been able to solve it. (I know this has no white space but I just wanted to show that I have it exactly the way it is in the tutorial and it isn't working.) Also if anyone can tell me how to make it so it isn't straight black so it is easier to read I will change it.

PHP Code:
public SaveData(id

    
// get the players steam id. We need this because we are saving by steam id 
    
new AuthID[35get_user_authid(id,AuthID,34
    new 
vaultkey[64],vaultdata[256
    
// format wat is going to be in the animal mod vault file 
    
format(vaultkey,63,"%s-Mod",AuthID
    
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) 
    
// save the data 
    
nvault_set(g_vault,vaultkey,vaultdata
    return 
PLUGIN_CONTINUE 

When I compile it gives me the errors

Error: Expected token: ";", but found "-identifier-" on line 191
Error: Expected token: ";", but found "-identifier-" on line 203

line 191 is
PHP Code:
new AuthID[35get_user_authid(id,AuthID,34
line 203 is the exact same line in the LoadData()

I had changed a couple things and thought it was something I changed but then I went back and copy/pasted exactly what you had here and it is still giving me the error.


EDIT:


I changed both of them to this and it compiles now with no errors or warnings. Is this the correct way to do it?

PHP Code:
    new AuthID[35]
    {
    
get_user_authid(id,AuthID,34)
    } 
I would also still like to know how to post so it isn't straight black the whole way.(Thanks Lee. Much easier to read when it's not black.)

Last edited by Particlman; 12-23-2008 at 13:58.
Particlman is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 12-22-2008 , 16:10   Re: New XP Mod tutorial
Reply With Quote #95

PHP Code:
new AuthID[35]
get_user_authid(id,AuthID,34
Curly braces are usually only used to denote where a loop, conditional, or enumeration block starts and ends.

Of course, for a SteamID to be 34 characters in length, each person on this planet would have to own approximately 1⅔×1013 Steam accounts.

You can use [php] or [pawn] tags. [pawn] tags are however rather buggy.
__________________
No support via PM.

Last edited by Lee; 12-22-2008 at 16:12.
Lee is offline
Particlman
Member
Join Date: Nov 2005
Old 12-23-2008 , 14:01   Re: New XP Mod tutorial
Reply With Quote #96

Didn't think I needed them but for some reason it was being difficult that night. I probably was just really tired and should have realized that fix.

Thanks for the help, and with php tags. They are, for me at least much easier on the eyes.
Particlman is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-26-2008 , 21:23   Re: New XP Mod tutorial
Reply With Quote #97

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "id" on line 43
Error: Undefined symbol "attacker" on line 45
Error: Undefined symbol "attacker" on line 48
Warning: Loose indentation on line 48
Warning: Loose indentation on line 50
Error: Undefined symbol "attacker" on line 51
Error: Undefined symbol "attacker" on line 53
Error: Undefined symbol "attacker" on line 55
Warning: Expression has no effect on line 55
Warning: Expression has no effect on line 55
Error: Undefined symbol "attacker" on line 55
Error: Undefined symbol "attacker" on line 58
Error: Undefined symbol "attacker" on line 59
Error: Invalid subscript, use "[ ]" operators on major dimensions on line 64
Warning: Expression has no effect on line 64
Error: Expected token: ";", but found "]" on line 64
Error: Invalid expression, assumed zero on line 64
Error: Too many error messages on one line on line 64

Compilation aborted.
13 Errors.
Could not locate output file C:\Program Files\AMX Mod X\amxxstudio\Untitled.amx (compile failed).
Help with this error on compiling.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 12-27-2008 , 14:43   Re: New XP Mod tutorial
Reply With Quote #98

read all posts and fix that
__________________

padilha007 is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-28-2008 , 01:04   Re: New XP Mod tutorial
Reply With Quote #99

Can anyone make the menu is show after the people join the team?Because people that come to my server don't know that my server using mod.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
Particlman
Member
Join Date: Nov 2005
Old 12-28-2008 , 14:06   Re: New XP Mod tutorial
Reply With Quote #100

Quote:
Originally Posted by ianglowz View Post
Can anyone make the menu is show after the people join the team?Because people that come to my server don't know that my server using mod.
https://forums.alliedmods.net/showth...ighlight=spawn

I used the hamsandwich version to do this
PHP Code:
public fwHamPlayerSpawnPost(id) {
    if (
is_user_alive(id)) 
    {
        if (
PlayerClass[id] == 0)
        {
            
ChangeClass(id)
        }
    }

That way it is not only when they join but anytime they spawn if they haven't picked one yet
Particlman 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 22:42.


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