02.05.2014, 20:43
I tried to do in this command whwn can give /quitjob after 2 hours quit the job, but not work, why?
pawn Код:
if(strcmp(cmd, "/quitjob", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] > 0)
{
if(PlayerInfo[playerid][pDonateRank] > 0)
{
if(PlayerInfo[playerid][pContractTime] >= 3)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You already forfilled your 2 hour Contract, and quited your Job.");
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pChar] = 0;
PlayerInfo[playerid][pContractTime] = 0;
}
else
{
new chours = 3 - PlayerInfo[playerid][pContractTime];
format(string, sizeof(string), "* You still have %d hours left to forfill and end your Contract.", chours / 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
else
{
if(PlayerInfo[playerid][pContractTime] >= 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You already forfilled your 0 hour Contract, and quited your Job.");
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pChar] = 0;
PlayerInfo[playerid][pContractTime] = 0;
}
else
{
new chours = 0 - PlayerInfo[playerid][pContractTime];
format(string, sizeof(string), "* You still have %d hours left to forfill and end your Contract.", chours / 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't even have a Job !");
}
}//not connected
return 1;
}