Author Topic: mSelection+Textdraw  (Read 882 times)

Fitri

  • Newbie
  • *
  • Posts: 11
  • Reputation: 1
    • View Profile
mSelection+Textdraw
« on: April 21, 2013, 10:35:30 pm »
THIS SCRIPT ONLY WORK 0.3x ++

A include which adds the possibility to create Model Preview Menus with only a few lines of code.

Updates
- 1.1 R3
Fixes Bug with blocking OnPlayerClick(Player)TextDraw
The selection menu instantly closed in all earlier verions if used/shown in OnDialogResponse

- 1.1 R2
Fixes bug when pressing ESC

- 1.1
Fixes bug when pressing ESC
Adds dynamic per player menus
Adds "cancel" button to the menus

- 1.0 R3:
Fixes bug with using ShowModelSelectionMenu in OnPlayerModelSelection

- 1.0 R2:
Adds possibility to use ShowModelSelectionMenu in OnPlayerModelSelection

Quote
// for both (static and per player lists)
HideModelSelectionMenu(playerid)
//static lists
LoadModelSelectionMenu(f_name[])
ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)

forward OnPlayerModelSelection(playerid, response, listid, modelid);
//dynamic per player lists
ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)

forward OnPlayerModelSelectionEx(playerid, response, extraid, modelid);

LoadModelSlectionMenu(f_name[])
Loads the menu content from a file and returns the listid.
f_name[]: Filename of the list in your scriptfiles folder
returns: ID of the list

File:
Every line looks like: modelID xRot yRot zRot Zoom (The red ones are optional and don't have to be added)

Example Infernus ID 411:
Quote
411
411 180.0
411 0.0 180.0
411 0.0 0.0 180.0
411 0.0 0.0 0.0 1.0

All 4 examples are possible and will show an Infernus with different rotations set.

Example all planes: planes.txt

Code: [Select]
460 16.0 0.0 -55.0
476 16.0 0.0 -55.0
511 16.0 0.0 -55.0
512 16.0 0.0 -55.0
513 16.0 0.0 -55.0
519 16.0 0.0 -55.0
520 16.0 0.0 -55.0
553 16.0 0.0 -55.0
577 16.0 0.0 -55.0
592 16.0 0.0 -55.0
593 16.0 0.0 -55.0

Note:
If more models use the same rotation/zoom information then the information will only be saved once to save memory.(For example 100 vehicles with the same rotation will only need one rotation to be saved)

HideModelSelectionMenu(playerid)
Hide menu for player.
playerid: playerid
returns: nothing

ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)
Show menu for player.
playerid: playerid
ListID: The ID of the list/menu to be shown
header_test[]: heading of the list/menu
dialogBGcolor(optional): Look at the picture below for the color (*1)
previewBGcolor(optional): Look at the picture below for the color (*2)
tdSelectionColor(optional): Look at the picture below for the color (*3)
returns: 1 success, 0 failed



DOWNLOAD
 

++Weapon Spawner Added By .......  ;D

Share on Bluesky Share on Facebook


greentarch

  • Global Moderator
  • Newbie
  • ********
  • Posts: 16
  • Reputation: 0
    • View Profile
Re: mSelection+Textdraw
« Reply #1 on: April 22, 2013, 05:02:07 pm »
Please give credits to D0erfler as you didn't made this include.
"powred by fitri" <- Basically you just uploaded it at solidfiles and D0erfler made the include.