15.05.2014, 10:02
i got some problem that we can give the cash in negative amount in this way we can take cash from it so how to know he used the -
pawn Код:
CMD:giveadmincash(playerid, params[])
{
new TargetID, cash,reason[500];
if(pInfo[playerid][Adminlevel] < 10) return SCM(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(sscanf(params, "uds[500]", TargetID, cash,reason)) return SCM(playerid, COLOR_RED, "USAGE: /giveadmincash [id] [cash] [reason]");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SCM(playerid, COLOR_RED, "*Player Is Not Connected.");
new Miney = pInfo[TargetID][Money];
pInfo[TargetID][Money] =Miney+cash;
new str[128],str1[128];
format(str,sizeof(str),"** Admin Has Given You $%d Cash. REASON : %s", cash,reason);
SCM(TargetID ,COLOR_SKYBLUE, str);
format(str1,sizeof(str1),"** CASH: %s(%d) (ADMIN CASH) Has Been Given Cash '$%d'. Reason %s", pInfo[TargetID][playername], TargetID, cash,reason);
SCMA(COLOR_HOTPINK, str1);
print(str1);
return 1;
}