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 :/