SA-MP Forums Archive
[HELP] job quit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] job quit (/showthread.php?tid=515694)



[HELP] job quit - Luca12 - 27.05.2014

Hello I have command job quit and know I have 5 hours of job contract and know I go /jobquit and it says You can not quit, you're done 5 of the required five hours of contract!

here is the command

pawn Код:
CMD:jobquit(playerid,params[])
{
    if(PlayerInfo[playerid][Job] == 0) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}You have no job!");
    if (0 <= PlayerInfo[playerid][JobContract] <= 5) return SCMF(playerid,COLOR_LIGHTBLUE,"You can not quit, you're done %d of the required five hours of contract!",PlayerInfo[playerid][JobContract]);
    PlayerInfo[playerid][Job] = 0;
    PlayerInfo[playerid][JobContract] = 0;
    SCM(playerid,COLOR_YELLOW,"*You have quit from the job.");
    return 1;
}



Re: [HELP] job quit - superwaldo92 - 27.05.2014

pawn Код:
CMD:jobquit(playerid,params[])
{
    if(PlayerInfo[playerid][Job] == 0) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}You have no job!");
    if (0 <= PlayerInfo[playerid][JobContract] < 5) return SCMF(playerid,COLOR_LIGHTBLUE,"You can not quit, you're done %d of the required five hours of contract!",PlayerInfo[playerid][JobContract]); // This line was incorrect as you've done if the player has less then or five hours of work. You need just the < symbol.
    PlayerInfo[playerid][Job] = 0;
    PlayerInfo[playerid][JobContract] = 0;
    SCM(playerid,COLOR_YELLOW,"*You have quit from the job.");
    return 1;
}