SA-MP Forums Archive
[HELP] What is wrong with this command? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] What is wrong with this command? (/showthread.php?tid=143521)



[HELP] What is wrong with this command? - FreddeN - 23.04.2010

Hello again, well, the title says it all.

Код:
if(strcmp(cmd, "/takejob", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pJob] == 0)
	    {
     		if(gTeam[playerid] == 1 || gTeam[playerid] == 2 || gTeam[playerid] == 3 || gTeam[playerid] == 4 || gTeam[playerid] == 5)
			  {
			    SendClientMessage(playerid, COLOR_GREY, "	You can not get a job if you are a faction member.");
			    return 1;
  			 	}
			  if(GetPlayerState(playerid) == 1 && PlayerToPoint(5.0, playerid, -1722.1085,-117.8422,3.5489))
				{
				  SendClientMessage(playerid, COLOR_LIGHTYELLOW, "Congratulations, you are now a truck driver.");
				  SendClientMessage(playerid, COLOR_LIGHTYELLOW, "Type /jobhelp for more information.");
  				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					PlayerPlayMusic(playerid);
					PlayerInfo[playerid][pJob] = 1;
				}
  			else if(GetPlayerState(playerid) == 2 && PlayerToPoint(5.0, playerid, -1059.9210,-1205.4829,129.2188))
				{
				  SendClientMessage(playerid, COLOR_LIGHTYELLOW, "Congratulations, you are now a farmer.");
				  SendClientMessage(playerid, COLOR_LIGHTYELLOW, "Type /jobhelp for more information.");
  				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					PlayerPlayMusic(playerid);
					PlayerInfo[playerid][pJob] = 2;
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "	You already have a job.");
			}
		}
		return 1;
	}
Thanks


Re: [HELP] What is wrong with this command? - cessil - 23.04.2010

you tell us, you got the errors?


Re: [HELP] What is wrong with this command? - FreddeN - 23.04.2010

Quote:
Originally Posted by cessil
you tell us, you got the errors?
No errors, if it was I would post them.


Re: [HELP] What is wrong with this command? - FreddeN - 23.04.2010

Basicly what happends is, I walk into the first PlayerToPoint and type /takejob and it works, when I try to walk into the second PlayerToPoint nothing happends.


Re: [HELP] What is wrong with this command? - FreddeN - 23.04.2010

BUMP

Any ideas?




Re: [HELP] What is wrong with this command? - Obie27 - 23.04.2010

Are you in a vehicle when your at the second point?


Re: [HELP] What is wrong with this command? - Adil - 23.04.2010

Quote:
Originally Posted by FreddeN
Basicly what happends is, I walk into the first PlayerToPoint and type /takejob and it works, when I try to walk into the second PlayerToPoint nothing happends.
Maybe because you didn't set your job back to = 0 ?


Re: [HELP] What is wrong with this command? - Onyx09 - 23.04.2010

yeah that must be it make a Command to set the player job back to 0 such as /quitjob