MySQL - data refresh
#1

Hi, I have problem with MySQL BlueG r-41, I have command with query:
PHP код:
CMD:giveadmin(playeridparams[])
{
    new 
query[500];
    
mysql_format(DBquerysizeof(query), "UPDATE `test` SET `Admin`='%s' WHERE `Nick`='%s'"paramsGetPlayerNick(playerid)); 
    
mysql_query(DBquery); 
    return 
1;

And enum with data player
{
....
Admin
}

PHP код:
forward OnAccountLoad(playerid);  <-- When player is logging
public OnAccountLoad(playerid)
{
...
cache_get_value_int(0"Admin"Player[playerid][Admin]);

When Player is in game data are loaded and level admin is correct, but when I change this level I always must leave the game, to data has been re-loaded. How refresh data player in game ? (This is version MySQL with cache)

sorry for my english, I'm polish.
Reply
#2

you also has to set his variable so it applies imeddiately.

PHP код:
CMD:giveadmin(playeridparams[]) 

    
Player[playerid][Admin] = params;
    new 
query[500]; 
    
mysql_format(DBquerysizeof(query), "UPDATE `test` SET `Admin`='%s' WHERE `Nick`='%s'"paramsGetPlayerNick(playerid));  
    
mysql_query(DBquery);  
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)