[Help] DCMD Commands not working.
#1

They Compile without any errors, but have two warnings:
The (( params[] )) isn't being used, and if I get rid of it, a whole new world of problems occur.

The Main Problem is this: When I use a command in game nothing happens..not one thing happens.

/storedrugs
pawn Code:
dcmd_storedrugs(playerid, params[])
{
    new
        amount;
    if (sscanf(params, "d", amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /storedrugs [amount]");
    else if (amount > PlayerInfo[playerid][pDrugs]) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Drugs");
    else if (!IsPlayerInRangeOfPoint(playerid, 1.0, 1385.0627, -1893.2686, 13.4765)) SendClientMessage(playerid, COLOR_RED, "You aren't in the warehouse");
    else
    {
      new string[200];
        PlayerInfo[playerid][pDrugs] -= amount;
        PlayerInfo[playerid][pBag] += amount;
        SendClientMessage(playerid, 0x00FF00AA, "Drugs Stored.");
        format(string, sizeof(string), " %d Drugs in Warehouse ", PlayerInfo[playerid][pBag]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SendClientMessage(playerid, 0x00FF00AA, "/takedrugs to remove them.");
        SendClientMessage(playerid, 0x00FF00AA, "/checkdrugs to check amount.");
    }
    return 1;
}
/takedrugs
pawn Code:
dcmd_takedrugs(playerid, params[])
{
    new
        amount,
        string[200];
    if (sscanf(params, "d", amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /takedrugs [amount]");
    else if (amount > PlayerInfo[playerid][pBag]) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Drugs");
else if (!IsPlayerInRangeOfPoint(playerid, 1.0, 1385.0627, -1893.2686, 13.4765)) SendClientMessage(playerid, COLOR_RED, "You aren't in the warehouse");
    else
    {
        PlayerInfo[playerid][pDrugs] += amount;
        PlayerInfo[playerid][pBag] -= amount;
        format(string, sizeof(string), " %d Drugs in Warehouse ", PlayerInfo[playerid][pBag]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SendClientMessage(playerid, 0x00FF00AA, "Drugs Un-Stored.");
        SendClientMessage(playerid, 0x00FF00AA, "/storedrugs to store them.");
        SendClientMessage(playerid, 0x00FF00AA, "/checkdrugs to check amount.");
    }
    return 1;
}
/checkdrugs
pawn Code:
dcmd_checkdrugs(playerid, params[])
{
    new string[200];
    format(string, sizeof(string), " %d Drugs in Warehouse ", PlayerInfo[playerid][pBag]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, 0x00FF00AA, "/storedrugs to store them.");
    SendClientMessage(playerid, 0x00FF00AA, "/takedrugs to take them.");
    return 1;
}
Reply


Messages In This Thread
[Help] DCMD Commands not working. - by Ace_Menace - 04.12.2009, 20:44
Re: [Help] DCMD Commands not working. - by miokie - 04.12.2009, 20:50
Re: [Help] DCMD Commands not working. - by Backwardsman97 - 04.12.2009, 20:57
Re: [Help] DCMD Commands not working. - by Ace_Menace - 04.12.2009, 21:24
Re: [Help] DCMD Commands not working. - by Backwardsman97 - 04.12.2009, 21:39
Re: [Help] DCMD Commands not working. - by Ace_Menace - 04.12.2009, 22:08

Forum Jump:


Users browsing this thread: 1 Guest(s)