17.12.2011, 16:41
pawn Code:
CMD:takejob(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 4, -323.0505,2675.5161,63.6797)) //Mechanic
{
PlayerInfo[playerid][pJob] = 1;
SendClientMessage(playerid, COLOR_WHITE,"You are mechanic now.");
SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
}
if (IsPlayerInRangeOfPoint(playerid, 4, -245.1974,2724.2322,62.6875)) //Streetsweeper
{
PlayerInfo[playerid][pJob] = 2;
SendClientMessage(playerid, COLOR_WHITE,"You are streetsweeper now.");
SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
}
if (IsPlayerInRangeOfPoint(playerid,4, -227.7350,2721.9934,62.6875)) //Postman
{
PlayerInfo[playerid][pJob] = 3;
SendClientMessage(playerid, COLOR_WHITE,"You are postman now.");
SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You already have an job. Write /quitjob to quit job.");
}
}
return 1;
}