[WHATS WRONG]Command bugged
#1

Код:
			else if(strcmp(x_nr,"deliver",true) == 0)
			{
			    if(PlayerToPoint(3.0,playerid,-2119.5469,-178.5679,35.3203))
			    {
			        new packets = PlayerInfo[playerid][pMaterialsPack];
       				tmp = strtok(cmdtext, idx);
			        if(!strlen(tmp)) {
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /materials deliver [ammount]");
						return 1;
					}
					packets = strval(tmp);
			        if(PlayerInfo[playerid][pMaterialsPack] >= 0)
			        {
			            new payout = 10 * packets;
			            format(string, sizeof(string), "* Factory gave you %d materials for yours %d materials pack.", payout ,packets);
					    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            PlayerInfo[playerid][pMaterials] += payout;
			            PlayerInfo[playerid][pMaterialsPack] -= packets;
			        }
			        else
			        {
			            SendClientMessage(playerid, COLOR_GREY, "You dont have more materials pack!");
				        return 1;
			        }
			    }
			    else
			    {
			        SendClientMessage(playerid, COLOR_GREY, "You are not at factory!");
			        return 1;
			    }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Invalid name!");
			    return 1;
			}
		}
		return 1;
	}
When I type /materials deliver 2, but I have only 2 materials, money are going into minus[-] and gives me materials..
Reply


Messages In This Thread
[WHATS WRONG]Command bugged - by Connor Smith - 24.06.2014, 00:55
Re: [WHATS WRONG]Command bugged - by Amel_PAtomAXx - 24.06.2014, 02:40
Re: [WHATS WRONG]Command bugged - by Connor Smith - 24.06.2014, 11:30
Re: [WHATS WRONG]Command bugged - by Connor Smith - 24.06.2014, 22:57
Re: [WHATS WRONG]Command bugged - by Jefff - 24.06.2014, 23:08
Re: [WHATS WRONG]Command bugged - by Connor Smith - 25.06.2014, 23:20
Re: [WHATS WRONG]Command bugged - by Connor Smith - 26.06.2014, 12:44
Re: [WHATS WRONG]Command bugged - by Connor Smith - 27.06.2014, 12:27
Re: [WHATS WRONG]Command bugged - by Connor Smith - 30.06.2014, 22:46
Re: [WHATS WRONG]Command bugged - by Connor Smith - 04.07.2014, 00:22

Forum Jump:


Users browsing this thread: 1 Guest(s)