SA-MP Forums Archive
Database help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Database help (/showthread.php?tid=653096)



Database help - Xportaler - 26.04.2018

Hello. I need help how to change database all infos in aacount registered. I want to check all accounts example if players have playend more than 21 hours saved in database then set an variable in database from 0 to 1
I dont want to check just for players who logged in. For all even without connecting to server. So directly to database


Re: Database help - Bingo - 26.04.2018

Do you have a command in-game to check time? (If yes then paste that command here)


Re: Database help - Xportaler - 26.04.2018

I want to do it now. Soo


Re: Database help - xMoBi - 26.04.2018

u use sql or ini?


Re: Database help - Xportaler - 26.04.2018

Mysql ofcourse


Re: Database help - Xportaler - 26.04.2018

PHP код:
forward Checkveteran(); 
public 
Checkveteran() 

    for(new 
i;i<MAX_PLAYERS;i++) 
    { 
        if(
IsPlayerConnected(i)) 
        { 
            
pGeneral[i][PLR_VETERAN] = 0
            
pGeneral[i][OLD_HOURS] = 0
        } 
         
    } 
    
mysql_query_nodata("UPDATE `plr_veteran` SET `RANK_STATUS`=0,`RANK_UPDATED`=1"); 
     
mysql_query_nodata("UPDATE `plr_veteran` SET `RANK_STATUS`=1,`RANK_UPDATED`=1 WHERE `OLD_HOURS` > 20"); 
      
mysql_query_nodata("UPDATE plr_veteran SET `OLD_HOURS` = 0"); 
    return 
1

This is what im trying to do!


Re: Database help - Xportaler - 05.05.2018

BUMP!
Im trying to check if OLDHOURS > 20 set RANKSTATUS TO 1
But for all database! not just for players who connect