[HELP] What is wrong with this command?
#1

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
Reply
#2

you tell us, you got the errors?
Reply
#3

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

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.
Reply
#5

BUMP

Any ideas?

Reply
#6

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

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 ?
Reply
#8

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


Forum Jump:


Users browsing this thread: 6 Guest(s)