Materials Error
#1

well, I've got an error that i can't seem to figure out.

Код:
	return 1;
	}
	if(strcmp(cmd, "/materials", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
		  if (PlayerInfo[playerid][pJob] != 1)
			{
			  SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not an arms dealer");
			  return 1;
			}
			new x_nr[256];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr)) {
				SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /materials [usage]");
				SendClientMessage(playerid, COLOR_WHITE, "[Usages:] getmats | sellmats");
				return 1;
			}
			if(strcmp(x_nr, "getmats", true) == 0)
			{
			  if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
			  {
			    if(MatsHolding[playerid] >= 10)
			    {
			      SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");
				    return 1;
			    }
			    tmp = strtok(cmdtext, idx);
			    if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /materials [usage]");
						SendClientMessage(playerid, COLOR_WHITE, "[Usages:] getmats | sellmats");
						return 1;
					}
					new moneys;
					moneys = strval(tmp);
					if(moneys < 1 || moneys > 10) { SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10"); return 1; }
					new price = moneys * 100;
					if(GetPlayerCash(playerid) > price)
					{
					  format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
					  SendClientMessage(playerid, COLOR_WHITE, string);
					  GivePlayerCash(playerid, - price);
					  MatsHolding[playerid] = moneys;
					}
					else
					{
					  format(string, sizeof(string), "[Error:] You do not have $%d", price);
					  SendClientMessage(playerid, COLOR_GREY, string);
					}
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
			    return 1;
			  }
			}
			else if(strcmp(x_nr, "sellmats", true) == 0)
			{
			  if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
			  {
			    if(MatsHolding[playerid] > 0)
			    {
			      new payout = (50)*(MatsHolding[playerid]);
			      format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
					  SendClientMessage(playerid, COLOR_WHITE, string);
			      PlayerInfo[playerid][pMaterials] += payout;
			      MatsHolding[playerid] = 0;
			    }
			    else
			    {
			      SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
				    return 1;
			    }
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
			    return 1;
			  }
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
			  return 1;
			}
		}
		return 1;
	}
Like i go to the materials pick-up and when i type in /materials getmats it says.


So if someone can help me out I'd appreciate it, and if it's not to much to ask can someone make it so that all i have to do is enter /getmats /sellmats instead of typing in /materials getmats etc..to long lol


Thanks in Advance.
Reply
#2

Try this (some indentation fucked up )
pawn Код:
if(strcmp(cmd, "/getmats", true) == 0)
  {
    if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
      {
        if(MatsHolding[playerid] >= 10)return SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");
       
            tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[Usages:] /getmats [amount]");

            new moneys;
            moneys = strval(tmp);
            if(moneys < 1 || moneys > 10) return SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10");

            new price = moneys * 100;
            if(GetPlayerCash(playerid) > price)
            {
                format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
              SendClientMessage(playerid, COLOR_WHITE, string);
              GivePlayerCash(playerid, - price);
              MatsHolding[playerid] = moneys;
            }
            else
            {
                format(string, sizeof(string), "[Error:] You do not have $%d", price);
            SendClientMessage(playerid, COLOR_GREY, string);
            }
            else return SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
        }
        return true;
    }
   
    if(strcmp(cmd, "/sellmats", true) == 0)
  {
    if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
    {
        if(MatsHolding[playerid] > 0)
            {
            new payout = (50)*(MatsHolding[playerid]);
            format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
              SendClientMessage(playerid, COLOR_WHITE, string);
                PlayerInfo[playerid][pMaterials] += payout;
            MatsHolding[playerid] = 0;
        }
        else SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
            else SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
            else SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
            }
        }
        return 1;
    }
Reply
#3

Well, that sorta worked, now it's got a few errors.

Код:
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(401) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(402) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(403) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(404) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(405) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(406) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(407) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(408) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(409) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(410) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(411) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(412) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(413) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(414) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(415) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(416) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(417) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(418) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(419) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(420) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(421) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(422) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(423) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(424) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(425) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(426) : error 004: function "PlayerToPoint" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#4

Quote:
Originally Posted by keujh
Well, that sorta worked, now it's got a few errors.

Код:
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(401) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(402) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(403) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(404) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(405) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(406) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(407) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(408) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(409) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(410) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(411) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(412) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(413) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(414) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(415) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(416) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(417) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(418) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(419) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(420) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(421) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(422) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(423) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(424) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(425) : error 004: function "PlayerToPoint" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(426) : error 004: function "PlayerToPoint" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Send me the code from line 402-426.
Reply
#5

