15.12.2012, 13:13
(
Последний раз редактировалось Fernado Samuel; 04.10.2013 в 18:06.
)
Removed.
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;
}
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;
}