Command is doing nothing...
#5

Quote:
Originally Posted by Rks_
Try:
pawn Код:
dcmd_ransom(playerid, params[]) {
#pragma unused params
  new id;
  new pname[24];
  new str[128];
  if(sscanf(params, "is", id, text))
    return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct Usage: /ransom [id]");
  if(!IsPlayerConnected(id))
  {
    format(str, sizeof(str), "* ID %d is not an active player.", id);
    SendClientMessage(playerid, COLOR_RED, str);
    return 1;
  }
  if(GetPlayerMoney(playerid) > PlayerRansom[id])
  {
    GivePlayerMoney(PlayerKidnapper[id], PlayerRansom[id]);
    Kidnapped[id] = 0;
    TogglePlayerControllable(id, 1);
  } else {
    SendClientMessage(COLOR_RED, playerid, "You Dont Have Enough Money To Pay His/Her Ransom!");
  }
  return true;
}
You do need function sscanf for this.
Why did you do "#pragma unused params"? That's silly, as you use the params variable like, 4 lines down :/
Reply


Messages In This Thread
Command is doing nothing... - by Robbin237 - 25.02.2009, 13:28
Re: Command is doing nothing... - by Rks25 - 25.02.2009, 16:38
Re: Command is doing nothing... - by Robbin237 - 25.02.2009, 16:55
Re: Command is doing nothing... - by Rks25 - 25.02.2009, 17:40
Re: Command is doing nothing... - by 1337pr0 - 26.02.2009, 05:10

Forum Jump:


Users browsing this thread: 1 Guest(s)