SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/07/2018, 06:38 PM   #1
t9ndep
Little Clucker
 
Join Date: Mar 2016
Posts: 13
Reputation: 4
Unhappy MySQL R41-4 - orm_insert not working and getting error

My server log


line: 21408
Code:
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
Code:
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
t9ndep is offline   Reply With Quote
Old 27/07/2018, 06:50 PM   #2
Florin48
Huge Clucker
 
Join Date: Nov 2015
Location: Romania
Posts: 266
Reputation: 5
Default Re: MySQL R41-4 - orm_insert not working and getting error

check if plugin version are the same with include version.
Florin48 is offline   Reply With Quote
Old 27/07/2018, 06:52 PM   #3
t9ndep
Little Clucker
 
Join Date: Mar 2016
Posts: 13
Reputation: 4
Default Re: MySQL R41-4 - orm_insert not working and getting error

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

https://pastebin.com/d3za4pTe
t9ndep is offline   Reply With Quote
Old 27/07/2018, 06:57 PM   #4
t9ndep
Little Clucker
 
Join Date: Mar 2016
Posts: 13
Reputation: 4
Default Re: MySQL R41-4 - orm_insert not working and getting error

Quote:
Originally Posted by Florin48 View Post
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..
t9ndep is offline   Reply With Quote
Old 27/07/2018, 07:00 PM   #5
Florin48
Huge Clucker
 
Join Date: Nov 2015
Location: Romania
Posts: 266
Reputation: 5
Default Re: MySQL R41-4 - orm_insert not working and getting error

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
Florin48 is offline   Reply With Quote
Old 27/07/2018, 07:05 PM   #6
t9ndep
Little Clucker
 
Join Date: Mar 2016
Posts: 13
Reputation: 4
Default Re: MySQL R41-4 - orm_insert not working and getting error

It's not working @Florin48, anyway... thank you
t9ndep is offline   Reply With Quote
Old 28/07/2018, 01:16 AM   #7
t9ndep
Little Clucker
 
Join Date: Mar 2016
Posts: 13
Reputation: 4
Default Re: MySQL R41-4 - orm_insert not working and getting error

can anyone save my life?
t9ndep is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use ORM_Insert ? xTremRaptor Scripting Help 2 07/11/2015 09:15 PM
MySql not working need help Nabster Scripting Help 18 03/04/2015 09:13 AM
MySQL not working. Shetch Scripting Help 6 25/01/2014 11:48 PM
MySQL not working? BittleRyan Scripting Help 7 27/03/2013 01:38 AM


All times are GMT. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.