05.02.2016, 21:54
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.
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?
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; }
For every other job it returns the "Not at a job point" text.
How can I fix this?