using format in my own function?
#1

Hello,

I am messing around with scripting for sa-mp. I would like to be able to use something similar to format, only in my own custom function.

For example, if I have this code:
Код:
new sPlayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sPlayer, MAX_PLAYER_NAME);

new Query[128];
format(Query, 128, "INSERT INTO `"SQL_USERS_TABLE"` (`money`) VALUES ('%d') WHERE `username`=`%s`", 1000, sPlayer);

mysql_query(Query);
Is it possible to instead have a function like "format_mysql_query".

Код:
new sPlayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sPlayer, MAX_PLAYER_NAME);

format_mysql_query("INSERT INTO `"SQL_USERS_TABLE"` (`money`) VALUES ('%d') WHERE `username`=`%s`", 1000, sPlayer);
which would combine format and mysql_query. Or something similar for format_SendClientMessage?

Thanks a lot,
showdown
Reply


Messages In This Thread
using format in my own function? - by showdown - 13.10.2013, 01:36
Re: using format in my own function? - by Fierro - 13.10.2013, 01:54
Re: using format in my own function? - by showdown - 13.10.2013, 05:05

Forum Jump:


Users browsing this thread: 1 Guest(s)