All pastes #398214 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-17 01:19 UTC
rendered paste body
dcmd_givemoney(playerid,params[]){
              new tmp[256],tmp2[256],idx;
              tmp = strtok(params,idx); tmp2 = strtok(params,idx);
              if(!strlen(tmp) || !strlen(tmp2)){
                      SendClientMessage(playerid,COLOR_WHITE,"USAGE: /givemoney [playerid] [money]");
                      return true;
              }
              new pid = strval(tmp);
              if(!IsPlayerConnected(pid)){
                      SendClientMessage(playerid,COLOR_RED,"That Player is not connected");
                      return true;
              }
              new amount = strval(tmp2);
              GivePlayerMoney(playerid,-amount);
              GivePlayerMoney(pid,amount);
              if (amount < 0)
    amount = -amount;
              new pname[MAX_PLAYER_NAME],pname2[MAX_PLAYER_NAME];
              GetPlayerName(playerid,pname,sizeof(pname));
              GetPlayerName(pid,pname2,sizeof(pname2));
              new string[256];
              format(string,sizeof(string),"%s sent %s $%d",pname,pname2,amount);
              SendClientMessageToAll(COLOR_YELLOW,string);
              return true;
      }