#1

Removed.
Reply
#2

Post your givemoney cmd...
Reply
#3

Removed
Reply
#4

pawn Код:
CMD:givemoney(playerid,params[]) {
    new Moneys,giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],playerMoney[MAX_PLAYERS],string[64];
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
    if (sscanf(params, "ud",giveplayerid, Moneys)) return SendMessageToPlayer(playerid, COLOR_LIGHTBLUE, "USAGE: /givemoney [playerid] [amount]");
    if (IsPlayerConnected(giveplayerid)) {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        playerMoney[playerid] = GetPlayerMoney(playerid);
        if (Moneys > 0 && playerMoney[playerid] >= Moneys) {
            GivePlayerMoney(playerid, (-Moneys));
            GivePlayerMoney(giveplayerid, Moneys);
            format(string, sizeof(string), "You sent %s (id: %d), $%d.", giveplayer,giveplayerid, Moneys);
            SendMessageToPlayer(playerid, green, string);
            format(string, sizeof(string), "You recieved $%d from %s (id: %d).", Moneys, sendername, playerid);
            SendMessageToPlayer(giveplayerid, green, string);
            printf("%s sent $%d to %s", sendername, Moneys, giveplayername);
        else {
            SendMessageToPlayer(playerid, COLOR_BRIGHTRED, "Invalid transaction amount.");}}
    else {
        format(string, sizeof(string), "ID:%d is not an active player.", giveplayerid);
        SendMessageToPlayer(playerid, COLOR_BRIGHTRED, string);}
    return 1;
}
Reply
#5

Removed
Reply
#6

Make a file called money.txt in your scriptfiles and use this code:
pawn Код:
CMD:givemoney(playerid,params[]) {
    new Moneys,giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],playerMoney[MAX_PLAYERS],string[64];
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
    if (sscanf(params, "ud",giveplayerid, Moneys)) return SendMessageToPlayer(playerid, COLOR_LIGHTBLUE, "USAGE: /givemoney [playerid] [amount]");
    if (IsPlayerConnected(giveplayerid)) {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        playerMoney[playerid] = GetPlayerMoney(playerid);
        if (Moneys > 0 && playerMoney[playerid] >= Moneys) {
            GivePlayerMoney(playerid, (-Moneys));
            GivePlayerMoney(giveplayerid, Moneys);
            format(string, sizeof(string), "You sent %s (id: %d), $%d.", giveplayer,giveplayerid, Moneys);
            SendMessageToPlayer(playerid, green, string);
            format(string, sizeof(string), "You recieved $%d from %s (id: %d).", Moneys, sendername, playerid);
            SendMessageToPlayer(giveplayerid, green, string);
            new File:moneyfile = fopen("money.txt", io_write);
            new filestring[75];
            format(filestring, sizeof filestring, "%s sent $%d to %s \r\n", sendername, Moneys, giveplayer);
            fwrite(moneyfile, filestring);
            fclose(moneyfile);
        }
        else {
            SendMessageToPlayer(playerid, COLOR_BRIGHTRED, "Invalid transaction amount.");
        }
    }
    else {
        format(string, sizeof(string), "ID:%d is not an active player.", giveplayerid);
        SendMessageToPlayer(playerid, COLOR_BRIGHTRED, string);
    }
    return 1;
}
Reply
#7

Removed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)