Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward LoadJobs();
- public LoadJobs()
- {
- new
- id,
- Cache:result,
- count_nb;
- result = mysql_tquery(dbhandle, "SELECT * FROM `server_jobs` ORDER BY id");
- if(cache_num_rows())
- {
- for(new i, count_nb = cache_get_row_count(); i < count_nb; i++)
- {
- id = cache_get_field_content_int(i, "id");
- if(i >= sizeof(Job_infos)) continue;
- //Job_infos[i][j_ID] = cache_get_field_content_int(i, "id");
- Job_infos[i][j_Type] = cache_get_field_content_int(i, "type");
- new nomjob[64];
- cache_get_field_content(i, "name", nomjob);
- format(Job_infos[i][j_Name], 64, "%s", nomjob);
- count_nb++;
- }
- }
- cache_delete(result);
- printf("Chargement de %d jobs.", count_nb);
- return 1;
- }
- stock SQLtoJOB(id)
- {
- if(id <= 0)
- {
- return -1;
- }
- for(new i = 0; i < sizeof(Job_infos); i++)
- {
- if(id == Job_infos[i][j_ID]) return i;
- }
- return -1;
- }
- CMD:joblist(playerid, params[])
- {
- new string[600];
- SendClientMessage(playerid, COLOR_TBLUE, "Liste des jobs du serveur:");
- SendClientMessage(playerid, COLOR_TBLUE, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯");
- for (new i = 0; i != MAX_JOBS; i ++)
- //for(new i = 0; i < sizeof(Job_infos); i++)
- {
- if(Job_infos[i][j_ID] > 0)
- {
- format(string, sizeof(string), "ID: %d | %s | TYPE: %d", Job_infos[i][j_ID], Job_infos[i][j_Name], Job_infos[i][j_Type]);
- SendClientMessage(playerid, -1, string);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement