10.01.2012, 23:58
(
Последний раз редактировалось Tanush123; 11.01.2012 в 01:23.
)
I used debug and after i get this
My script
Код:
[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)
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;
}