#2

All this can be done with variables. I made a quick example using items in pockets for a player. This isn't a /getbankmoney command. Try to learn what the code does, and learn how to make it for YOUR command.
pawn Код:
new
    bool:PocketFull[MAX_PLAYERS] = false; // Define a new boolean for the items, and set it to false for each player.
   
CMD:grab(playerid, params[]) // If they type the command "/grab"
{
    // Then it'll check if the player's pockets are full
    if(PocketFull == true) // If they are full
    {
        // Then it'll send the message below.
        SendClientMessage(playeird, -1, "Your pockets are already full!");
        return 1;
    }
    else // If the player's pockets aren't full
    {
        PocketFull[playerid] = true; // This makes it so their pockets are full.
        SendClientMessage(playerid, -1, "You have picked up something.");
    }
    return 1;
}

CMD:eat(playerid, params[]) // If the player typed the command "/eat"
{
    // The line below will check if the player's pockets are full.
    if(PocketFull[playerid] == true) // So if they are full
    {
        PocketFull[playerid] = false; // Then make their pockets empty.
        SendClientMessage(playerid, -1, "Your pockets are empty.");
        return 1;
    }
    else if(PocketFull[playerid] = false; // If they are empty.
    {
        // Then it'll send them the message below.
        SendClientMessage(playerid, -1, "Your pockets are empty!");
    }
    return 1;
}
Reply


Messages In This Thread
HELP - by 3RoR - 16.04.2012, 22:28
Re: HELP - by ReneG - 17.04.2012, 01:59
Re: HELP - by 3RoR - 17.04.2012, 06:48

Forum Jump:


Users browsing this thread: 1 Guest(s)