Y_Ini + zcmd + sscanf giveplayermoney help!
#2

Hey guys, let me provide a bit more information.

I have a command that I want to give a given playerid money, but not by using the GivePlayerMoney(playerid, amount) code. I need the command to add money to the given player's enum I made.

In the end I need something like this.
Код:
CMD:givemoney(playerid, params[])
{
 New PlayerMessage[128], TargetMessage[128], Amount;
 If(sscanf(params, "ui", PlayerID, Amount))
 {
  SendClientMessage(playerid, COLOR_PURERED, "Usage:/givemoney [playerid\part of name][amount]");
 }
 Else
 {
  Load_Info(playerid);
  If(PlayerInfo[playerid][Wallet] >= Amount))
  {
   \\Needed code goes here but needs to look like the following.
   PlayerInfo[playerid][Money] -= Amount;
   PlayerInfo[PlayerID][Money] += Amount;
   \\etc, etc. Please note that PlayerID is connected to a stock and has the vallue of [MAX_PLAYERS]. I also have messages that send apon transaction but I need the money to be server side.
  }
 }
}
Thanx in advance.
Reply


Messages In This Thread
Y_Ini + zcmd + sscanf giveplayermoney help! - by Hyperfire - 01.04.2014, 12:43
Re: Y_Ini + zcmd + sscanf giveplayermoney help! - by Hyperfire - 02.04.2014, 09:46
Re: Y_Ini + zcmd + sscanf giveplayermoney help! - by RenovanZ - 02.04.2014, 09:54
Re: Y_Ini + zcmd + sscanf giveplayermoney help! - by Hyperfire - 03.04.2014, 05:36

Forum Jump:


Users browsing this thread: 1 Guest(s)