11.07.2015, 09:11
Hello,
Well, as the title says, my cash drop and pickup command doesn't work.
Here is the command.
Perhaps there is a small error from my carelessness.
EDIT: http://pastebin.com/Enug5mnU (same code, just in pastebin)
Well, as the title says, my cash drop and pickup command doesn't work.
Here is the command.
pawn Код:
CMD:cash(playerid, params[]) // cash_drop_system
{
static
amount,
type[24];
if (sscanf(params, "s[24]", type))
{
SendSyntaxMessage(playerid, "/cash [drop/pickup]");
return 1;
}
if (IsPlayerInAnyVehicle(playerid) || !IsPlayerSpawned(playerid))
return SendErrorMessage(playerid, "Љobrīd Jūs nevarat nomest/pacelt naudu!"); // you can't drop/pickup cash at this moment
if (!strcmp(type, "drop", true))
{
static
Float:x,
Float:y,
Float:z,
Float:angle;
if (sscanf(params, "i", amount))
return SendSyntaxMessage(playerid, "/cash [drop] [summa]");
if (amount < 1)
return SendErrorMessage(playerid, "Nevar nomest mazāk par $1!"); // can't drop less than $1
if (amount < PlayerData[playerid][pMoney])
return SendErrorMessage(playerid, "Jūs nevarat nomest vairāk, kā Jums ir."); // can't drop more than you have
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
DropCash(ReturnName(playerid, 0), amount, x, y, z, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
ApplyAnimation(playerid, "GRENADE", "WEAPON_throwu", 4.1, 0, 0, 0, 0, 0, 1);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s izņem daћas naudas zīmes un nomet tās zemē.", ReturnName(playerid, 0)); // takes out a few bucks and drops them on the ground
SendServerMessage(playerid, "Jūs nometāt %s uz zemes.", FormatNumber(amount)); // you have dropped AMOUNT on the ground
Log_Write("logs/cash/drop.txt", "[%s] %s has dropped %s.", ReturnDate(), ReturnName(playerid, 0), FormatNumber(amount));
}
else if (!strcmp(type, "pickup", true))
{
new
string[128],
id = Cash_Nearest(playerid);
if (id != -1)
{
if (PickupCash(playerid, id))
{
format(string, sizeof(string), "%s tika pievienoti Jūsu makam.", FormatNumber(DroppedCash[id][dCashQuantity])); // AMOUNT has been added to your wallet
SendClientMessage(playerid, COLOR_GREY ,string);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s pacēla uz zemes esoљos %s.", ReturnName(playerid, 0), FormatNumber(DroppedCash[id][dCashQuantity])); // has picked up AMOUNT from the ground
Log_Write("logs/cash/pickup.txt", "[%s] %s has picked up \"%s\".", ReturnDate(), ReturnName(playerid, 0), FormatNumber(DroppedCash[id][dCashQuantity]));
}
}
}
else SendSyntaxMessage(playerid, "/cash [drop/pickup]");
return 1;
}
EDIT: http://pastebin.com/Enug5mnU (same code, just in pastebin)