command crashing server
#1

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?
Reply
#2

Post your server and mysql log.
Reply
#3

At the mysql log its all alright but here is the crashinfo
Код:
 -------------------------

SA-MP Server: 0.3b



Exception At Address: 0x0047CAA0



Registers:

EAX: 0x4491CF00	EBX: 0xFFFFFFFF	ECX: 0x00000000	EDX: 0x0160BB18

ESI: 0x032E92A8	EDI: 0x0000000B	EBP: 0x00000000	ESP: 0x0012F120

EFLAGS: 0x00010206



Stack:

+0000: 0x0160BB18   0x41682000   0x0160BB18   0x0004E1B4

+0010: 0x0329ADC0   0x032908F8   0x00000F5A   0x0047E544

+0020: 0x004EAE95   0x00000FFF   0x00000000   0x0160BB18

+0030: 0x032EC680   0x0012F16C   0x0160BB18   0x032EC680

+0040: 0x00480A93   0x0160BB18   0x032EC680   0x00000004

+0050: 0x0012F188   0x00000000   0x00000000   0x00000100

+0060: 0x0160BB18   0x0160BB18   0x00000087   0x00401096

+0070: 0x0160BB18   0x032ECACC   0x0329AF00   0x00402BB3

+0080: 0x0160BB18   0x00000004   0x0012F1C0   0x032EC680

+0090: 0x0012F654   0x00000001   0x032ED2EC   0x0160BB18

+00A0: 0x00000001   0x00051798   0x00051780   0x000523E0

+00B0: 0x0004E4E4   0x000523CC   0x0004E4E4   0x032908F8

+00C0: 0x0329AF00   0x00000000   0x03290048   0x0000A608

+00D0: 0x00481C6E   0x0160BB18   0x0012F644   0x00000014

+00E0: 0x61657263   0x00006574   0x00007369   0x5F646D63

+00F0: 0x73756F68   0x00480065   0x0160BB18   0x0329AF00

+0100: 0x0004E4AC   0x0004E4C8   0x00000000   0x00000000

+0110: 0x00000000   0x00000000   0x00000000   0x00000000

+0120: 0x00000000   0x00000000   0x00000000   0x00000000

+0130: 0x00000000   0x00000000   0x00000000   0x00000000
Reply
#4

Problem solved i forget to delete three float values from the query because im inserting the exit's floats manualy to the db : D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)