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;
}
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;
}
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;
}
#pragma unused params
Originally Posted by Backwardsman97
Did you look at what I posted? I think it could be all of those else if's. If you do it how I did it, it will work every time.
|