Raised This Month: $ Target: $400
 0% 

Reading Vault After Mapchange


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-04-2005 , 19:34   Reading Vault After Mapchange
Reply With Quote #1

I have the following code:
Code:
public login(id) {     new steamid[34]     get_user_authid(id,steamid,33)     new key_kills[129],key_name[129]     format(key_kills,128,"%s%s%s",PLUGIN,KILLS,steamid)     format(key_name,128,"%s%s%s",PLUGIN,NAME,steamid)     if(vaultdata_exists(key_kills))     {         if (change_name(id))         {             has_character[id]=true             return 1         }             } else     {         set_vaultdata(key_kills,"0")         new name[21]         get_user_name(id,name,20)         set_vaultdata(key_name,name)         if (change_name(id))         {             has_character[id]=true             return 1         }     }     return 0 }
If I call login() at any given time (and it's already been called before on this player), if(vaultdata_exists(key_kills)) evaluates as true. The same is true if I/the player disconnect/s from the server and reconnect/s a few minutes later.
If, however, I change the map (using map, changelevel, or amx_map) and call login() on a player, if(vaultdata_exists(key_kills)) is presumably evaluated as false, because the data in the vault (which, up until login() is called, still exists) is overtwritten (setting kills back to 0).
I've exausted my brain and I still can't figure out why this is happening - any clues?
[edit] Apparently ftp was being stupid, and the vault is actually being rebuilt on mapchange..
Isn't the vault supposed to stay between maps?
[edit2] no, it's being rebuilt when login() is called, but only after a mapchange...
wtf!?
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
 


Thread Tools
Display Modes

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 19:20.


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