29.04.2010, 08:07
pawn Код:
if(dialogid == 8)
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT,"Mute","Enter reason for the mute","Mute","Cancel");
}
if(dialogid == 9 && response)
{
if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, red, "ERROR: Player is not connected");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if (Muted[Player[playerid]] == 1) return SendClientMessage(playerid, red,"That player is already muted!");
format(string, sizeof(string), "%s has been muted by an Admin, Reason: %s", name);
SendClientMessageToAll(red,string);
SendClientMessage(playerid, lightblue,"The player has been succesfully muted.");
Muted[Player[playerid]] = 1;
}
Use returns instead of elses and 4 brackets.
Those 2 things will make scripts much easier to read.
But it won't work anyway, you ask for a STRING in dialog 9, not an integer, so can can you use strval? It will always say they aren't connected. Actually, it will say ID 0.
You also don't define what the second %s is in format().