SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/03/2018, 02:11 PM   #1
Oficer
Big Clucker
 
Join Date: Sep 2015
Posts: 91
Reputation: 0
Default MySQL - data refresh

Hi, I have problem with MySQL BlueG r-41, I have command with query:
PHP Code:
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 Code:
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.
Oficer is offline   Reply With Quote
Old 10/03/2018, 03:11 PM   #2
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 728
Reputation: 3
Default Re: MySQL - data refresh

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

PHP Code:
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

PepsiCola23 is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data MySQL hoanduy Scripting Help 9 29/09/2017 01:44 PM
MySQL fetching data error invalid data type - NULL Hargrave Scripting Help 1 16/07/2016 04:23 PM
[Ajuda] NPC Refresh Sennior Português/Portuguese 7 03/05/2016 12:33 AM
Getting data from mysql. scriptit Scripting Help 2 01/12/2012 01:41 PM


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.