dcmd_givecash IS working but sending wrong messages
#3

pawn Код:
dcmd_givecash(playerid, params[])
{
    new amount, str[128];
    if(sscanf(params, "ud", giveplayerid, amount)) return SystemMessage(playerid, "USAGE: /givecash [playername/id] [amount]");
    if(!IsPlayerConnected(giveplayerid) || giveplayerid == playerid) return SystemMessage(playerid, "This player is not active.");
    if(amount < 1 || amount > GetPlayerMoney(playerid)) return SystemMessage(playerid, "Invalid amount.");
    GetName(playerid, playername);
    GetName(giveplayerid, giveplayer);
    GivePlayerMoney(playerid, -amount);
    GivePlayerMoney(giveplayerid, amount);
    format(str, sizeof(str), "You have given $%d to %s.", amount, giveplayer);
    SendClientMessage(playerid, COLOR_GREEN, str);
    format(str, sizeof(str), "%s has given you $%d.", playername, amount);
    SendClientMessage(giveplayer, COLOR_GREEN, str); // -----------------
    return 1;
}
________
Yamaha mm6 specifications
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)