24.08.2017, 23:45
Hi, I have create my in game mapping editor and I try to switch to MySQL R41
My problem is when I type /ocreate <modelid>, their is no object spawn like nothing happens
their is the commande
is it good ?
My problem is when I type /ocreate <modelid>, their is no object spawn like nothing happens
their is the commande
pawn Код:
COMMAND:ocreate(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new model,Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(sscanf(params, "i", model)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /ocreate [model ID]");
//format(dquery, sizeof(dquery), "INSERT INTO objects (ModelID, oX, oY, oZ, roX, roY, roZ) VALUES (%d, %f, %f, %f, %f, %f, %f)", model, x+2, y, z, 0, 0, 0);
//mysql_query(dquery,0,0,1);
format(sql, sizeof(sql), "INSERT INTO objects SET (ModelID, oX, oY, oZ, roX, roY, roZ) VALUES (%d, %f, %f, %f, %f, %f, %f)", model, x+2, y, z, 0, 0, 0);
mysql_pquery(MYSQL,sql);
//mysql_function_query(1, "SELECT MAX(ScriptID) FROM objects", true, "LoadSingleObject", "iiffffffi", playerid, sizeof(object),x +2,y,z,0,0,0,model);
mysql_tquery(MYSQL,"SELECT MAX(ScriptID) * FROM objects","LoadSingleObject","iiffffffi", playerid, sizeof(object),x +2,y,z,0,0,0,model);
return 1;
}

