else if(strcmp(param, "create", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:x, Float:y, Float:z, dstring[180], DB_Query[180];
GetPlayerPos(playerid, x, y, z);
if(ex == (-1) || ey == (-1) || ez == (-1)) return SCM(playerid, COLOR_GREY, "/druglab create <ExitXPos>, <ExitYPos>, <ExitZPos>, <Name>");
mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `DrugLabs` ( `Name`, `ExitX`, `ExitY`, `ExitZ`, `EntranceX`, `EntranceY`, `EntranceZ`)\
VALUES ( %s, %f, %f, %f, %f, %f, %f)", name, ex, ey, ez, x, y, z);
mysql_tquery(Database, DB_Query);
format(dstring, sizeof(dstring), "Druglab created | Name: %s ", name);
SCM(playerid, COLOR_YELLOW, dstring);
}
}
String values must be enclosed in single quotes. Please always check the error log first.
|
else if(strcmp(param, "create", true) == 0) { if(PlayerInfo[playerid][pAdmin] >= 3) { new Float:x, Float:y, Float:z, dstring[180], DB_Query[180]; GetPlayerPos(playerid, x, y, z); if(ex == (-1) || ey == (-1) || ez == (-1)) return SCM(playerid, COLOR_GREY, "/druglab create <ExitXPos>, <ExitYPos>, <ExitZPos>, <Name>"); mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `DrugLabs` ( `Name`, `ExitX`, `ExitY`, `ExitZ`, `EntranceX`, `EntranceY`, `EntranceZ`)\ VALUES ( '%s', %f, %f, %f, %f, %f, %f)", name, ex, ey, ez, x, y, z); mysql_tquery(Database, DB_Query); format(dstring, sizeof(dstring), "Druglab created | Name: %s ", name); SCM(playerid, COLOR_YELLOW, dstring); } }
DB_Query[180]
mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `DrugLabs` ( `Name`, `ExitX`, `ExitY`, `ExitZ`, `EntranceX`, `EntranceY`, `EntranceZ`)\
VALUES ( %s, %f, %f, %f, %f, %f, %f)", name, ex, ey, ez, x, y, z);