- 0
Problema update mysql
-
Similar Content
-
- 17 answers
- 2,185 views
-
- 15 replies
- 5,055 views
-
- 8 replies
- 3,107 views
-
- 0 answers
- 20 views
-
- 0 replies
- 31 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
DeLeT.
Am incercat sa fac o comanda pe dosar sa se faca update dar imi da mie in loc sa dea respectivului.
CMD:mobil(playerid, params[])
{
if(P_Data[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, -1, "[*] You're not a level 1+ admin!");
new str[128],id,pname[MAX_PLAYER_NAME];
new query[200];
P_Data[playerid][pmobil] += 1;
if(sscanf(params, "us", id, params)) SendClientMessage(playerid, 0xFF0000FF, "Usage: /mobil<id> <pentu>");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
mysql_format(handle, query, sizeof(query), "UPDATE `account` SET `mobil`='%d' WHERE `ID`='%e'",P_Data[playerid][pDosar], playerid);// se face update la baza de date a playerului
mysql_query(handle, query);// se trimite mesajul catre baza de date.
if(playerid == id) SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
else
{
format(str, sizeof(str), "{FFFF00}Ai primit dosar {FFFFFF} %s {FFFF00}mobil: [%s].", pname, params);
GetPlayerName(id, pname, sizeof(pname));
format(str, sizeof(str), "{FFFF00}I-ai dat lui {FFFFFF} %s {FFFF00} ", pname, params);
SendClientMessage(playerid, 0xFF0000FF, str);
GetPlayerName(playerid, pname, sizeof(pname));
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}
Link to comment
Share on other sites
2 answers to this question
Recommended Posts