Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Job[MAX_PLAYERS] = 0, JobRank[MAX_PLAYERS], JobSkin[MAX_PLAYERS];
- #define MAX_JOBS 4
- #define JOBS_RANKS 3
- new JobsSkinsByRank[MAX_JOBS][JOBS_RANKS] =
- {
- {280, 281, 282}, // POLICE
- {274, 275, 276}, // MEDIC
- {171, 240, 255}, // TAXI
- {8, 42, 50} // MECHANIC
- };
- stock SetPlayerJobSkinByRank(playerid)
- {
- // Funkcija skirta nustatyti darbo aprangą pagal darbo rangą.
- if(!Job[playerid]) return 0;
- new jobid = Job[playerid]-1, rank = JobRank[playerid];
- if(rank > JOBS_RANKS) return 0;
- new JobSkin[playerid] = JobsSkinsByRank[jobid][rank];
- SetPlayerSkin(playerid, JobSkin[playerid]);
- return 1;
- }
- CMD:myrank(playerid, params[])
- {
- new rangas;
- if(sscanf(params, "d", rangas)) return 1;
- if(!Job[playerid]) return SendClientMessage(playerid, -1, "Jūs neturite darbo!");
- new jobid = Job[playerid]-1;
- if(rangas < JOBS_RANKS)
- {
- JobRank[playerid] = rangas;
- SetPlayerJobSkinByRank(playerid);
- printf("skin id by rank: %d", JobSkin[playerid]);
- }
- else SendClientMessage(playerid, -1, "Nėra tokio rango!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement