I have provided to by myself in ZCMD and DCMD.
Here you go:
pawn Код:
CMD:setcash(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized to use that command!");
new str[105], TargetID, Ammount;
if(sscanf(params, "ud", TargetID, Ammount)) {
return SendClientMessage(playerid, 0xFFFFAAFF, "Usage: /SetCash (PlayerID/PartOfName) (Ammount)."); }
else if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFAAFF, "Player not connected.");
new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(TargetID, Name2, sizeof(Name2));
format(str, sizeof(str), "Adminstrator: %s has set %'s cash ammount to", Name1, Name2, Ammount);
SendClientMessageToAll(0xFFFFAAFF, str);
GivePlayerMoney(TargetID, Ammount);
return 1;
}
dcmd_setcash(playerid, params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized to use that command!");
new str[105], TargetID, Ammount;
if(sscanf(params, "ud", TargetID, Ammount)) {
return SendClientMessage(playerid, 0xFFFFAAFF, "Usage: /SetCash (PlayerID/PartOfName) (Ammount)."); }
else if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFAAFF, "Player not connected.");
new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(TargetID, Name2, sizeof(Name2));
format(str, sizeof(str), "Adminstrator: %s has set %'s cash ammount to", Name1, Name2, Ammount);
SendClientMessageToAll(0xFFFFAAFF, str);
GivePlayerMoney(TargetID, Ammount);
return 1;
}