This suggestion, I believe, the anger has come a long way to play SA-MP, hope you like:
pawn Код:
native CreateBox(plyerid, boxid, size, x, y); //size: SMALL, BIG, MEDIUM
//Create a box in the X and Y coordinates and size with the text defined for that player.
native DestroyBox(plyerid, boxid);
//Destroy a box according to the id of the player and id of box.
native SelectBox(plyerid, boxid);
//Select a box and call the callback "OnPlayerClickBox" (the box is selected (red border) and only returns to normal with "UnselectBox").
//PS: The writing will be made only in the selected box.
native UnselectBox(plyerid, boxid);
//Unselect the box with the id of the box (nothing happens, the box is only without the red border).
//PS: The writing will be made only in the selected box.
native GetTextBox(plyerid, boxid, len);
//For what is written in the box under the boxid and playerid.
native SetTextBox(plyerid, boxid, "text");
//Written in a box set according to the boxid and playerid.
native ResetTextBox(plyerid, boxid);
//Resetting the writing of a box according to boxid and playerid.
forward OnPlayerClickBox(plyerid, boxid);
//Used when such player (playerid) clicks a box, which can be identified with the "boxid."
//EX.:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/say", true) == 0)
{
CreateBox(plyerid, 1338, BIG, 173, 43);
SetTextBox(plyerid, 1338, "Type something here.");
CreateButton(plyerid, 1337, SMALL, 132, 57, "Confirm");
return 1;
}
return 1;
}
public OnPlayerClickBox(plyerid, boxid)
{
if(boxid == 1338)
{
SendClientMessage(playerid, -1, "You select the BOX 1338. Type something and click the button 'Confirm' to say.");
return 1;
}
return 1;
}
public OnPlayerClickButton(plyerid, buttonid)
{
if(buttonid == 1337)
{
new string[128]
new textbox[64];
GetTextBox(plyerid, 1338, textbox);
UnselectButton(plyerid, 1337);
DestroyButton(plyerid, 1337);
//UnselectBox(plyerid, 1338);
DestroyBox(plyerid, 1338);
format(string, sizeof(string), "Player say %s.", textbox);
SendClientMessageToAll(playerid, -1, string);
return 1;
}
return 1;
}
/*-------------------------------------------------------------------------------------------------*/
native CreateButton(plyerid, buttonid, size, x, y, "text"); //size: SMALL, BIG, MEDIUM
//Create a button in the X and Y coordinates and size with the text defined for that player.
native DestroyButton(plyerid, buttonid);
//Destroy a button according to the id of the player and id of button.
native SelectButton(plyerid, buttonid);
//Select a button and call the callback "OnPlayerClickButton" (the button is selected (red border) and only returns to normal with "DesclickButton").
native UnselectButton(plyerid, buttonid);
//Unselect the button with the id of the button (nothing happens, the button is only without the red border).
forward OnPlayerClickButton(plyerid, buttonid);
//Used when such player (playerid) clicks a button, which can be identified with the "buttonid."
//EX.:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
CreateButton(plyerid, 1337, BIG, 132, 57, "Click to see the Vehicle ID");
return 1;
}
public OnPlayerClickButton(plyerid, buttonid)
{
if(buttonid == 1337)
{
DesclickButton(plyerid, 1337);
DestroyButton(plyerid, 1337);
SendClientMessage(playerid, -1, "~~~~~~~~~~~~~~~~~~~~~~~> Use format to see CAR ID... <~~~~~~~~~~~~~~~~~~~~~~~");
return 1;
}
return 1;
}
Images demonstration (example):
PS: I used ****** Translator because I have been on the board PT/BR.
PSІ: The coordinates are in line with the tip of the bottom left of the button/box, as above.
@EDITED