Mysql Problem
#1

I used debug and after i get this
Код:
[02:02:39] CMySQLHandler::Query(INSERT INTO orgvehs (ID,Vehicle,Model,X,Y,Z,A) VALUES (1,1,411,682.352050,-526.164062,15.897860,358.210418)) - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)
My script
pawn Код:
CMD:setoveh(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params,"ii",orgid,cars)) return SCM(playerid,grey,"USAGE: /setoveh [orgid] [car 1-8]");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid,red,"You aren't in any vehicle.");
    if(cars < 1 || cars > 9) return SCM(playerid,red,"ERROR: Available Cars 1-8");
    if(!DoesOrgExist(orgid))return SCM(playerid,red,"That organization does not exist.");
    GetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
    GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
    CheckMySQL();
    format(str,sizeof(str),"SELECT `Vehicle` AND `ID` FROM orgvehs WHERE `Vehicle` = '%d' AND `ID` = '%d' LIMIT 1",cars,orgid);
    mysql_query(str);
    format(str,sizeof(str),"INSERT INTO orgvehs (ID,Vehicle,Model,X,Y,Z,A) VALUES (%d,%d,%d,%f,%f,%f,%f)",orgid,cars,GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A);
    mysql_query(str);
    OrgInfo[orgid][Vehicle][cars] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
    mysql_query("ALTER TABLE orgvehs ORDER BY `ID`");
    //SetVehicleNumberPlate(ovehid,OrgInfo[orgid][Plate]);
/*  SetVehicleToRespawn(ovehid);*/
    DestroyVehicle(GetPlayerVehicleID(playerid));
    GetPlayerPos(playerid,X,Y,Z);
    SetPlayerPos(playerid,X,Y,Z+3);
    format(str,sizeof(str),"You have set vehicleid %d to organization vehicle, %s (Vehicle Slot: %d).",OrgInfo[orgid][Vehicle][cars],OrgInfo[orgid][Orgname],cars);
    SCM(playerid,-1,str);
    return 1;
}
Reply
#2

Use free result after
format(str,sizeof(str),"SELECT `Vehicle` AND `ID` FROM orgvehs WHERE `Vehicle` = '%d' AND `ID` = '%d' LIMIT 1",cars,orgid);// tee for my orgs table, the orgid is called "Orgid" not ID i know
mysql_query(str);
Reply
#3

same thing, doesnt work
Reply
#4

bump
Reply
#5

Are you for real? Bumping a thread within a minute?
Reply
#6

are you blind snowman ??
he posted it a day ago and not at the same day.

@tanu...
which mysql plugin
Reply
#7

Quote:
Originally Posted by Snowman12
Посмотреть сообщение
Are you for real? Bumping a thread within a minute?
How is it possible someone could bump a topic when there is a 120 second timer to reply again.

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
are you blind snowman ??
he posted it a day ago and not at the same day.

@tanu...
which mysql plugin
i use BlueG
Reply
#8

SELECT `Vehicle` AND `ID` wtf ?
Use
SELECT `Vehicle`,`ID`
Reply
#9

oh lol thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)