if(!strcmp(choice, "give", true, 4))
{
//slot amount id
new Float: x, Float: y, Float: z;
new string[128];
GetPlayerPos(id, x, y, z);
//if(!IsNumeric(strval(slot))) return SendClientMessage(playerid, -1, "Command Usage: /i give [slot] [amount] [playerid]");
if(!slot) return SendClientMessage(playerid, -1, "Command Usage: /i give [slot] [amount] [playerid]");
if(slot == 1)
{
//if(amount > Player[playerid][InventorySlot1Amount] || !amount) return SendClientMessage(playerid, -1, "Command Usage: /i give slot [amount] [playerid]");
//if(id == INVALID_PLAYER_ID || IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Command Usage: /i give slot amount [playerid]");
if(IsPlayerInRangeOfPoint(playerid, 3, x, y, z))
{
if(Player[playerid][InventorySlot1Item] == 1)
{
if(Player[id][InventorySlot1Item] != 1 || Player[id][InventorySlot2Item] != 1 || Player[id][InventorySlot3Item] != 1 || Player[id][InventorySlot4Item] != 1 || Player[id][InventorySlot5Item] != 1 || Player[id][InventorySlot6Item] != 1 || Player[id][InventorySlot7Item] != 1 || Player[id][InventorySlot8Item] != 1 ||
Player[id][InventorySlot9Item] != 1 || Player[id][InventorySlot10Item] != 1 || Player[id][InventorySlot11Item] != 1 || Player[id][InventorySlot12Item] != 1)
{
if(Player[id][InventorySlot1Item] == 0)
{
Player[id][InventorySlot1Item] = 1;
Player[id][InventorySlot1Amount] += amount;
Player[playerid][InventorySlot1Amount] -= amount;
format(string, sizeof(string), "You gave %s %i bottle(s) of water.", GetName(id));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "%s gave you %i bottle(s) of water.", GetName(playerid));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "*%s gave %s %i bottle(s) of water.", GetName(playerid), GetName(id));
SetPlayerChatBubble(playerid, string, COLOR_LIGHTPURPLE, 10, 7000);
}
if(Player[playerid][InventorySlot1Item] == 1)
{
if(Player[id][InventorySlot1Item] != 1 || Player[id][InventorySlot2Item] != 1 || Player[id][InventorySlot3Item] != 1 || Player[id][InventorySlot4Item] != 1 || Player[id][InventorySlot5Item] != 1 || Player[id][InventorySlot6Item] != 1 || Player[id][InventorySlot7Item] != 1 || Player[id][InventorySlot8Item] != 1 ||
Player[id][InventorySlot9Item] != 1 || Player[id][InventorySlot10Item] != 1 || Player[id][InventorySlot11Item] != 1 || Player[id][InventorySlot12Item] != 1)
{
if(Player[id][InventorySlot1Item] == 0)
{
This thing is anonying .. and there is no LOGIC here
PHP код:
for advance help : tell me if it gives you the USAGE or no . |
if(Player[id][InventorySlot1Item] == 1) return Player[id][InventorySlot1Amount] += amount;
else if(Player[id][InventorySlot2Item] == 1) return Player[id][InventorySlot2Amount] += amount;
else if(Player[id][InventorySlot3Item] == 1) return Player[id][InventorySlot3Amount] += amount;
else if(Player[id][InventorySlot4Item] == 1) return Player[id][InventorySlot4Amount] += amount;
else if(Player[id][InventorySlot5Item] == 1) return Player[id][InventorySlot5Amount] += amount;
else if(Player[id][InventorySlot6Item] == 1) return Player[id][InventorySlot6Amount] += amount;
else if(Player[id][InventorySlot7Item] == 1) return Player[id][InventorySlot7Amount] += amount;
else if(Player[id][InventorySlot8Item] == 1) return Player[id][InventorySlot8Amount] += amount;
else if(Player[id][InventorySlot9Item] == 1) return Player[id][InventorySlot9Amount] += amount;
else if(Player[id][InventorySlot10Item] == 1) return Player[id][InventorySlot10Amount] += amount;
else if(Player[id][InventorySlot11Item] == 1) return Player[id][InventorySlot11Amount] += amount;
else if(Player[id][InventorySlot12Item] == 1) return Player[id][InventorySlot12Amount] += amount;