←  Prośby o modyfikacje silników/klas/perków

AMXX.pl: Support AMX Mod X i SourceMod

»

Perk
1 Perk Ksiega Premium

  • +
  • -
Shuishy - zdjęcie Shuishy 05.12.2013

proszę O Perk min:Ksiega Premium 

posiada ona dostep Do  klas premium Flaga A

Odpowiedz

  • +
  • -
RasiaQ - zdjęcie RasiaQ 05.12.2013

Też myślałem nad tym perkiem, ale flagi serwer czyta dopiero po zmianie mapy/restarcie serwera więc czy tak czy tak gracz nie dostanie premium.

Odpowiedz

  • +
  • -
dasiek - zdjęcie dasiek 05.12.2013

a nóż coś takiego  :3

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <codmod>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define PREMIUM_FLAG ADMIN_LEVEL_A

new bool:ma_flage[33];
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	cod_register_perk("Ksiega Premium","posiadsz dostep Do klas premium");
}
public client_putinserver(id)
{
	if(get_user_flags(id) & PREMIUM_FLAG)
		ma_flage[id] = true;
	else
		ma_flage[id] = false;
}
	
public cod_perk_enabled(id)
{
	if(!ma_flage[id])
	{
		set_user_flags(id,get_user_flags(id) | PREMIUM_FLAG);
	}
}
public cod_perk_disabled(id)
{
	if(!ma_flage[id])
	{
		set_user_flags(id, ~PREMIUM_FLAG);
	}
}
Odpowiedz