03.11.2014, 18:20
pawn Код:
#include <a_samp>
#include <zcmd>
#define MAX_JOBS 2 // Max Jobs
#define YourJobName 1 // Your Job Name
new wJob[MAX_PLAYERS];
// Get Job command
CMD:getjob(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, RANGE, X, Y, Z)) // Replace RANGE = Distance when he can use, and X,Y,Z with your pick-up coordinates
wJob[playerid] = 1; // 1 = YourJobName from defines !
SendClientMessage(playerid, -1, "{FF0000}[INFO]: {15FF00}You have chose your job."); // He will get a job !
return 1;
}
// For making a command only for that job :
CMD:CommandName(playerid, params[])
{
if(wJob[playerid] != 1) //Number "1" is your job name.
return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have this job"); // Get a message he haven't that job !
SendClientMessage(playerid,-1,"Your job command Text or code"); // If he have that job
return 1;
}
// For Quit Job (You don't have any job)
CMD:quitjob(playerid, params[])
{
wJob[playerid] = 0; //Now you don't have any job !
SendClientMessage(playerid,0xAFAFAFAA,"Now you're unemployed"); // Text
return 1;
}
http://www.solidfiles.com/d/d20f/zcmd.inc
- Hope I helped you. A good day !
- P.S: Sorry I writed so hard, I didn't see your comments, I was working .
![Smiley](images/smilies/smile.png)