AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading Vault After Mapchange (https://forums.alliedmods.net/showthread.php?t=9953)

BlueRaja 02-04-2005 19:34

Reading Vault After Mapchange
 
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 02-04-2005 22:31

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...

XxAvalanchexX 02-05-2005 00:38

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?

BlueRaja 02-05-2005 01:08

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?

XxAvalanchexX 02-05-2005 12:21

rofl

I see TS and associate it with The Specialists.

BlueRaja 02-05-2005 17:30

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...

XxAvalanchexX 02-05-2005 17:49

Please do not use my code from custom vault.

Twilight Suzuka 02-05-2005 22:01

1 Attachment(s)
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.


All times are GMT -4. The time now is 19:20.

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