[Ajuda] Trocar EXP de todos os players MYSQL
#7

Quote:
Originally Posted by PedroH
View Post
UPDATE `tabela` SET respeito = respeito/2
Cara, muito obrigado, te dei um +rep, executei essa query, e funcionou, mas me ajuda a fazer isso como um comando pro servidor?
Porque por comando nгo estб funcionando, olha como eu fiz:
PHP Code:
// reset skills:
CMD:reset(playeridparams[]) {
    if(
admin[playerid] < 1337) return 0;
    if(
admstatus[playerid] == 0) return SendClientMessage(playerid, -1"You are in the player mode, you can not use this command! (use: /adminstats)");
    new 
skillselect[64], motivo[64];
    if(
sscanf(params,"ss"skillselectmotivo)) {
        
SendClientMessage(playerid, -1"Use: /resetskill [skill-id] [reason]");
        return 
1;
    }
    new 
query[512], nameOnTable[64], strx[128];
    if(!
strcmp(skillselect"lvl"true)) nameOnTable "experience";          
    else if(!
strcmp(skillselect"respect"true)) nameOnTable "respect";
    else if(!
strcmp(skillselect"pistol"true)) nameOnTable "PISTOLskills";
    else if(!
strcmp(skillselect"shotgun"true)) nameOnTable "SHOTGUNskills";
    else if(!
strcmp(skillselect"mp5"true)) nameOnTable "MP5skills";
    else if(!
strcmp(skillselect"ak47"true)) nameOnTable "AKskills";
    else if(!
strcmp(skillselect"m4"true)) nameOnTable "M4skills";
    else if(!
strcmp(skillselect"rifle"true)) nameOnTable "RIFLEskills";
    else if(!
strcmp(skillselect"sniper"true)) nameOnTable "SNIPERskills";
    else if(!
strcmp(skillselect"minigun"true)) nameOnTable "MINIGUNskills";
    
mysql_format(ConnectMYSQLquerysizeof(query), "UPDATE `accounts` SET `%s` = `%s`/2",
        
nameOnTable,
        
nameOnTable
    
);
    
format(strx,sizeof(strx),"AdmCmd: %s started a reset on SKILL %s. Reason: %s."PlayerName(playerid), skillselect, (motivo));
    
SendClientMessageToAll(COLOR_LIGHTREDstrx);
    
writeLog("LOGS/resets.txt",strx);
    return 
1;

Reply


Messages In This Thread
Trocar EXP de todos os players MYSQL - by binnyl - 14.04.2019, 18:36
Re: Trocar EXP de todos os players MYSQL - by PedroH - 14.04.2019, 18:54
Re: Trocar EXP de todos os players MYSQL - by binnyl - 14.04.2019, 20:09
Re: Trocar EXP de todos os players MYSQL - by Felipealves - 14.04.2019, 20:31
Re: Trocar EXP de todos os players MYSQL - by PedroH - 14.04.2019, 20:39
Re: Trocar EXP de todos os players MYSQL - by RenanMsV - 14.04.2019, 21:34
Re: Trocar EXP de todos os players MYSQL - by binnyl - 19.04.2019, 19:56

Forum Jump:


Users browsing this thread: 2 Guest(s)