13.12.2010, 20:07
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
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?
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;
}
it crashs my server. Where im i failing to happens this?