Weird Problem
#1

Hello guy's , I have this weird error , a command was working but now in gamemode it dosen't give error but on game it say's the command don't exist

Quote:

CMD:quitjob(playerid, params[])
{
new job = PlayerInfo[playerid][pJob];
if(job == JOBLESS) return SCM(playerid, COLOR_WHITE, "* You don't have a job to quit from.");
if(job == DRUGDEALER)
{
SCM(playerid, COLOR_WHITE, "Nu mai esti un dealer de droguri.");
PlayerInfo[playerid][pJob] = JOBLESS;
}
else
{
SCMEx(playerid, COLOR_YELLOWG, "Ai parsit job-ul %s, iar rankul tau a fost resetat", JobsInfo[job][jobName]);
PlayerInfo[playerid][pJob] = JOBLESS;
if(JobsInfo[job][jobRanks] > 0)
{
PlayerInfo[playerid][pJobRank] = 0;
}
}
return 1;
}

Reply
#2

The problem is the value of "job" and that is used in arrays.
pawn Код:
JobsInfo[job][jobName]
JobsInfo[job][jobRanks]
verify that the value of "job" is valid (between 0 and sizeof JobsInfo - 1) before using it in the above two.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)