samp.directory
← Betikler ve kütüphaneler

vdgiapp/mSelection

Dynamic model selection library for SA-MP

Kütüphane★ 1Ağu 2024 güncellendiLisans yokPawn
GitHub’da aç

Bu deponun lisans dosyası yok. Okumak için herkese açık, ama bu tek başına yeniden kullanma izni vermez.

README.md

mSelection

This version is made by Giapp, a modified version of this nearly original version

IMAGES

INSTALLATION

Include in your code and begin using the library:

#include <mSelection>

FUNCTIONS

  LoadModelSelectionMenu(f_name[]);
  HideModelSelectionMenu(playerid);
  ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor, previewBGcolor, tdSelectionColor);
  ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Xrot, Yrot, Zrot, mZoom, dialogBGcolor, previewBGcolor, tdSelectionColor);

CALLBACKS

  OnPlayerModelSelection(playerid, response, listid, modelid);
  OnPlayerModelSelectionEx(playerid, response, extraid, modelid, extralist_id);

USAGE AND EXAMPLE

  • [ModelID] = "ID: 1"...
  • [VehicleName] = "NRG-500"...

SkinsList.txt

modelid text[] Float:RotationX Float:RotationY Float:RotationZ Float:Zoom

1 [ModelID]
2 [ModelID]
5 CustomText

VehList.txt

modelid text[] Float:RotationX Float:RotationY Float:RotationZ Float:Zoom

400 [VehicleName] 1.000000 1.000000 1.000000 1.0
401 _ 2.000000 2.000000 2.000000 1.0

gamemode.pwn

#include <a_samp>
#include <textdraw-streamer>
#include <mSelection>
#include <Pawn.CMD>

new SkinsList, VehList;
public OnGameModeInit()	{
	SkinsList = LoadModelSelectionMenu("SkinsList.txt"); // (scriptfiles/SkinsList.txt)
	VehList = LoadModelSelectionMenu("VehList.txt");
	return 1;
}

cmd:skinlist(playerid, params[]) {
	ShowModelSelectionMenu(playerid, SkinsList, "Skins list title");
	return 1;
}

cmd:vehlist(playerid, params[]) {
	ShowModelSelectionMenu(playerid, VehList, "Vehicles list title");
	return 1;
}

public OnPlayerModelSelection(playerid, response, listid, modelid) {
	if(listid == SkinsList) {
		if(response) {
			// set player skin or something
			// or your work
		}
	}
	if(listid == VehList) {
		if(response) {
                        // create a vehicle or something
			// or your work
		}
	}
}

Bu sayfa GitHub’ın depo hakkında yayımladıklarından oluşturulur. samp.directory kodu barındırmaz. Bu ilanla ilgili bir sorun bildir