08.03.2019, 15:21
even when im in range of a job point,it says im not in range of a job point and i have a job in the data base with the coordonates saved,i don't know what's wrong with my command,this is the command and the load function
CMD:getjob(playerid, params[]){
if(PlayerInfo[playerid][pJob] != 0)
return SendClientMessage(playerid, COLOR_GREY, "You already have a job");
for(new i = 1; i <= MAX_JOBS; i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, JobInfo[i][jPosX], JobInfo[i][jPosY], JobInfo[i][jPosZ]))
return SendClientMessage(playerid, COLOR_GREY, "You aren't in range of any job point");
}
return 1;
}
function LoadJobs() {
new
Cache: db = mysql_query (mysql, "SELECT * FROM `jobs` ORDER BY `jobs`.`ID` ASC"),
x, jobs, result[180], string[180];
for (new i, j = cache_get_row_count (); i != j; ++i) {
jobs ++;
cache_get_field_content(i, "ID", result); x = strval(result);
cache_get_field_content(i, "Name", result); format(JobInfo[x][jName], 128, result);
//cache_get_field_content(i, "NeedLevel", result); JobInfo[x][jLevel] = strval(result);
cache_get_field_content(i, "PosX", result); JobInfo[x][jPosX] = floatstr(result);
cache_get_field_content(i, "PosY", result); JobInfo[x][jPosY] = floatstr(result);
cache_get_field_content(i, "PosZ", result); JobInfo[x][jPosZ] = floatstr(result);
}
printf("Jobs: %d", jobs);
cache_delete(db);
return 1;
}
CMD:getjob(playerid, params[]){
if(PlayerInfo[playerid][pJob] != 0)
return SendClientMessage(playerid, COLOR_GREY, "You already have a job");
for(new i = 1; i <= MAX_JOBS; i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, JobInfo[i][jPosX], JobInfo[i][jPosY], JobInfo[i][jPosZ]))
return SendClientMessage(playerid, COLOR_GREY, "You aren't in range of any job point");
}
return 1;
}
function LoadJobs() {
new
Cache: db = mysql_query (mysql, "SELECT * FROM `jobs` ORDER BY `jobs`.`ID` ASC"),
x, jobs, result[180], string[180];
for (new i, j = cache_get_row_count (); i != j; ++i) {
jobs ++;
cache_get_field_content(i, "ID", result); x = strval(result);
cache_get_field_content(i, "Name", result); format(JobInfo[x][jName], 128, result);
//cache_get_field_content(i, "NeedLevel", result); JobInfo[x][jLevel] = strval(result);
cache_get_field_content(i, "PosX", result); JobInfo[x][jPosX] = floatstr(result);
cache_get_field_content(i, "PosY", result); JobInfo[x][jPosY] = floatstr(result);
cache_get_field_content(i, "PosZ", result); JobInfo[x][jPosZ] = floatstr(result);
}
printf("Jobs: %d", jobs);
cache_delete(db);
return 1;
}