MySQL big problem
#1

Okay so I have new problem
I made another acc on localhost and it is created in DB. Problem is when I give myself an admin on one acc another acc is getting the same admin level. Before making second acc /setmoney worked fine. Now it won't add at all. I just have same ammout on both accs.. Here are /setmoney and /setadmin

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

    if(
PlayerInfo[playerid][Admin] < 4
    { 
        
ERROR(playerid"You are not allowed to use this command"); 
        return 
1
    } 
    new 
targetammount
    if(
sscanf(params"ui"targetammount)) 
    { 
        
USAGE(playerid"/setmoney [ID/Name] [Ammount]"); 
        return 
1
    } 
    if(!
IsPlayerConnected(target)) 
    { 
        
ERROR(playerid"That player is not connected"); 
        return 
1
    } 
    
ResetPlayerMoney(target); 
    
GivePlayerMoney(targetammount); 
    
PlayerInfo[target][Money] = ammount
    new 
string[128], string2[128], query[90]; 
    
format(stringsizeof(string), ""YELLOW"[INFO] "WHITE"Admin "SERVERBLUE"%s "WHITE"setted your money to "SERVERBLUE"%d"GetName(playerid), ammount); 
    
SCM(target, -1string); 
    
format(string2sizeof(string2), "[INFO] Admin %s setted %s %d$"GetName(playerid), GetName(target), ammount); 
    
AdminMessage(-1string2); 
    
WriteLog(MONEYstring2); 
    
mysql_format(g_SQLquerysizeof(query), "UPDATE `players` SET `Money` = %d WHERE `ID` = %d LIMIT 1"ammountPlayerInfo[target][ID]); 
    
mysql_tquery(g_SQLquery); 
    return 
1

//=============================== Admin Level 5 ================================// 
CMD:setadmin(playeridparams[]) 

    if(
PlayerInfo[playerid][Admin] < 5
    { 
        
ERROR(playerid"You are not allowed to use this command"); 
        return 
1
    } 
    new 
targetlevel
    if(
sscanf(params"ui"targetlevel)) 
    { 
        
USAGE(playerid"/setadmin [ID/Name] [Level]"); 
        return 
1
    } 
    if(!
IsPlayerConnected(target)) 
    { 
        
ERROR(playerid"That player is not online"); 
        return 
1
    } 
    if(
PlayerInfo[target][Admin] >= 1
    { 
        
ERROR(playerid"That player already has that admin level. Use /apromote or /ademote"); 
        return 
1
    } 
    
PlayerInfo[target][Admin] = level
    new 
string[128], string2[128], query[128]; 
    
mysql_format(g_SQLquerysizeof(query), "UPDATE `players` SET `Admin` = %d WHERE `ID` = %d LIMIT 1"levelPlayerInfo[playerid][ID]); 
    
mysql_tquery(g_SQLquery); 
    
format(stringsizeof(string), ""YELLOW"[INFO] "WHITE"Admin "SERVERBLUE"%s "WHITE" gave you Admin Level "SERVERBLUE"%d"GetName(playerid), level); 
    
SCM(target, -1string); 
    
format(string2sizeof(string2), "[INFO] Admin %s gave %s Admin Level %d"GetName(playerid), GetName(target), level); 
    
AdminMessage(-1string2); 
    
WriteLog(SETstring2); 
    return 
1

Reply


Messages In This Thread
MySQL big problem - by Micko123 - 11.11.2016, 05:51
Re: MySQL big problem - by Micko123 - 11.11.2016, 06:46
Re: MySQL big problem - by Banditul18 - 11.11.2016, 07:28
Re: MySQL big problem - by Micko123 - 11.11.2016, 08:01
Re: MySQL big problem - by Micko123 - 11.11.2016, 08:14

Forum Jump:


Users browsing this thread: 1 Guest(s)