MySQL errors
#1

I trying to make if a robber do something he will get 1+ point, so first I am going to test it in a command, but it has errors and I dont know how to fix it.

pawn Код:
CMD:skill(playerid,params[])
{
    new pname[24];
    new query[300];
    format(query, sizeof(query), "UPDATE playerdata SET copsskill=%d+1 WHERE user='%s'" PlayerInfo[playerid][pRobberskill], pname);
    mysql_query(query);
    return 1;
}
Код:
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : warning 215: expression has no effect
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : warning 215: expression has no effect
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : error 001: expected token: ";", but found ")"
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : error 029: invalid expression, assumed zero
C:\Users\Magdy\Desktop\Games\Server 0.3e\gamemodes\[DG]CNR.pwn(4683) : fatal error 107: too many error messages on one line
Reply
#2

If you have a statistics saving stock, why not just do this:
Код:
Playerinfo[playerid][pRobberskill]=PlayerInfo[playerid][pRobberskill]+1;
Reply
#3

Код:
CMD:skill(playerid,params[]){
    new pname[24];
    new query[300];
    GetPlayerName(playerid,pname,sizeof(pname));
    PlayerInfo[playerid][pRobberskill]++;
    format(query, sizeof(query), "UPDATE `"playerdata"` SET `copsskill`='%i' WHERE `user`='%s'", PlayerInfo[playerid][pRobberskill], pname);
    mysql_query(query); 
    return 1;
}
Reply
#4

Quote:
Originally Posted by Necro[ABK]
Посмотреть сообщение
Код:
CMD:skill(playerid,params[]){
    new pname[24];
    new query[300];
    GetPlayerName(playerid,pname,sizeof(pname));
    PlayerInfo[playerid][pRobberskill]++;
    format(query, sizeof(query), "UPDATE playerdata SET copsskill=%d WHERE user='%s'", PlayerInfo[playerid][pRobberskill], pname);
    mysql_query(query); 
    return 1;
}
That's a weird way to do it, just do it like this:

Код:
CMD:skill(playerid,params[]){
    new pname[24];
    new query[90];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(query, sizeof(query), "UPDATE playerdata SET copsskill=%d WHERE user='%s'", PlayerInfo[playerid][pRobberskill]+1, pname);
    mysql_query(query); 
    return 1;
}
Reply
#5

my way isnt weird its perfecto but w/e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)