format(query, sizeof(query), \"UPDATE `táblaneve` SET Level = %i, Name = \'%s\' WHERE Name = \'%s\'\", level, newname, GetName(target));mysql_query(query);mysql_free_result();
CMD:setlevel(playerid, params[]) { new target, level, newname[MAX_PLAYER_NAME], query[500], currname[MAX_PLAYER_NAME]; if(sscanf(params, \"uds[24]\", target, level, newname)) return SendClientMessage(playerid, -1, \"Használat: /setlevel [id / név] [szint] [új név]\"); if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, \"* Érvénytelen játékos ID!\"); GetPlayerName(target, currname, sizeof(currname)); format(query, sizeof(query), \"UPDATE `táblaneve` SET Level = %i, Name = \'%s\' WHERE Name = \'%s\'\", level, newname, currname); mysql_query(query); mysql_free_result(); return 1;}
/setlevel 43 4 Pistavagy/setlevel Joska 4 Pista
#include #include #define SCM SendClientMessagenew sql_handle = mysql_connect(...);CMD:setlevel(playerid, params){new jatekos, szint, ujnev[24], reginev[24];if(sscanf(params, \"uis[24]\", jatekos, szint, ujnev)) return SCM(playerid, -1, \"Használat: /setlevel [iD/NévRészlet] [szint] [Új Név]\");if(jatekos == INVALID_PLAYER_ID) return SCM(playerid, -1, \"Érvénytelen ID\");GetPlayerName(jatekos, reginev, sizeof(reginev));new query[1024];format(query, sizeof(query), \"UPDATE jatekosok SET Szint = %i, Name = \'%s\' WHERE Name = \'%s\'\", szint, ujnev, reginev);mysql_tquery(sql_handle, sql_query, \"\", \"\");return 1;}