24.03.2012, 19:45
Hello guys, I'll show you a little bit of my upcoming release.
Thanks to the Clickable Textdraws by SA-MP Team!
The GUI System is made of three Main parts:
Does this:
[ame]http://www.youtube.com/watch?v=iWKkRTb-C-I[/ame]
Features:
Designing the Elements are made easy, some examples:
To-do:
Thanks to the Clickable Textdraws by SA-MP Team!
The GUI System is made of three Main parts:
- The Designing part (bit like CSS)
- The Creation part (Initial creations of the elements)
- The Callback processing part. (Where you deal with player's clicks, items etc..)
pawn Код:
DESIGN(numericupdown)
@COLOR(0xFFFFFF22)
@BGCOLOR(0x00000066)
@FONTCOLOR(0xFFFFFFFF)
DESIGNe
DESIGN(window)
@COLOR(0x00E03422)
@BGCOLOR(0x00000066)
@FONTCOLOR(0xFFFFFFFF)
@SIZE(320, 190)
@LOCATION(160, 200)
DESIGNe
DESIGN(button)
@BGCOLOR(0x444444AA)
DESIGNe
new ControlPanel;
public OnFilterScriptInit()
{
ControlPanel =
CreateWindow(window, "Filthy & Dirty Privillages");
CreateNumericUpDown(ControlPanel, numericupdown, "numeric_weather", 0, 0, 1, 100, 170, 220);
CreateButton(ControlPanel, button, "Set Weather", "setweather", 170, 240, 100, 23);
CreateNumericUpDown(ControlPanel, numericupdown, "numeric_time", 0, 0, 1, 23, 170, 275);
CreateButton(ControlPanel, button, "Set Time", "settime", 170, 295, 100, 23);
CreateNumericUpDown(ControlPanel, numericupdown, "numeric_car", 400, 400, 1, 611, 170, 325);
CreateButton(ControlPanel, button, "Spawn Car", "spawncar", 170, 345, 100, 23);
CreateNumericUpDown(ControlPanel, numericupdown, "numeric_money", 0, -10000, 500, 10000, 290, 220);
CreateButton(ControlPanel, button, "Give Money", "givemoney", 290, 240, 100, 23);
CreateNumericUpDown(ControlPanel, numericupdown, "numeric_score", 0, -1000, 50, 1000, 290, 275);
CreateButton(ControlPanel, button, "Give Score", "givescore", 290, 295, 100, 23);
return true;
}
public OnPlayerClickButton(playerid, Event[])
{
if(!strcmp(Event, "setweather"))
return SetWeather(GetNumericValue(playerid, "numeric_weather"));
if(!strcmp(Event, "settime"))
return SetWorldTime(GetNumericValue(playerid, "numeric_time"));
if(!strcmp(Event, "spawncar"))
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You already have a car!");
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new VID = CreateVehicle(GetNumericValue(playerid, "numeric_car"), X, Y, Z, 0, -1, -1, 0);
PutPlayerInVehicle(playerid, VID, 0);
return true;
}
if(!strcmp(Event, "givemoney"))
return GivePlayerMoney(playerid, GetNumericValue(playerid, "numeric_money"));
if(!strcmp(Event, "givescore"))
return SetPlayerScore(playerid, GetPlayerScore(playerid) + GetNumericValue(playerid, "numeric_score"));
return true;
}
[ame]http://www.youtube.com/watch?v=iWKkRTb-C-I[/ame]
Features:
Designing the Elements are made easy, some examples:
pawn Код:
DESIGN
@COLOR()
@BGCOLOR()
@BGIMAGE()
@FONT()
@FONTOUTLINE()
@FONTCOLOR()
@FONTSHADOW()
@FONTSIZEX()
@FONTSIZEY()
@FONTSIZE(x,y)
@SIZE(x,y)
@HEIGHT()
@WIDTH()
@LOCATION(x,y)
@LOCATIONX()
@LOCATIONY()
DESIGNc
//and more to come....
- CreateListBox
- CreatePanel
- CreateImageBox
- CreateCheckBox
- Sliders, Dropdown lists, ...
- More Callbacks: OnCheckBoxStateChange, OnPlayerChooseItem, etc..
- And much more..