Setting Job Plate
#1

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)
Reply


Messages In This Thread
Setting Job Plate - by Tanush123 - 21.01.2012, 15:13
Re: Setting Job Plate - by Typhome - 21.01.2012, 15:42
Re: Setting Job Plate - by Tanush123 - 22.01.2012, 15:38
Re: Setting Job Plate - by T0pAz - 22.01.2012, 16:07
Re: Setting Job Plate - by Tanush123 - 22.01.2012, 16:28
Re: Setting Job Plate - by T0pAz - 22.01.2012, 16:38
Re: Setting Job Plate - by Tanush123 - 23.01.2012, 17:30
Re: Setting Job Plate - by Snowman12 - 23.01.2012, 17:36
Re: Setting Job Plate - by Tanush123 - 24.01.2012, 01:42
Re: Setting Job Plate - by Snowman12 - 24.01.2012, 01:46

Forum Jump:


Users browsing this thread: 1 Guest(s)