Hello i made one command to make houses it was working but i edited it more ands its better but now the code its crashing the server
pawn Код:
command(house, playerid, params[])
{
new string[256];
new query[256];
new x_v[256];
new idx;
new intid,virtualworld,sale,sold;
x_v = strtok(params, idx);
if(!strlen(x_v))
{
SendClientMessage(playerid, COLOR_GREEN , " OPTIONS: create");
return true;
}
if(strcmp(x_v,"create",true) == 0)
{
intid = 0;
virtualworld = 0;
sale = 1;
sold = 0;
new Float:XX,Float:YY,Float:ZZ;
GetPlayerPos(playerid, XX, YY, ZZ);
format(query, sizeof(query), "INSERT INTO houses (id,entrancex,entrancey,entrancez,Interior,VirtualWorld,ForSale,Sold) VALUES (NULL,%f,%f,%f,%f,%f,%f,%d,%d,%d,%d);",XX,YY,ZZ,intid,virtualworld,sale,sold);
mysql_query(query);
CreatePickup(1273, 19, XX, YY, ZZ);
format(string, sizeof(string), " You have created one house at x: %f y:%f z:%f", XX,YY,ZZ);
SendClientMessage(playerid,COLOR_GREEN,string);
}
return 1;
}
if someone type just /house it displays the send client messages but if i do /house create
it crashs my server. Where im i failing to happens this?
Problem solved i forget to delete three float values from the query because im inserting the exit's floats manualy to the db : D