warning 225: unreachable code
if (dialogid == 1)
#include <a_samp>
#include <a_players>
#include <zcmd>
#pragma tabsize 0
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");
return 1;
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;
}
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;
}
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);
}
}
}
}
https://sampforum.blast.hk/showthread.php?tid=91354
zcmd is a command processor, it's supposed to 2 arguments, which are playerid and params. What you're doing is showing the player the dialog, and doing what the dialog should do, all inside the command. You're supposed to code what dialogs do under OnDialogResponse. |
Here:
PHP Code:
Edit: ![]() PHP Code:
|