02.02.2017, 16:59
Code:
How can I make this trigger only if all the fields are filled?
PHP код:
CMD:createbuilding(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_GREY, "You are not allowed to use this!");
new Float:x, Float:y, Float:z, interior, vw, Float:ex, Float:ey, Float:ez, bname[120], DB_Query[256];
if (sscanf(params, "fffiis[120]", ex, ey, ez, interior, vw, bname)) SendClientMessage(playerid, COLOR_GREY, "> Type /createbuilding <exitposX> <exitposY> <exitposZ> <interior> <virtualworld> <name>");
{
GetPlayerPos(playerid, x, y, z);
mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `Buildings` ( `VirtualWorld`, `InteriorID`, `EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `Name`)\
VALUES ( %d, %d, %f, %f, %f, %f, %f, %f, '%s')", vw, interior, x, y, z, ex, ey, ez, bname);
mysql_tquery(Database, DB_Query);
SCM(playerid, COLOR_YELLOW, "Building created succesfully.");
SCM(playerid, COLOR_YELLOW, "Type /reloadbuildings when you done.");
}
return 1;
}