Adding a job - error index out of bounds.. how?
#3

PHP код:
CMD:makejob(playeridparams[])
{
    if(!
CheckAdmin(playeridHIGH_ADMIN_LEVEL)) return NotAuthMSG(playerid);
    new 
jobidname[64], Float:xFloat:yFloat:z;
    
/*if(sscanf(params,"ds[64]ddd", jobid, name)) return SyntaxMSG(playerid, "/makejob [jobid] [name]");
    its wrong change it to*/
if(sscanf(params,"ds[64]"jobidname)) return SyntaxMSG(playerid"/makejob [jobid] [name]");
PlayerPosX(playerid); PlayerPosY(playerid); PlayerPosZ(playerid);
    
format(JobsInfo[jobid][jobName], 128"%s"name);  // GETTING ERROR HERE (Array index out of bounds - acceing elemnt at index 6 past array upper bound 5)
    
JobsInfo[jobid][jobX] = x;
    
JobsInfo[jobid][jobY] = y;
    
JobsInfo[jobid][jobZ] = z;
    
JobsInfo[jobid][jobOn] = 1;
    
format(msgsizeof(msg), "A new job was added, [JobID: %d, Name: %s]"jobidname);
    
SCM(playeridCOLOR_REDmsg);
    
AddJobToFile(jobidnamexyz);
    return 
1;

and as about the concept of indices its should be 7 not 6
(the MAX_JOBS)
Reply


Messages In This Thread
Adding a job - error index out of bounds.. how? - by TheBigFive - 02.08.2016, 13:35
Re: Adding a job - error index out of bounds.. how? - by Konstantinos - 02.08.2016, 13:42
Re: Adding a job - error index out of bounds.. how? - by SyS - 02.08.2016, 13:44
Re: Adding a job - error index out of bounds.. how? - by TheBigFive - 02.08.2016, 14:06

Forum Jump:


Users browsing this thread: 5 Guest(s)