Jump to content
  • 0

Problema joburi


drkinder

Question

Salut,as mai avea si eu o problema.

Am un server GF,iar cand ma duc in pickupurile joburilor imi apare textul "You want to became an [numele jobului]type:/join,iar daca scriu /join imi spune "There is no race you can join".

Ce ar trebui sa fac ca sa funcioneze comanda join la joburi?

Asta este ce am eu in GM la /join:

if(strcmp(cmd, "/join", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pJob] == 0)
			{
			    if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,359.5408,206.7693,1008.3828))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Detective, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Detective, type /accept job.");
				    GettingJob[playerid] = 1;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,347.7374,193.7241,1014.1875))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Lawyer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Lawyer, type /accept job.");
				    GettingJob[playerid] = 2;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,1215.1304,-11.8431,1000.9219))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Whore, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Whore, type /accept job.");
				    GettingJob[playerid] = 3;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,2166.3772,-1675.3829,15.0859))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Drugs Dealer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Drugs Dealer, type /accept job.");
				    GettingJob[playerid] = 4;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,1109.3318,-1796.3042,16.5938))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Jacker, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Jacker, type /accept job.");
				    GettingJob[playerid] = 5;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,-1932.3859,276.2117,41.0391))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Mechanic, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Mechanic, type /accept job.");
				    GettingJob[playerid] = 7;
		  		}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,2226.1716,-1718.1792,13.5165))
				{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Bodyguard, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Bodyguard, type /accept job.");
				    GettingJob[playerid] = 8;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,1366.4325,-1275.2096,13.5469))
		  		{
    				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Arms Dealer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Arms Dealer, type /accept job.");
				    GettingJob[playerid] = 9;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,531.7930,-1292.4044,17.2422))
		  		{
		  		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Dealer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Dealer, type /accept job.");
				    GettingJob[playerid] = 10;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,766.0804,14.5133,1000.7004))
		  		{
		  		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Boxer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Boxer, type /accept job.");
				    GettingJob[playerid] = 12;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,1753.2321,-1894.4097,13.5572))
		  		{
		  		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Bus Driver, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Bus Driver, type /accept job.");
				    GettingJob[playerid] = 14;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,-2040.9436,456.2395,35.1719))
		  		{
		  		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Paper Boy, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Paper Boy, type /accept job.");
				    GettingJob[playerid] = 15;
		  		}
		  		else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,-77.7288,-1136.3896,1.0781))
		  		{
		  		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Trucker, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
				    GettingJob[playerid] = 16;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,-2073.8772,225.4153,35.8028))
		  		{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Hotz, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Hotz, type /accept job.");
				    GettingJob[playerid] = 17;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,860.9663,-985.2528,34.6266))
		  		{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Beggar, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Beggar, type /accept job.");
				    GettingJob[playerid] = 18;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,-382.4435,-1438.8563,25.7279))
		  		{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Farmer, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Farmer, type /accept job.");
				    GettingJob[playerid] = 19;
				}
				else if (GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,2195.8325,-1973.5117,13.5589))
		  		{
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Garbage Man, and get a 5 hour Contract.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Garbage Man, type /accept job.");
				    GettingJob[playerid] = 20;
				}
		  		else
		  		{
		  		    SendClientMessage(playerid, COLOR_WHITE, "You are not even near a place to get a Job !");
		  		}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "You already have a Job, use /quitjob first !");
			}
		}//not connected
	    return 1;
	}

Sper ca ma puteti ajuta.Multumesc :]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Am doua solutii pentru tine daca vrei, si acum dupa cum stii aceastas comanda se foloseste deoarece /join este m-ai invechit si mai greu pentru incepatori de SA:MP.

1. Poti adauga comanda /takejob, care este foarte simpla

	if(strcmp(cmd,"/takejob",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
            if(PlayerToPoint(25.0,playerid,361.8307,173.4456,1008.3828))
            {
               new x_nr[256];
			   x_nr = strtok(cmdtext, idx);
			   if(!strlen(x_nr)) {
				  SendClientMessage(playerid, 0x01CD67FF, "{3C9DF6}Utilizare Comanda{FFFFFF}: /takejob [nume]");
				  SendClientMessage(playerid, 0x01CD67FF, "{E0F000}^^ Joburi ^^{FFFFFF} Detectiv, Avocat, Whore, VanzatorDroguri, CarJacker");
				  SendClientMessage(playerid, 0x01CD67FF, "{E0F000}^^ Joburi ^^{FFFFFF} Mecanic, Badigard, VanzatorArme, SoferAutobuz");
				  SendClientMessage(playerid, 0x01CD67FF, "{E0F000}^^ Joburi ^^{FFFFFF} Ziarist, SoferTir);
				  return 1;
			   }
	           if(strcmp(x_nr,"Detectiv",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
                     SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Detectiv.");
					 PlayerInfo[playerid][pJob] = 1;
 					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"Avocat",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Avocat.");
					 PlayerInfo[playerid][pJob] = 2;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"Whore",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Whore.");
					 PlayerInfo[playerid][pJob] = 3;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"VanzatorDroguri",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Vanzator de Droguri.");
					 PlayerInfo[playerid][pJob] = 4;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"CarJacker",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
                     SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Vanzator de Masini.");
                     PlayerInfo[playerid][pJob] = 5;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"Mecanic",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Mecanic.");
					 PlayerInfo[playerid][pJob] = 7;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"Badigard",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Badigard.");
					 PlayerInfo[playerid][pJob] = 8;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"VanzatorArme",true) == 0)
			   {
			      if (GetPlayerState(playerid) == 1)
				  {
			        SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Vanzator de Arme.");
                    PlayerInfo[playerid][pJob] = 9;
				    PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"SoferAutobuz",true) == 0)
			   {
			       if (GetPlayerState(playerid) == 1)
				   {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Sofer Autobuz.");
					 PlayerInfo[playerid][pJob] = 14;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"Ziarist",true) == 0)
			   {
			       if (GetPlayerState(playerid) == 1)
				   {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Ziarist.");
					 PlayerInfo[playerid][pJob] = 15;
					 PlayerInfo[playerid][pContractTime] = 5;
				  }
			   }
			   if(strcmp(x_nr,"SoferTir",true) == 0)
			   {
			       if (GetPlayerState(playerid) == 1)
				   {
			         SendClientMessage(playerid, 0x00F5FFFF, "Ai luat jobul Sofer de Tir.");
					 PlayerInfo[playerid][pJob] = 16;
					 PlayerInfo[playerid][pContractTime] = 5;
				}
			}
		}
	}
    return 1;
	}
2. Bun, daca vrei sa rezolvam acel bug de la /join cauta in Gm-ul tau (CTRL+F) urmatoarea linie
There is no race you can join

Aici dupa ce gasesti acest text in GM-ul tau , dami tot ce gasesti in acel loc (toata functia sau comanda ce e)

P.S: Comanda ta /join para okay.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.