I didn't review your entire code, only the nvault stuff.
Code:
public mh_testMenu(id, menu, item)
{
switch(item)
{
case 0:
{
new szVal[10];
new iExists,iTimestamp;
get_user_name( id , szName , charsmax( szName ) );
//You forgot to do this:
formatex( szKey , charsmax( szKey ) , "%s-string", szName )
iExists = nvault_lookup( g_Vault , szKey , szVal , charsmax( szVal ) , iTimestamp );
if(iExists)
{
client_print(id,print_chat,"This user already entered string")
}
else
{
client_cmd(id, "messagemode Enter_string");
testmenu(id)
}
}
case 1:
{
client_print(id, print_chat,"Your string is saved");
save_string(id);
}
}
menu_destroy(menu);
}
Make sure you have the same when you use nvault_get() and nvault_set() or else it will not work. These keys must be identical if you expect to be able to retrieve the data.
PHP Code:
public load_string(id)
{
get_user_name( id , szName , charsmax( szName ) );
formatex( szKey , charsmax( szKey ) , "%s-string", szName );
nvault_get( g_Vault , szKey , Text);
server_print("the data is retry %s",Text);
return PLUGIN_CONTINUE;
}
public save_string(id)
{
get_user_name( id , szName , charsmax( szName ) );
formatex( szKey , charsmax( szKey ) , "%s-string", szName );
nvault_set( g_Vault , szKey , Text );
server_print("the data is saved %s",Text);
return PLUGIN_CONTINUE;
}
__________________