23.07.2012, 12:55
Hey everyone, Im trying to do some stuff with my jobs and I cant figure out how to do this.
Iv created a dialog where you choose a job you want to have.
The problem im having is the player is able to have two jobs if they are VIP. I need a way so they cant get the same job twice if they choose a job they arealy have. Here is what happens at the moment if they choose mechanic:
I want to make it so If they have no job at all then pJob will be set to mechanic. Otherwise if they do have a job and they arent level 2 VIP then a message saying "you already have a job" or if they are already a mechanic then "you are already a mechanic."
But if they are vip it will check if they have no job in vip slot, etc..
Can someone please help me with this, Id be greatly apreciative!
Iv created a dialog where you choose a job you want to have.
pawn Код:
CMD:joblist(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to login first before using any command.");
if(!IsPlayerInRangeOfPoint(playerid,2,387.0219,173.7238,1008.3828) && !IsPlayerInRangeOfPoint(playerid,2,1422.5873,-1844.9670,13.5469)) return SendClientMessage(playerid, COLOR_GREY, "You aren't at a job zone.");
if(PlayerInfo[playerid][pJob] && PlayerInfo[playerid][pVIP] < 2) return SendClientMessage(playerid, COLOR_GREY, "You already have a job.");
if(PlayerInfo[playerid][pJob] && PlayerInfo[playerid][pVIPJob] && PlayerInfo[playerid][pVIP] >= 2) return SendClientMessage(playerid, COLOR_GREY, "You already have two jobs, /quitjob then try again.");
if(IsPlayerInRangeOfPoint(playerid,2,387.0219,173.7238,1008.3828)) ShowDialog(playerid, 31);
else if(IsPlayerInRangeOfPoint(playerid,2,1422.5873,-1844.9670,13.5469)) ShowDialog(playerid, 32);
return 1;
}
pawn Код:
if(!PlayerInfo[playerid][pJob]) PlayerInfo[playerid][pJob] = JOB_MECHANIC;
else if(PlayerInfo[playerid][pVIP] >= 2) PlayerInfo[playerid][pVIPJob] = JOB_MECHANIC;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have joined the {FF6347}Mechanic {33CCFF}job, type /help to view your job commands.");
But if they are vip it will check if they have no job in vip slot, etc..
Can someone please help me with this, Id be greatly apreciative!