SAMP /quitjob - 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: SAMP /quitjob (
/showthread.php?tid=425403)
SAMP /quitjob -
Squirrel - 25.03.2013
My quitjob doesnt work.
It always says "You dont have a job"
Код:
CMD:quitjob(playerid, params[])
{
if(PlayerInfo[playerid][pJob] < 0)
{
PlayerInfo[playerid][pJob] = 0;
SendClientMessage(playerid, COLOR_RED, "<!>You have quited your job!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "<!>You dont even have a job!");
}
return 1;
}
0 should be default = no job
Re: SAMP /quitjob -
Faisal_khan - 25.03.2013
The problem is in the system where the job was assigned.
Re: SAMP /quitjob -
Squirrel - 25.03.2013
Let me show you how it looks.
This is my /join command. It's like joining a job etc. it works fully
Код:
CMD:join(playerid, params[])
{
if(PlayerInfo[playerid][pJob] > 1)
{
if(IsPlayerInRangeOfPoint(playerid, 5.00, -1790.9364,1428.6631,7.1875))
{
PlayerInfo[playerid][pJob] = 1;
SendClientMessage(playerid, COLOR_RED, "<!>Gradulations. You became Drug Dealer!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 5.00, -1713.6594,20.9223,3.5731))
{
PlayerInfo[playerid][pJob] = 2;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "<!>You already have a job! Type /quitjob to quit your job!");
}
return 1;
}
Re: SAMP /quitjob -
Vince - 25.03.2013
Please learn the difference between a < b (a is less than b) and a > b (a is greater than b). You say that 'no job' equals 0, yet you have it the other way round in both of your commands.
Re: SAMP /quitjob -
Faisal_khan - 25.03.2013
Less than 0?
pawn Код:
CMD:quitjob(playerid, params[])
{
if(PlayerInfo[playerid][pJob] = 1)
{
PlayerInfo[playerid][pJob] = 0;
SendClientMessage(playerid, COLOR_RED, "<!>You have quited your job!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "<!>You dont even have a job!");
}
return 1;
}
Re: SAMP /quitjob -
dominik523 - 25.03.2013
Do it like:
Код:
CMD:quitjob(playerid, params[])
{
if(PlayerInfo[playerid][pJob] > 0)
{
PlayerInfo[playerid][pJob] = 0;
SendClientMessage(playerid, COLOR_RED, "<!>You have quited your job!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "<!>You dont even have a job!");
}
return 1;
}
pJob can't be less than 0 since you have 0 and 1 job ids