AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   load data problem i tried many things (https://forums.alliedmods.net/showthread.php?t=40634)

nightscreem 06-30-2006 19:52

load data problem i tried many things
 
ok I know there are many savedata/loaddata problems/questions around here
but I can't figure this one out
Code:
public client_authorized( id ) {     gPlayerClass[id] = CLASS_NONE;     gPlayerXP[id] = 0;     gPlayerLevel[id] = 0;         if( get_cvar_num( "sv_savexp" ) == 1 ) {         LoadXP( id );                 client_print( id, print_chat, "XP is loaded" );     } } // Loaded on Client Disconnect public client_disconnect( id ) {     if( get_cvar_num( "sv_savexp" ) == 1 ) {         SaveXP( id );                 client_print( id, print_chat, "XP is saved" );     } } SaveXP( id ) {     new authid[33];     get_user_authid( id, authid, 32 );         new vaultkey[64], vaultdata[64]     format( vaultkey, 63, "[LOTR]-%s-Class", authid );     format( vaultdata, 63, "%d", gPlayerClass[id] );     set_vaultdata( vaultkey, vaultdata );         format( vaultkey, 63, "[LOTR]-%s-XP", authid );     format( vaultdata, 63, "%d", gPlayerXP[id] );     set_vaultdata( vaultkey, vaultdata );         format( vaultkey, 63, "[LOTR]-%s-Level", authid );     format( vaultdata, 63, "%d", gPlayerLevel[id] );     set_vaultdata( vaultkey, vaultdata ); } // Load xp LoadXP( id ) {     new authid[33]     get_user_authid( id, authid, 32 );         new vaultkey[64], vaultdata[64]     format( vaultkey, 63, "[LOTR]-%s-Class", authid );     get_vaultdata( vaultkey, vaultdata, 63 );     gPlayerClass[id] = str_to_num( vaultdata );         format( vaultkey, 63, "[LOTR]-%s-XP", authid );     get_vaultdata( vaultkey, vaultdata, 63 );     gPlayerXP[id] = str_to_num( vaultdata );         format( vaultkey, 63, "[LOTR]-%s-Level", authid );     get_vaultdata( vaultkey, vaultdata, 63 );     gPlayerLevel[id] = str_to_num( vaultdata ); }

Xum 06-30-2006 20:10

Re: load data problem i tried many things
 
I don't think it's a problem of loading/saving xp. The problem is on public DeathMsg, because you will won't get xp if you make frags.

SixTwins fixed my plugin, take a look. Bellow is the sourcecode.
Code:

http://forums.alliedmods.net/attachment.php?attachmentid=8612&d=1151697545

nightscreem 07-01-2006 07:56

Re: load data problem i tried many things
 
nope I get 25xp each kill
when i kill someone so that's not the problem
saving works great but loading won't work

Hawk552 07-01-2006 11:32

Re: load data problem i tried many things
 
Quote:

Originally Posted by nightscreem
nope I get 25xp each kill
when i kill someone so that's not the problem
saving works great but loading won't work

Don't call it on client_authorized, I've had problems with that before even though that's supposed to be when they get their authid. Use client_putinserver.


All times are GMT -4. The time now is 07:57.

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