25.02.2009, 17:40
Try:
You do need function sscanf for this.
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;
}