Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Dokumentacja AMX Mod X v. 11.5 Uzupełnionych funkcji: Sortowanie: Według modułów | Alfabetycznie
Szukaj funkcji:

3rdParty
Core
Cstrike
CSX
DoDX
Engine
ESF
Fakemeta
Fun
fun
GeoIP
HamSandwich
JSON
NS
nVault
REAPI
Regex
Sockets
Sql
SQLx
dbi
TFCX
TSFUN
TSX
tsx

roulette.inc


#


#pragma reqlib "roulette"

/*
	draw power =7!, for example, prize with 3x less chance to get out from draw,
	we register with power: POWER/3: register_prize("prize name", POWER/3);
*/
#define POWER       		 5040
#define POWER_STR   		"5040"

// some predefines karma levels for prizes
#define KARMA_WORST 		"-100"
#define KARMA_VERY_BAD		 "-75"
#define KARMA_BAD   		 "-50"
#define KARMA_QUITE_BAD 	 "-25"
#define KARMA_MINUS 		  "-1"
#define KARMA_NEUTRAL 		   "0"
#define KARMA_PLUS  		   "1"
#define KARMA_QUITE_GOOD	  "25"
#define KARMA_GOOD  		  "50"
#define KARMA_VERY_GOOD		  "75"
#define KARMA_BEST  		 "100"

// defines cvar bitsum value, showing cvar`s existing and every change
#define FCVAR_SHOWALL FCVAR_ARCHIVE|FCVAR_SERVER

enum{
	ROULETTE_BLOCK,	// Blocks forward execute or disallow for executing
	ROULETTE_ALLOW	// Executes the forward or allow for executing
}

enum(<<=1){			// Message channels used in prize_info native
	MSG_COLORCHAT=1,
	MSG_TUTOR,
	MSG_CENTER
}

enum{				// Colors are projected to be compatible with ColorChat
	INFO_YELLOW=1,	// Yellow color has been added to make names more sense
	INFO_GREEN,
	INFO_RED=5,
	INFO_BLUE
}

/*
	Registers new prize, native must be placed in plugin_init function
	desc - short description for developer menu. Limit: 100 characters
	karma - how good is prize
		positive value for favorable prizes
		negative value for unfavorable prizes
		0 for neutral or hard to assess prizes
	pwr - the product of chance on the prize drawn, recommended value: POWER
	key - translates key if set to true or just register prize with given name
	
	Returns registered prize id. Prize ids begins from 0
*/
native register_prize(desc[200], pwr=POWER, karma=0, bool:key=true);

/*
	Forces prize power change
	id - number of player, which power is changed
		if set to 0, power is changed for all players
	pwr - new power to set
	
	Returns old player`s prize power or -1 if id is 0
*/
native change_prize_power(id=0, pwr=0);

/*
	Changes prize`s karma
	karma - new karma to set
	
	Returns prize`s old karma
*/
native change_prize_karma(karma=0);

/*
	Sets user karma level
	id - number of player to set new karma
		if set to 0, karma is set to all players
	karma - new karma to set
	
	Returns old player`s karma or -1 if id is 0
*/
native set_user_karma(id=0, karma=0);

/*
	Gets user karma level
	id - number of player to get karma
*/
native get_user_karma(id);

/*
	Gets time to end of round in seconds
*/
native timeleft();

/*
	Shows information of drawed message to winner and his spectators
	id - number of player to show the information
	color - color of the message to show.
		Available colors to choose:
		YELLOW, GREEN, RED, BLUE
	key - translates key if set to true or just shows given message
	msg - message to show for a player. Limit of 190 characters
	msgSpec - message to show for player`s spectators. Same limit.
	channel - binary sum of channels message to show
		1 - ColorChat
		2 - Tutor
		4 - Center
	time - how long the tutor message have to lasts (float value)
*/
native prize_info(id, color=INFO_YELLOW, msg[190]="", msgSpec[190]="", bool:key=true, channel=3, Float:time=10.0);

/*
	Shows counter centered information to winner and his spectators
	Uses client_print print_center in format: "translated_key: number"
	id - number of player to show the counter
	key - the key to translate, being the prize name
	number - number to show (f.e. seconds left, HP left, etc.)
	spect - specifies, if show counter to spectators too.
*/
native prize_counter(id, key[128], number, bool:spect=true);

/*
	Registers new dictionary of keys to translate
	file - dictionary`s filename placed in data/lang
*/
native register_translate(file[128]);

/*
	Translates key registered by register_translate
	id - number of player to translate key for
	key - the key to translate
	result - the output for translated key
*/
native translate(id, key[128], result[896]);

/*
	Executes prize by given player
	id - number of player wchich drew the prize
*/
forward execute_prize(id);

/*
	Ask for change prize`s power
	id - number of player to reset the power
	Returning ROULETTE_ALLOW allows for prize`s power reset
	Returning ROULETTE_BLOCK disallows for prize`s power reset
*/
forward power_reset(id);

/*
	Ask for ability to draw the prize for a given player
	id - number of player to draw the prize
	Returning ROULETTE_ALLOW allows for draw the prize
	Returning ROULETTE_BLOCK disallows for draw the prize
*/
forward check_prize(id);

Pobierz plik roulette.inc