21.01.2012, 15:13
(
Последний раз редактировалось Tanush123; 22.01.2012 в 15:38.
)
Im making dynamic jobs but for some reason the plate does not change or updates the mysql DB when i use /setjplate
pawn Код:
CMD:setjplate(playerid,params[])
{
new jobid,plate[11];
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"is[11]",jobid,plate)) return SCM(playerid,grey,"USAGE: /setjplate [jobid] [plate]");
if(!DoesJobExist(jobid)) return SCM(playerid,red,"ERROR: That Job does not exist.");
format(str,sizeof(str),"SELECT * FROM Jobs WHERE ID = '%d'",jobid);
mysql_query(str);
format(str,sizeof(str),"UPDATE Jobs SET Plate = '%s' WHERE ID = %d",plate,jobid);
mysql_query(str);
format(str,sizeof(str),"You have updated %s (jobid %d) vehicle's plate to %s",JobInfo[jobid][Jobname],jobid,plate);
SCM(playerid,COLOR_YELLOW,str);
format(JobInfo[jobid][Plate],11,"%s",plate);
SetVehicleNumberPlate(JobInfo[jobid][Car1],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car2],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car3],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car4],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car5],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car6],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car7],plate);
SetVehicleNumberPlate(JobInfo[jobid][Car8],plate);
return 1;
}
Код:
[17:44:34] CMySQLHandler::Query(UPDATE Jobs SET Plate = 'Pizza' WHERE ID = 1) - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)