Solved.
#1

pawn Код:
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)) //<----------- THIS LINE
    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;
}
The Line:
pawn Код:
else if (IsPlayerInRangeOfPoint(playerid, 1.0, 1385.0627, -1893.2686, 13.4765))
I want it to check and if this statement isn't true to SendClientMessage(...);
Reply
#2

pawn Код:
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)) return SendClientMessage(playerid,0xFF0000AA, "You are not near the drugstore");
    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;
}
Reply
#3

That's what I thought, thanks for confirming.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)