Giter Club home page Giter Club logo

fselection's Introduction

fSelection

sampctl

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

fselection's People

Contributors

dinhkhoi2298 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.