04.12.2009, 20:44
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
/takedrugs
/checkdrugs
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;
}
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;
}
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;
}