/materials get - deliver
#1

Hello i got this lines from GF.pwn but it wont correctly with the coords i've added..
Can anyone help me why it wont work at those coords ? did i type them in wrong ?
Код:
	if(strcmp(cmd,"/materials",true)==0)
  {
    if(IsPlayerConnected(playerid))
	  {
		  if(OnDuty[playerid]==1)
			{
			  SendClientMessage(playerid,COLOR_GREY,"  You cant while being on duty !");
			  return 1;
			}
			new x_nr[256];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr)) {
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /materials [name]");
				SendClientMessage(playerid, COLOR_WHITE, "Available names: Get, Deliver.");
				return 1;
			}
			if(strcmp(x_nr,"get",true) == 0)
			{
			  if(PlayerToPoint(3.0,playerid,-2009.8693,13.5537,92.1647)) //problem is here
			  {
			    if(MatsHolding[playerid] >= 10)
			    {
			      SendClientMessage(playerid, COLOR_WHITE, "  You can't hold any more Materials Packages !");
				    return 1;
			    }
			    tmp = strtok(cmdtext, idx);
			    if(!strlen(tmp)) {
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /materials get [ammount]");
						return 1;
					}
					moneys = strval(tmp);
					if(moneys < 1 || moneys > 10) { SendClientMessage(playerid, COLOR_GREY, "  Package Number can't be below 1 or higher then 10 !"); return 1; }
					new price = moneys * 100;
					if(GetPlayerMoney(playerid) > price)
					{
					  format(string, sizeof(string), "* You bought %d Materials Packages for $%d.", moneys, price);
					  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					  GivePlayerMoney(playerid, - price);
					  MatsHolding[playerid] = moneys;
					}
					else
					{
					  format(string, sizeof(string), "  You can't afford the $%d !", price);
					  SendClientMessage(playerid, COLOR_GREY, string);
					}
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_GREY, "  You are not at the Materials Package Building in Los Santos !");
			    return 1;
			  }
			}
			else if(strcmp(x_nr,"deliver",true) == 0)
			{
			  if(PlayerToPoint(3.0,playerid,-1105.4072,37.9766,33.7790)) //problem is here
			  {
			    if(MatsHolding[playerid] > 0)
			    {
			      new payout = (50)*(MatsHolding[playerid]);
			      format(string, sizeof(string), "* The Factory gave you %d Materials for your %d Materials Packages.", payout, MatsHolding[playerid]);
					  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			      PlayerInfo[playerid][pMats] += payout;
			      MatsHolding[playerid] = 0;
			    }
			    else
			    {
			      SendClientMessage(playerid, COLOR_GREY, "  You don't have any Materials Packages !");
				    return 1;
			    }
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_GREY, "  You are not at the Materials Factory in San Fierro !");
			    return 1;
			  }
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid Materials Name !");
			  return 1;
			}
		}
		return 1;
	}
Reply
#2

Well I think you got the wrong coords. Because there is nothing wrong with that line. Try to get the coords again with /save
Reply
#3

Quote:
Originally Posted by ♣▒▓»RSC«Addy!▓▒♣
Well I think you got the wrong coords. Because there is nothing wrong with that line. Try to get the coords again with /save
Yeah i found out of it
Just me that took the wrong coords..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)