samp.directory
← Scripts and libraries

dinhkhoi2298/fSelection

preview models

Library★ 6updated Jan 2023No licencePawnsampctl
Open on GitHub

This repository has no licence file. It is public to read, but that alone does not give permission to reuse it.

Install with sampctl

sampctl package install dinhkhoi2298/fSelection

Run this in your project folder. sampctl downloads the package and what it depends on.

Try it in the Pawn compiler →

Adds its include files, with the libraries it depends on, to the Pawn compiler in your browser, ready to include in a script.

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

This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing