Originally Posted by Meller
Here:
PHP Code:
CMD:skin(playerid, listitem, response, dialogid, inputtext[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Skin Change", "Enter the skin id you wish to have below", "Confirm", "Cancel");
if (dialogid == 1)
{
if(response)
{
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Skin id may be between 0 and 299.");
}
else
{
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
}
}
}
return 1;
}
You can't return before it's finished, and you used return twice, removed the first return. Now should it be reachable.
Edit:
PHP Code:
CMD:skin(playerid)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Skin Change", "Enter the skin id you wish to have below", "Confirm", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Skin id may be between 0 and 299.");
}
else
{
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
}
}
}
}
Read the reply above me.
|