19.03.2015, 20:23
pawn Код:
CMD:createbusiness(playerid, params[])
{
if(GetAdminLevel(playerid) >= 5)
{
new BizName[40], Float:BizIntX, Float:BizIntY, Float:BizIntZ, Float:BizExtX, Float:BizExtY, Float:BizExtZ, BizPrice, BizInt;
if(sscanf(params, "s[40]fffdd", BizName, BizIntX, BizIntY, BizIntZ, BizInt, BizPrice)) return SendClientMessage(playerid, COLOR_RED, "Error: "COL_WHITE"/createbusiness [Name] [IntX] [IntY] [IntZ] [Interior] [Price]");
GetPlayerPos(playerid, BizExtX, BizExtY, BizExtZ);
CreateBusiness(BizName, BizPrice, BizIntX, BizIntY, BizIntZ, BizExtX, BizExtY, BizExtZ, BizInt);
}
return true;
}
pawn Код:
CreateBusiness(BizName, BizPrice, Float:BizIntX, Float:BizIntY, Float:BizIntZ, Float:BizExtX, Float:BizExtY, Float:BizExtZ, BizInt)
{
format(GlobalQuery, sizeof(GlobalQuery), "INSERT INTO `businesses` (Name, IntX, IntY, IntZ, ExtX, ExtY, ExtZ, Interior, Price) VALUES ('%s', %f, %f, %f, %f, %f, %f, %d, %d)", BizName, BizIntX, BizIntY, BizIntZ, BizExtX, BizExtY, BizExtZ, BizInt, BizPrice);
mysql_function_query(MySQLConnection, GlobalQuery, true, "BusinessSQLID", "");
return true;
}