does this seem retarded?
Код:
 GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(PlayerToPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(30, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(40, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(50, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(60, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(70, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(80, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(90, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(100, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(110, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(120, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(130, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(140, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(150, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(160, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(170, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(180, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(190, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(200, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(210, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(220, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(230, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(240, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(250, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(260, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(270, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(280, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(290, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(300, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(310, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(320, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(330, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(340, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(350, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(360, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else
	{
	  TextDrawSetString(Meter3[playerid], "~R~Out Of Range");
	  TextDrawSetString(Meter1[playerid], "~R~                  i");
	}
	return 1;
}
I sent you the whole like PlayerToPoint codes. from line 400 to line 443.


And this was the one u told me to change, ill send u this just incase i fucked up on a bracket or someshit.

Код:
	if(strcmp(cmd, "/getmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
	  {
   		if(MatsHolding[playerid] >= 10)return SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");

    		tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[Usages:] /getmats [amount]");

			new moneys;
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 10) return SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10");

			new price = moneys * 100;
			if(GetPlayerCash(playerid) > price)
			{
  				format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
			  SendClientMessage(playerid, COLOR_WHITE, string);
			  GivePlayerCash(playerid, - price);
			  MatsHolding[playerid] = moneys;
			}
			else
			{
  				format(string, sizeof(string), "[Error:] You do not have $%d", price);
		  	SendClientMessage(playerid, COLOR_GREY, string);
			}
			else return SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
  		}
		return true;
	}

	if(strcmp(cmd, "/sellmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
  	{
   		if(MatsHolding[playerid] > 0)
    		{
     		new payout = (50)*(MatsHolding[playerid]);
      		format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
			  SendClientMessage(playerid, COLOR_WHITE, string);
    			PlayerInfo[playerid][pMaterials] += payout;
     		MatsHolding[playerid] = 0;
   		}
    	else SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
			}
		}
		return 1;
	}
Reply
#6

Quote:
Originally Posted by keujh
does this seem retarded?
Код:
 GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(PlayerToPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(30, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(40, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(50, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(60, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(70, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(80, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(90, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(100, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(110, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(120, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(130, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(140, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(150, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(160, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(170, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(180, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(190, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(200, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(210, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(220, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(230, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(240, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(250, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(260, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(270, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(280, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(290, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(300, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(310, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(320, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(330, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(340, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(350, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(360, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else
	{
	  TextDrawSetString(Meter3[playerid], "~R~Out Of Range");
	  TextDrawSetString(Meter1[playerid], "~R~                  i");
	}
	return 1;
}
I sent you the whole like PlayerToPoint codes. from line 400 to line 443.


And this was the one u told me to change, ill send u this just incase i fucked up on a bracket or someshit.

Код:
	if(strcmp(cmd, "/getmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
	  {
  		if(MatsHolding[playerid] >= 10)return SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");

   		tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[Usages:] /getmats [amount]");

			new moneys;
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 10) return SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10");

			new price = moneys * 100;
			if(GetPlayerCash(playerid) > price)
			{
 				format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
			  SendClientMessage(playerid, COLOR_WHITE, string);
			  GivePlayerCash(playerid, - price);
			  MatsHolding[playerid] = moneys;
			}
			else
			{
 				format(string, sizeof(string), "[Error:] You do not have $%d", price);
		  	SendClientMessage(playerid, COLOR_GREY, string);
			}
			else return SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
 		}
		return true;
	}

	if(strcmp(cmd, "/sellmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
  	{
  		if(MatsHolding[playerid] > 0)
   		{
    		new payout = (50)*(MatsHolding[playerid]);
     		format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
			  SendClientMessage(playerid, COLOR_WHITE, string);
   			PlayerInfo[playerid][pMaterials] += payout;
     		MatsHolding[playerid] = 0;
   		}
    	else SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
			}
		}
		return 1;
	}
Try:
pawn Код:
GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(IsPlayerInRangeOfPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 20, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 30, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 40, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 50, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 60, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 70, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 80, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 90, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 100, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 110, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 120, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 130, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 140, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 150, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 160, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 170, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 180, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 190, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 200, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 210, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 220, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 230, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 240, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 250, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 260, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "
Reply
#7

Change 'PlayerToPoint' to 'IsPlayerInRangeOfPoint', and switch the first 2 parameters
example:
pawn Код:
else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
to
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 20, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
Reply
#8

Quote:
Originally Posted by Aber▲
Quote:
Originally Posted by keujh
does this seem retarded?
Код:
 GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(PlayerToPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(30, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(40, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(50, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(60, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(70, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(80, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(90, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(100, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(110, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(120, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(130, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(140, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(150, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(160, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(170, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(180, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(190, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(200, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(210, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(220, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(230, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(240, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(250, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(260, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(270, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(280, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(290, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(300, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(310, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(320, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(330, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(340, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(350, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(360, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else
	{
	  TextDrawSetString(Meter3[playerid], "~R~Out Of Range");
	  TextDrawSetString(Meter1[playerid], "~R~                  i");
	}
	return 1;
}
I sent you the whole like PlayerToPoint codes. from line 400 to line 443.


And this was the one u told me to change, ill send u this just incase i fucked up on a bracket or someshit.

Код:
	if(strcmp(cmd, "/getmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
	  {
  		if(MatsHolding[playerid] >= 10)return SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");

   		tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[Usages:] /getmats [amount]");

			new moneys;
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 10) return SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10");

			new price = moneys * 100;
			if(GetPlayerCash(playerid) > price)
			{
 				format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
			  SendClientMessage(playerid, COLOR_WHITE, string);
			  GivePlayerCash(playerid, - price);
			  MatsHolding[playerid] = moneys;
			}
			else
			{
 				format(string, sizeof(string), "[Error:] You do not have $%d", price);
		  	SendClientMessage(playerid, COLOR_GREY, string);
			}
			else return SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
 		}
		return true;
	}

	if(strcmp(cmd, "/sellmats", true) == 0)
  {
  	if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
  	{
  		if(MatsHolding[playerid] > 0)
   		{
    		new payout = (50)*(MatsHolding[playerid]);
     		format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
			  SendClientMessage(playerid, COLOR_WHITE, string);
   			PlayerInfo[playerid][pMaterials] += payout;
     		MatsHolding[playerid] = 0;
   		}
    	else SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
			else SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
			}
		}
		return 1;
	}
Try:
pawn Код:
GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(IsPlayerInRangeOfPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 20, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 30, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 40, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 50, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 60, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 70, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 80, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 90, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 100, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 110, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 120, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 130, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 140, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 150, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 160, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 170, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 180, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 190, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 200, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 210, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 220, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 230, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 240, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 250, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
    else if(IsPlayerInRangeOfPoint(playerid, 260, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "
Okay, now theres another error.
Код:
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(189) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(400) : warning 217: loose indentation
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(401) : warning 217: loose indentation
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(426) : error 037: invalid string (possibly non-terminated string)
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(426 -- 427) : error 001: expected token: ",", but found "else"
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(427) : warning 217: loose indentation
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(427) : error 029: invalid expression, assumed zero
C:\Users\keujh\Desktop\betterwork\GTA SA\gamemodes\Unique-RP.pwn(427) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#9

Quote:
Originally Posted by Joe Staff
Change 'PlayerToPoint' to 'IsPlayerInRangeOfPoint', and switch the first 2 parameters
example:
pawn Код:
else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
to
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 20, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
Uhm, I'm Kinda Stupid, so could you please be specific on which lines to change lol

Goes from 400 to 443
Код:
GetObjectPos(C4[playerid], bx[playerid], by[playerid], bz[playerid]);
  if(PlayerToPoint(10, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(20, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(30, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], " i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(40, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(50, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(60, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(70, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "   i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(80, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(90, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "    i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(100, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(110, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "     i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(120, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(130, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "      i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(140, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(150, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "       i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(160, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(170, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "        i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(180, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(190, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "         i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(200, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(210, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "          i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(220, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(230, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "           i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(240, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(250, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "            i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(260, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(270, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "             i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(280, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(290, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "              i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(300, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(310, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "               i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(320, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(330, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(340, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(350, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                 i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else if(PlayerToPoint(360, playerid, bx[playerid], by[playerid], bz[playerid])){ TextDrawSetString(Meter1[playerid], "                  i"); TextDrawSetString(Meter3[playerid], "   Range");}
	else
	{
	  TextDrawSetString(Meter3[playerid], "~R~Out Of Range");
	  TextDrawSetString(Meter1[playerid], "~R~                  i");
	}
	return 1;
}
Reply
#10

You were right to replace ALL of them, but I'm not sure why you're doing it that way. I could probably cut this down to 10 or so lines.
pawn Код:
new Float:x,Float:y,Float:z,Float:ox,Float:oy,Float:oz,tmpdist;
GetObjectPos(C4[playerid],ox,oy,oz);
GetPlayerPos(playerid,x,y,x);
tmpdist = floatsqroot( (ox-x)*(ox-x) + (oy-y)*(oy-y) + (oz-z)*(oz-z) );
new tmpspacestr[37]="                  ";
new tmptextstr[38];
format(tmptextstr,sizeof(tmptextstr),"%.*si",(tmpdist/10),tmpspacestr);
TextDrawSetString(Meter1[playerid],tmptextstr);
format(tmptextstr,sizeof(tmptextstr),"%s",((tmpdist/10)>36) ? ("~R~Out Of Range") : ("   Range"));
TextDrawSetString(Meter3[playerid],tmptextstr);
And that's your entire PlayerToPoint region. (Including the "~R~Out Of Range" part)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)