Help with /getjob.
#1

I'm trying to make a dynamic job system in which you can do /getjob if you're in the range of the job position.

This is my code.

Код:
CMD:getjob(playerid, params[])
{
	for(new i = 0; i < MAX_JOBS; i++)
	{
		if(pInfo[playerid][pJob] == 0)
		{
			if(IsPlayerInRangeOfPoint(playerid, 5, jInfo[i][jPosX], jInfo[i][jPosY], jInfo[i][jPosZ]))
			{
				new string[256];
				format(string, sizeof(string), "* You have signed the contracts and you are now working as a %s.", jInfo[i][jName]);
				SendClientMessage(playerid, COLOR_ACHIEVEMENT, string);
				pInfo[playerid][pJob] = jInfo[i][jType];
			}
			else return SendClientMessage(playerid, COLOR_GREY, "You are not at a job point.");
		}
		else return SendClientMessage(playerid, COLOR_GREY, "You already have a job, use /quitjob instead.");
	}
	return 1;
}
I don't know why, but the command only works on the first job that loaded from the database.
For every other job it returns the "Not at a job point" text.
How can I fix this?
Reply


Messages In This Thread
Help with /getjob. - by danielpalade - 05.02.2016, 21:54
Re: Help with /getjob. - by Sascha - 05.02.2016, 21:56
Re: Help with /getjob. - by TopShooter - 05.02.2016, 22:02
Re: Help with /getjob. - by ikey07 - 05.02.2016, 22:16
Re: Help with /getjob. - by danielpalade - 05.02.2016, 22:18
Re: Help with /getjob. - by danielpalade - 05.02.2016, 22:21
Re: Help with /getjob. - by danielpalade - 05.02.2016, 22:26
Re: Help with /getjob. - by TopShooter - 05.02.2016, 22:39
Re: Help with /getjob. - by danielpalade - 06.02.2016, 01:03
Re: Help with /getjob. - by danielpalade - 06.02.2016, 15:44

Forum Jump:


Users browsing this thread: 2 Guest(s)