SA-MP Forums Archive
Help me please. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me please. (/showthread.php?tid=254992)



Help me please. - Brunok - 13.05.2011

Quote:

GivePlayerMoney(giveplayerid, amount);
GivePlayerMoney(playerid, 0 - amount);
SendClientMessage(playerid, 0x00FF00AA, "You have sent money.");
SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved.");

I want it to be that the player recieves ''You have recieved (Amount) from (Player)
And if it send :''You have send (Amount) To (Player)

How to do it?


Re: Help me please. - WarServers - 13.05.2011

Search the forum

lots of TuTs about this.


Re: Help me please. - Famalamalam - 13.05.2011

Add the following stock to your gamemode where the rest of your stock functions are:

pawn Код:
stock pName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}

pawn Код:
new string[128];
GivePlayerMoney(giveplayerid, amount);
GivePlayerMoney(playerid, 0 - amount);
format(string, sizeof(string), "You have sent $%d to [%d]%s.", amount, giveplayerid, pName(giveplayerid));
SendClientMessage(playerid, 0x00FF00AA, string);
format(string, sizeof(string), "You have received $%d from [%d]%s.", amount, playerid, pName(playerid));
SendClientMessage(giveplayerid, 0x00FF00AA, string);