MySQL R41-4 - orm_insert not working and getting error
#1

My server log


line: 21408
Код:
stock VehExORM(r, playerid)
{
    new ORM:ormid = Veh[playerid][r][ORM_ID] = orm_create("vehicles",MySQLCon);
    orm_addvar_int(ormid, Veh[playerid][r][ID], "ID"); //this is the key
    orm_addvar_int(ormid, Veh[playerid][r][Owner], "Owner");
    orm_addvar_int(ormid, Veh[playerid][r][Model], "Model");
    orm_addvar_float(ormid, Veh[playerid][r][PosX], "PosX");
    orm_addvar_float(ormid, Veh[playerid][r][PosY], "PosY");
    orm_addvar_float(ormid, Veh[playerid][r][PosZ], "PosZ");
    orm_addvar_float(ormid, Veh[playerid][r][VAngle], "VAngle");
    orm_addvar_int(ormid, Veh[playerid][r][Color1], "Color1");
    orm_addvar_int(ormid, Veh[playerid][r][Color2], "Color2");
    orm_addvar_int(ormid, Veh[playerid][r][Paintjob], "Paintjob");
    orm_addvar_int(ormid, Veh[playerid][r][Value], "Value");
    orm_addvar_int(ormid, Veh[playerid][r][Lock], "Lock");
    orm_addvar_int(ormid, Veh[playerid][r][Insurance], "Insurance");
    orm_addvar_string(ormid, Veh[playerid][r][Plate], 16, "Plate");
    orm_addvar_float(ormid, Veh[playerid][r][KM], "KM");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][0], "Mod0");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][1], "Mod1");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][2], "Mod2");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][3], "Mod3");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][4], "Mod4");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][5], "Mod5");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][6], "Mod6");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][7], "Mod7");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][8], "Mod8");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][9], "Mod9");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][10], "Mod10");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][11], "Mod11");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][12], "Mod12");
    orm_addvar_int(ormid, Veh[playerid][r][Mod][13], "Mod13");
    orm_addvar_string(ormid, Veh[playerid][r][Class], 13, "Class");
    orm_addvar_int(ormid, Veh[playerid][r][Damage][0], "Dmg0");
    orm_addvar_int(ormid, Veh[playerid][r][Damage][1], "Dmg1");
    orm_addvar_int(ormid, Veh[playerid][r][Damage][2], "Dmg2");
    orm_addvar_int(ormid, Veh[playerid][r][Damage][3], "Dmg3");
    orm_addvar_int(ormid, Veh[playerid][r][vTax], "Tax");
    orm_addvar_int(ormid, Veh[playerid][r][vFuel], "Fuel");
    orm_addvar_int(ormid, Veh[playerid][r][vSl], "Sl");
    orm_addvar_int(ormid, Veh[playerid][r][vHd], "Hd");
    orm_addvar_int(ormid, Veh[playerid][r][vDrugs], "Drugs");
    orm_addvar_int(ormid, Veh[playerid][r][vMats], "Mats");
    orm_addvar_int(ormid, Veh[playerid][r][vMoney], "Money");
    orm_addvar_int(ormid, Veh[playerid][r][vWE][0], "WE1");
    orm_addvar_int(ormid, Veh[playerid][r][vWE][1], "WE2");
    orm_addvar_int(ormid, Veh[playerid][r][vAM][0], "AM1");
    orm_addvar_int(ormid, Veh[playerid][r][vAM][1], "AM2");
    orm_addvar_int(ormid, Veh[playerid][r][vTOn], "tON");
    orm_addvar_string(ormid, Veh[playerid][r][Tt], 2, "tTxt");
    orm_setkey(ormid,"ID");
    orm_insert(ormid,"OnVehInsert","dd",r,playerid);
    return 1;
}
OnVehInsert
Код:
forward OnVehInsert(r, playerid);
public OnVehInsert(r, playerid)
{
    new Float:vp[3][4] = {
    { 298.5601,-1536.6544,24.2187,53.8474 },
    { 288.0786,-1522.2850,24.2187,234.5494 },
    { 297.5580,-1508.5419,24.2187,235.4181 } }, Float:vehx, Float:vehy, Float:vehz, Float:z_rot, Float:vh[3][4] = { { 1742.2977,-2438.9717,13.7323,164.0605 },
    { 1718.5531,-2639.3259,13.7236,34.0033 },
    { 1537.5046,-2639.1804,13.7216,44.5195 } };
    Veh[playerid][r][Owner] = pInfo[playerid][pID];
    new rand = random(sizeof(vp)), rand2 = random(sizeof(vh));
    if(pInfo[playerid][aVar][34] == 487 || pInfo[playerid][aVar][34] == 469 || pInfo[playerid][aVar][34] == 519 ? (Veh[playerid][r][ServerID] = CreateVehicle(pInfo[playerid][aVar][34], vh[rand2][0], vh[rand2][1], vh[rand2][2], vh[rand2][3], 1, 1, -1))
        : (Veh[playerid][r][ServerID] = CreateVehicle(pInfo[playerid][aVar][34], vp[rand][0], vp[rand][1], vp[rand][2], vp[rand][3], 1, 1, -1)))
    vVar[11][Veh[playerid][r][ServerID]] = playerid, Veh[playerid][r][Lock] = 1, SetVehicleParamsExx(Veh[playerid][r][ServerID],IsABike(Veh[playerid][r][ServerID]) ? (1) : (0),0,1,0,0,0,0), GetVehiclePos(Veh[playerid][r][ServerID], vehx, vehy, vehz), GetVehicleZAngle(Veh[playerid][r][ServerID], z_rot);
    Veh[playerid][r][PosX] = vehx, Veh[playerid][r][PosY] = vehy, Veh[playerid][r][PosZ] = vehz, Veh[playerid][r][VAngle] = z_rot;
    Veh[playerid][r][Model] = pInfo[playerid][aVar][34], Veh[playerid][r][Value] = pInfo[playerid][aVar][35], Veh[playerid][r][Color1] = 1, Veh[playerid][r][Color2] = 1, Veh[playerid][r][Paintjob] = 3,
    format(OwnName[Veh[playerid][r][ServerID]], MAX_PLAYER_NAME, "%s", pInfo[playerid][pUser]), KMVeh[Veh[playerid][r][ServerID]] = 0.0, vVar[5][Veh[playerid][r][ServerID]] = 1;
    format(Veh[playerid][r][Plate], MAX_PLAYER_NAME, "%s", pInfo[playerid][pUser]), SetVehicleNumberPlate(Veh[playerid][r][ServerID], pInfo[playerid][pUser]);
    orm_update(Veh[playerid][r][ORM_ID]);
    pInfo[playerid][pTotVeh]++, vVar[1][Veh[playerid][r][ServerID]] = 1, SetVehicleToRespawn(Veh[playerid][r][ServerID]), vVar[3][Veh[playerid][r][ServerID]] = GasMax, ChangeVehiclePaintjob(Veh[playerid][r][ServerID], 3);
    mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `TotVeh`=%d WHERE `ID`=%d", pInfo[playerid][pTotVeh], pInfo[playerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
    format(stmsg[playerid], 120, "Mua xe %s voi gia %s$ tu DealerShip.", g_VehicleNames[Veh[playerid][r][Model]-400], FormatNumber(Veh[playerid][r][Value])), addlog(stmsg[playerid], playerid, 6);
    return 1;
}
In r39-6, it's working well.. but when I updated mysql to r41-4.. It getting error..

Somebody help me.. Sorry for my bad English
Reply
#2

check if plugin version are the same with include version.
Reply
#3

Here is the full log, it's terrible..

https://pastebin.com/d3za4pTe
Reply
#4

Quote:
Originally Posted by Florin48
Посмотреть сообщение
check if plugin version are the same with include version.
I posted the full log, please check it ( I spend 12 hours trying to know what problem is.. can you help me

Everything working well, we get into the game, play well except "Buy car section"..

When someone buy car, the server gets down.. and It's show that error..
Reply
#5

try to change this [ orm_insert(ormid,"OnVehInsert","dd",r,playerid); ] in this [ orm_insert(Veh[playerid][r][ORM_ID],"OnVehInsert","dd",r,playerid); ]

or try to check plugin and include if they are the same
Reply
#6

It's not working @Florin48, anyway... thank you
Reply
#7

can anyone save my life?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)