24.06.2014, 00:55
(
Последний раз редактировалось Connor Smith; 25.06.2014 в 23:20.
)
Код:
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;
}


