Bibliothek★ 6aktualisiert Jan. 2023Keine LizenzPawnsampctl
Auf GitHub öffnenDieses Repository hat keine Lizenzdatei. Es ist öffentlich lesbar, aber das allein gibt noch keine Erlaubnis, es weiterzuverwenden.
Mit sampctl installieren
sampctl package install dinhkhoi2298/fSelection
Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.
Im Pawn-Compiler ausprobieren →
Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.
README.md
fSelection
Installation
Simply install to your project:
sampctl package install roesanne26/fSelection
Include in your code and begin using the library:
#include <fSelection>
fSelection-pp.inc
- Unlimited item
(require https://github.com/IllidanS4/PawnPlus)
Usage
Functions
fselection_add_item(playerid, modelid, Float:rotx, Float:roty, Float:rotz, Float:zoom);
fselection_show(playerid, fselectid, const header[], page);
fselection_showing(playerid);
fselection_hide(playerid);
// fSelection-pp.inc
async_fselection_show(playerid, const header[]);
Example #1
//
#include <fSelection>
const FSELECTION_CLOTHES = 0;
CMD:clothes(playerid) {
if(fselection_showing(playerid))
return SendClientMessage(playerid, -1, "SU DUNG ESC DE TAT.");
for(new skinID = 1; skinID < 312; skinID ++) {
if(skinID == 74) continue;
fselection_add_item(playerid, skinID);
}
fselection_show(playerid, FSELECTION_CLOTHES, "Clothes");
return 1;
}
public OnFSelectionResponse(playerid, fselectid, modelid, response) {
if(fselectid == FSELECTION_CLOTHES && response) {
SetPlayerSkin(playerid, modelid);
}
return 1;
}
Example #2
Using async_fselection_show
/* fSelection-pp test */
#include <fSelection-pp>
CMD:clothes(playerid) {
if(fselection_showing(playerid))
return SendClientMessage(playerid, -1, "SU DUNG ESC DE TAT.");
new
str[64], fSelectionInfo[E_FSELECTION_INFO];
task_yield(1);
for(new i = 0; i < 311; i ++) {
if(i == 74)
continue; // bad id
fselection_add_item(playerid, i);
}
task_await_arr(async_fselection_show(playerid, "Clothes"), fSelectionInfo);
if(fSelectionInfo[fs_response] == fS_RESPONSE_CLICKED) {
SetPlayerSkin(playerid, fSelectionInfo[fs_modelid]);
format(str, 64, "Bro da thay trang phuc %d", fSelectionInfo[fs_modelid]);
}
else strcat(str, "Bro da tat fSelection", 64);
SendClientMessage(playerid, -1, str);
return 1;
}
Testing
To test, simply run the package:
sampctl package run
Credits
jav - rfogkid26
Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden