String size.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: String size.. (
/showthread.php?tid=175819)
String size.. - [L3th4l] - 11.09.2010
Ok, so i started MySQL, i kinda get it by now. But i got this question.
When using the 'UPDATE' thingy ( lol ), i would love to get some help on the size of a string it needs for a simple command. let me explain
pawn Код:
CMD:setlevel(playerid, params[])
{
new ID, Level, query[300];
if(sscanf(params, "ui", ID, Level)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /SetLevel < PlayerID > < Level >");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "* That user is offline!");
format(query, sizeof(query), "UPDATE `playerinfo` SET `Level` = %d WHERE `user` = '%s'", Level, pName(ID));
mysql_query(query);
format(Msg, sizeof(Msg), "* Admin %s has made %s (%d) admin level %d", pName(playerid), pName(ID), ID, Level);
SendClientMessageToAll(COLOR_ORANGE, Msg);
SetPVarInt(playerid, "Level", Level);
return 1;
}
As you see, i use 'query[300]' just to update the player's level, is that how big the string size supposed to be? or am i using too much for just a command?
Re: String size.. -
willsuckformoney - 11.09.2010
256 is max string i think.