03.08.2011, 21:52
Hello everyone, i'm back with a new question 
Well, i tried to make a /job command, player can use /job join/quit, i get no errors In Game but when type /job join or /job quit or type anything after job, Nothing happens...
Here's my command code
Thanks.

Well, i tried to make a /job command, player can use /job join/quit, i get no errors In Game but when type /job join or /job quit or type anything after job, Nothing happens...
Here's my command code
Код:
COMMAND:job(playerid, params[])
{
new option[4];
if(sscanf(params,"s[4]", option))return SendClientMessage(playerid, GREY, "USAGE: /job [join/quit]");
if(strlen(option) < 1) return SendClientMessage(playerid, GREY, "Invalid option.");
else if(!strcmp(option, "join", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, -361.4394,1572.8923,75.9229))
{
if(PlayerStat[playerid][JobID] >= 1) return SendClientMessage(playerid, GREY, "You already have a job (use /job quit to leave it).");
SendClientMessage(playerid, GREY, "You have joined the Garbage Man job.");
PlayerStat[playerid][JobID] = 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -1958.6456,323.6250,1552.1406))
{
if(PlayerStat[playerid][JobID] >= 1) return SendClientMessage(playerid, GREY, "You already have a job (use /job quit to leave it).");
SendClientMessage(playerid, GREY, "You have joined the Table Cleaner job.");
PlayerStat[playerid][JobID] = 2;
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -1971.0381,324.3919,1552.1387))
{
if(PlayerStat[playerid][JobID] >= 1) return SendClientMessage(playerid, GREY, "You already have a job (use /job quit to leave it).");
SendClientMessage(playerid, GREY, "You have joined the Cells Cleaner job.");
PlayerStat[playerid][JobID] = 3;
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -349.1976,1544.5193,75.5625))
{
if(PlayerStat[playerid][JobID] >= 1) return SendClientMessage(playerid, GREY, "You already have a job (use /job quit to leave it).");
SendClientMessage(playerid, GREY, "You have joined the Boxer job.");
PlayerStat[playerid][JobID] = 4;
}
/*else if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,0,0))
{
if(PlayerStat[playerid][JobID] >= 1) return SendClientMessage(playerid, GREY, "You already have a job (use /job quit to leave it).");
SendClientMessage(playerid, GREY, "You have joined the Boxs Boy job.");
PlayerStat[playerid][JobID] = 5;
}*/
else return SendClientMessage(playerid, GREY, "You are not near any Job right now.");
}
else if(!strcmp(option, "quit", true))
{
new string[128];
if(PlayerStat[playerid][JobID] < 1) return SendClientMessage(playerid, GREY, "You don't have a job to quit.");
if(PlayerStat[playerid][HoursInJob] <= 4)
{
format(string, sizeof(string), "You must get 5 paychecks before quiting your job. you currently have (%d)." , PlayerStat[playerid][HoursInJob]);
SendClientMessage(playerid, GREY, string);
}
else
{
SendClientMessage(playerid, GREY, "You have successfully quited your job.");
PlayerStat[playerid][HoursInJob] = 0;
PlayerStat[playerid][JobID] = 0;
}
}
return 1;
}



