01.06.2017, 14:52
i would recommend dialogs you can make something like that
PHP код:
#include <a_samp>
#include <zcmd>
#define DIALOG_CMDS 100
#define SPD ShowPlayerDialog
#define M DIALOG_STYLE_INPUT
CMD:cmds(playerid, params[])
{
SPD(playerid, DIALOG_CMDS, M, "CMDS", "1. /ls\n2. /sf\n3. /lv", "Ok", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CMDS)
{
if(response)
{
if(!strlen(inputtext)) return SPD(playerid, DIALOG_CMDS, M, "CMDS", "1. /ls\n2. /sf\n3. /lv", "Ok", "Cancel");
else
{
if(!strcmp( "1", inputtext, true)) //if player type in the input 1 it will use /ls
{
SendClientMessage(playerid, -1, "CMD used {FFFF00}ls");
SetPlayerPos(playerid, x, y, z); //ls
}
if(!strcmp( "2", inputtext, true)) //if player type in the input 1 it will use /sf
{
SendClientMessage(playerid, -1, "CMD used {FFFF00}sf");
SetPlayerPos(playerid, x, y, z); //sf
}
if(!strcmp( "3", inputtext, true)) //if player type in the input 1 it will use /lv
{
SendClientMessage(playerid, -1, "CMD used {FFFF00}lv");
SetPlayerPos(playerid, x, y, z); //lv
}
}
}
}
return 1;
}