17.09.2011, 18:50
Hello. I want to update a cash on player's bank account - this value is in mysql. I have already make dialogs but my value doesn't update.
Code:
UpdateValue code
And how to make it's working?
Code:
Код:
ShowPlayerDialog(playerid,706,DIALOG_STYLE_INPUT,"{ADCAB6}Truck Drive {F2E088}Toll","Wybierz kwotę doładowania","Doładuj","Anuluj"); tolladded[playerid] = strval(inputtext); tollcash[playerid] = GetValue(playerid, "tollcash")+tolladded[playerid]; GivePlayerMoney(playerid,-tolladded[playerid]); UpdateValue(playerid, "tollcash", tollcash[playerid]);
Код:
public UpdateValue(playerid, field[], value) { new query[256]; format(query, 256, "UPDATE `users` SET %s = %d WHERE `uid` = '%d';", field, value, uID[playerid]); mysql_query(query); mysql_free_result(); return 1; }