How to ... ?
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
untested but should work

pawn Код:
CMD:pay(playerid,params[])
{
    new amount, name[MAX_PLAYER_NAME];
    if(sscanf(params,"s[24]d",name,amount)) return SendClientMessage(playerid,COLOR_GREY,"use: /pay name amount (note this command doesn't do anything)");
    new s[64];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(s,sizeof(s),"%s takes out some money and gives it to %s",pname,name);
    ProxDetector(40.0, playerid, s, COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
}
You didn't do anything with the amount ^^.
pawn Код:
COMMAND:pay(playerid, params[])
{
  new target, amount;
  if(sscanf(params, "ui", target, amount)) return SendClientMessage(playerid, 0x00ff0fff, "USAGE: /pay [playerid/name] [monies]");
  else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x00ff0fff, "Enter a valid player!");
  else if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x00ff0fff, "You haven't got enough monies to give!");
  GivePlayerMoney(target, amount);
  GivePlayerMoney(playerid, -amount);
  new string[128], pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  GetPlayerName(target, string, MAX_PLAYER_NAME);
  format(string, sizeof string, "%s takes out some money and gives it to %s", pName, string);
  ProxDetector(40.0, playerid, str, COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
  format(string, sizeof string, "You have received %i monies from %s!", amount, pName);
  SendClientMessage(target, 0xff0fffff, string);
  return 1;
}
Untested either
Reply


Messages In This Thread
How to ... ? - by Anzhelov - 25.02.2011, 07:42
Re: How to ... ? - by cessil - 25.02.2011, 08:56
Re: How to ... ? - by Hiddos - 25.02.2011, 09:45
Re: How to ... ? - by Anzhelov - 25.02.2011, 16:02
Re: How to ... ? - by Mean - 25.02.2011, 19:47
Re: How to ... ? - by maramizo - 25.02.2011, 20:10
Re: How to ... ? - by Anzhelov - 25.02.2011, 20:14
Re: How to ... ? - by Stigg - 25.02.2011, 20:16
Re: How to ... ? - by Mean - 25.02.2011, 20:17
Re: How to ... ? - by Anzhelov - 25.02.2011, 22:26

Forum Jump:


Users browsing this thread: 1 Guest(s)