Solved. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Solved. (
/showthread.php?tid=111806)
Solved. -
Ace_Menace - 04.12.2009
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(...);
Re: [Help] DCMD -
GTAguillaume - 04.12.2009
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;
}
Re: [Help] DCMD -
Ace_Menace - 04.12.2009
That's what I thought, thanks for confirming.