Problem with my command
#1

Код:
CMD:fine(playerid, params[])
{
	new
	    finedid,
	    amount,
	    reason;
	if (PlayerInfo[playerid][pAdmin] >= 1)
	{
 		if (!sscanf(params, "ii", finedid, amount, reason))
        {
			if (finedid != INVALID_PLAYER_ID)
			{
  			new
			  message[128];
			new name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			new finedname[MAX_PLAYER_NAME];
			GetPlayerName(finedid, finedname, sizeof(name));
			new tempcash;
			GetPlayerMoney(finedid);
			GivePlayerMoney(finedid, tempcash-amount);
        	format(message, sizeof(message), "%s was fined $%d. Reason: %s ", finedname, amount, reason);
        	SendClientMessageToAll(COLOR_ANNOUNCE, message);
        	}
        	else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] That player is not connected");
		}
  		else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] /fine [id] [amount] [reason]");
	}
	else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] Your not authorized to use this command! ");
	return 1;
}
It fines the correct amount and displays the message as:
PlayerName(example) was fined $1,000(example). Reason: (blank,nothing)

Can anyone tell me why the first 2 display correctly but my reason doesn't?
Reply


Messages In This Thread
Problem with my command - by PixeledNinja - 23.09.2010, 17:38
Re: Problem with my command - by Mike_Peterson - 23.09.2010, 17:44
Re: Problem with my command - by PixeledNinja - 23.09.2010, 17:46
Re: Problem with my command - by The_Moddler - 23.09.2010, 18:20
Re: Problem with my command - by Mike_Peterson - 23.09.2010, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)