Raised This Month: $ Target: $400
 0% 

Reading Vault After Mapchange


Post New Thread Reply   
 
Thread Tools Display Modes
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
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-04-2005 , 22:31  
Reply With Quote #2

I tried TS's custom vault, but that won't even compile....

Code:
customvault.inc(26) : error 027: invalid character constant
customvault.inc(26) : warning 215: expression has no effect
customvault.inc(26) : error 001: expected token: ";", but found "-integer value-"
customvault.inc(26) : warning 215: expression has no effect
customvault.inc(26) : error 001: expected token: ";", but found ")"
customvault.inc(26) : fatal error 107: too many error messages on one line
[edit] wtf is strtok()!?
I've been working on this all night, and I'm no closer to finding anything out than I was when I started..
I'm soooo pissed off right now...any help would be reeeally appreciated...
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-05-2005 , 00:38  
Reply With Quote #3

strtok is in the string.inc. Anyway, the custom vault isn't The Specialist's. It was originally made by me and then remade by Suzuka. As for your problem, a few users have had problems with vault clearing itself or resetting data in the past. Maybe the vault has issues?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-05-2005 , 01:08  
Reply With Quote #4

Hmm...
If that's the case, then maybe someone should make a post in the "bugs" forum.. :S

Quote:
Originally Posted by XxAvalanchexX
Anyway, the custom vault isn't The Specialist's. It was originally made by me and then remade by Suzuka
...
You mean Twilight Suzuka?
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-05-2005 , 12:21  
Reply With Quote #5

rofl

I see TS and associate it with The Specialists.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-05-2005 , 17:30  
Reply With Quote #6

http://forums.alliedmods.net/showthr...?p=86866#90422

Anyways, thanks, Avalanche, it works now ^_^
I'll probably end up posting the plugin, although I don't know why anyone other than the crazy people on my server would want it...
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-05-2005 , 17:49  
Reply With Quote #7

Please do not use my code from custom vault.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-05-2005 , 22:01  
Reply With Quote #8

Yes, please use my cvault_array.inc

btw, the only problem with that cvault was the fact it converted the tab into three spaces, in strtok.
Attached Files
File Type: inc cvault_array.inc (3.3 KB, 155 views)
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
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 19:20.


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