Преработка на плъгина Fast Event

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Преработка на плъгина Fast Event

Мнение от You Owe Me » 10 Юли 2018, 17:42

Добър ден, някой може ли да го преработи този плъгин - viewtopic.php?f=21&t=710 , вместо тези награди които са там, да дава ammo packs за zombie plague, да може и чрез cvar да се оправя разбира се..
fastevent_reward_ap или fastevent_reward_ammo "количество ап"
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка на плъгина Fast Event

Мнение от OciXCrom » 10 Юли 2018, 22:44

Кой zombie plague по-точно? Моля, качи .inc файла на мода за да видя функциите за даване паквое.

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Преработка на плъгина Fast Event

Мнение от You Owe Me » 10 Юли 2018, 22:57

4.3 ми е мода

Код за потвърждение: Избери целия код

/*================================================================================
	
	---------------------------------------
	-*- Zombie Plague 4.3 Includes File -*-
	---------------------------------------
	
	~~~~~~~~~~
	- How To -
	~~~~~~~~~~
	
	To make use of the Zombie Plague API features in your plugin, just
	add the following line at the beginning of your script:
	
	#include <zombieplague>
	
	~~~~~~~~~~~
	- Natives -
	~~~~~~~~~~~
	
	These work just like any other functions: you may have to pass
	parameters and they usually return values.
	
	Example:
	
	if ( is_user_alive( id ) && zp_get_user_zombie( id ) )
	{
		server_print( "Player %d is alive and a zombie", id )
	}
	
	~~~~~~~~~~~~
	- Forwards -
	~~~~~~~~~~~~
	
	Forwards get called whenever an event happens during the game.
	You need to make a public callback somewhere on your script,
	and it will automatically be triggered when the event occurs.
	
	Example:
	
	public zp_user_infected_post( id, infector, nemesis )
	{
		if ( !infector || nemesis )
			return;
		
		server_print( "Player %d just got infected by %d!", id, infector )
	}
	
	Also, take note of cases when there's a suffix:
	
	* _pre  : means the forward will be called BEFORE the event happens
	* _post : means it will be called AFTER the event takes place
	
=================================================================================*/

#if defined _zombieplague_included
  #endinput
#endif
#define _zombieplague_included

/* Teams for zp_register_extra_item() */
#define ZP_TEAM_ZOMBIE (1<<0)
#define ZP_TEAM_HUMAN (1<<1)
#define ZP_TEAM_NEMESIS (1<<2)
#define ZP_TEAM_SURVIVOR (1<<3)

/* Game modes for zp_round_started() */
enum
{
	MODE_INFECTION = 1,
	MODE_NEMESIS,
	MODE_SURVIVOR,
	MODE_SWARM,
	MODE_MULTI,
	MODE_PLAGUE
}

/* Winner teams for zp_round_ended() */
enum
{
	WIN_NO_ONE = 0,
	WIN_ZOMBIES,
	WIN_HUMANS
}

/* Custom forward return values */
#define ZP_PLUGIN_HANDLED 97

/**
 * Returns whether a player is a zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_zombie(id)

/**
 * Returns whether a player is a nemesis.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_nemesis(id)

/**
 * Returns whether a player is a survivor.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_survivor(id)

/**
 * Returns whether a player is the first zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_first_zombie(id)

/**
 * Returns whether a player is the last zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_last_zombie(id)

/**
 * Returns whether a player is the last human.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zp_get_user_last_human(id)

/**
 * Returns a player's current zombie class ID.
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zp_get_user_zombie_class(id)

/**
 * Returns a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zp_get_user_next_class(id)

/**
 * Sets a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @param classid	A valid zombie class ID.
 * @return		True on success, false otherwise.
 */
native zp_set_user_zombie_class(id, classid)

/**
 * Returns a player's ammo pack count.
 *
 * @param id		Player index.
 * @return		Number of ammo packs owned.
 */
native zp_get_user_ammo_packs(id)

/**
 * Sets a player's ammo pack count.
 *
 * @param id		Player index.
 * @param amount	New quantity of ammo packs owned.
 */
native zp_set_user_ammo_packs(id, amount)

/**
 * Returns the default maximum health of a zombie.
 *
 * Note: Takes into account first zombie's HP multiplier.
 *
 * @param id		Player index.
 * @return		Maximum amount of health points, or -1 if not a normal zombie.
 */
native zp_get_zombie_maxhealth(id)

/**
 * Returns a player's custom flashlight batteries charge.
 *
 * @param id		Player index.
 * @return		Charge percent (0 to 100).
 */
native zp_get_user_batteries(id)

/**
 * Sets a player's custom flashlight batteries charge.
 *
 * @param id		Player index.
 * @param value		New charge percent (0 to 100).
 */
native zp_set_user_batteries(id, charge)

/**
 * Returns whether a player has night vision.
 *
 * @param id		Player index.
 * @return		True if it has, false otherwise.
 */
native zp_get_user_nightvision(id)

/**
 * Sets whether a player has night vision.
 *
 * @param id		Player index.
 * @param set		True to give, false for removing it.
 */
native zp_set_user_nightvision(id, set)

/**
 * Forces a player to become a zombie.
 *
 * Note: Unavailable for last human/survivor.
 *
 * @param id		Player index to be infected.
 * @param infector	Player index who infected him (optional).
 * @param silent	If set, there will be no HUD messages or infection sounds.
 * @param rewards	Whether to show DeathMsg and reward frags, hp, and ammo packs to infector.
 * @return		True on success, false otherwise.
 */
native zp_infect_user(id, infector = 0, silent = 0, rewards = 0)

/**
 * Forces a player to become a human.
 *
 * Note: Unavailable for last zombie/nemesis.
 *
 * @param id		Player index to be cured.
 * @param silent	If set, there will be no HUD messages or antidote sounds.
 * @return		True on success, false otherwise.
 */
native zp_disinfect_user(id, silent = 0)

/**
 * Forces a player to become a nemesis.
 *
 * Note: Unavailable for last human/survivor.
 *
 * @param id		Player index to turn into nemesis.
 * @return		True on success, false otherwise.
 */
native zp_make_user_nemesis(id)

/**
 * Forces a player to become a survivor.
 *
 * Note: Unavailable for last zombie/nemesis.
 *
 * @param id		Player index to turn into survivor.
 * @return		True on success, false otherwise.
 */
native zp_make_user_survivor(id)

/**
 * Respawns a player into a specific team.
 *
 * @param id		Player index to be respawned.
 * @param team		Team to respawn the player into (ZP_TEAM_ZOMBIE or ZP_TEAM_HUMAN).
 * @return		True on success, false otherwise.
 */
native zp_respawn_user(id, team)

/**
 * Forces a player to buy an extra item.
 *
 * @param id		Player index.
 * @param itemid	A valid extra item ID.
 * @param ignorecost	If set, item's cost won't be deduced from player.
 * @return		True on success, false otherwise.
 */
native zp_force_buy_extra_item(id, itemid, ignorecost = 0)

/**
 * Returns whether the ZP round has started, i.e. first zombie
 * has been chosen or a game mode has begun.
 *
 * @return		0 - Round not started
 *			1 - Round started
 *			2 - Round starting
 */
native zp_has_round_started()

/**
 * Returns whether the current round is a nemesis round.
 *
 * @return		True if it is, false otherwise.
 */
native zp_is_nemesis_round()

/**
 * Returns whether the current round is a survivor round.
 *
 * @return		True if it is, false otherwise.
 */
native zp_is_survivor_round()

/**
 * Returns whether the current round is a swarm round.
 *
 * @return		True if it is, false otherwise.
 */
native zp_is_swarm_round()

/**
 * Returns whether the current round is a plague round.
 *
 * @return		True if it is, false otherwise.
 */
native zp_is_plague_round()

/**
 * Returns number of alive zombies.
 *
 * @return		Zombie count.
 */
native zp_get_zombie_count()

/**
 * Returns number of alive humans.
 *
 * @return		Human count.
 */
native zp_get_human_count()

/**
 * Returns number of alive nemesis.
 *
 * @return		Nemesis count.
 */
native zp_get_nemesis_count()

/**
 * Returns number of alive survivors.
 *
 * @return		Survivor count.
 */
native zp_get_survivor_count()

/**
 * Registers a custom item which will be added to the extra items menu of ZP.
 *
 * Note: The returned extra item ID can be later used to catch item
 * purchase events for the zp_extra_item_selected() forward.
 *
 * Note: ZP_TEAM_NEMESIS and ZP_TEAM_SURVIVOR can be used to make
 * an item available to Nemesis and Survivors respectively.
 *
 * @param name		Caption to display on the menu.
 * @param cost		Ammo packs to be deducted on purchase.
 * @param teams		Bitsum of teams it should be available for.
 * @return		An internal extra item ID, or -1 on failure.
 */
native zp_register_extra_item(const name[], cost, teams)

/**
 * Registers a custom class which will be added to the zombie classes menu of ZP.
 *
 * Note: The returned zombie class ID can be later used to identify
 * the class when calling the zp_get_user_zombie_class() natives.
 *
 * @param name		Caption to display on the menu.
 * @param info		Brief description of the class.
 * @param model		Player model to be used.
 * @param clawmodel	Claws model to be used.
 * @param hp		Initial health points.
 * @param speed		Maximum speed.
 * @param gravity	Gravity multiplier.
 * @param knockback	Knockback multiplier.
 * @return		An internal zombie class ID, or -1 on failure.
 */
native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback)

/**
 * Returns an extra item's ID.
 *
 * @param name		Item name to look for.
 * @return		Internal extra item ID, or -1 if not found.
 */
native zp_get_extra_item_id(const name[])

/**
 * Returns a zombie class' ID.
 *
 * @param name		Class name to look for.
 * @return		Internal zombie class ID, or -1 if not found.
 */
native zp_get_zombie_class_id(const name[])

/**
 * Called when the ZP round starts, i.e. first zombie
 * is chosen or a game mode begins.
 *
 * @param gamemode	Mode which has started.
 * @param id		Affected player's index (if applicable).
 */
forward zp_round_started(gamemode, id)

/**
 * Called when the round ends.
 *
 * @param winteam	Team which has won the round.
 */
forward zp_round_ended(winteam)

/**
 * Called when a player gets infected.
 *
 * @param id		Player index who was infected.
 * @param infector	Player index who infected him (if applicable).
 * @param nemesis	Whether the player was turned into a nemesis.
 */
forward zp_user_infected_pre(id, infector, nemesis)
forward zp_user_infected_post(id, infector, nemesis)

/**
 * Called when a player turns back to human.
 *
 * @param id		Player index who was cured.
 * @param survivor	Whether the player was turned into a survivor.
 */
forward zp_user_humanized_pre(id, survivor)
forward zp_user_humanized_post(id, survivor)

/**
 * Called on a player infect/cure attempt. You can use this to block
 * an infection/humanization by returning ZP_PLUGIN_HANDLED in your plugin.
 *
 * Note: Right now this is only available after the ZP round starts, since some
 * situations (like blocking a first zombie's infection) are not yet handled.
 */
forward zp_user_infect_attempt(id, infector, nemesis)
forward zp_user_humanize_attempt(id, survivor)

/**
 * Called when a player buys an extra item from the ZP menu.
 *
 * Note: You can now return ZP_PLUGIN_HANDLED in your plugin to block
 * the purchase and the player will be automatically refunded.
 *
 * @param id		Player index of purchaser.
 * @param itemid	Internal extra item ID.
 */
forward zp_extra_item_selected(id, itemid)

/**
 * Called when a player gets unfrozen (frostnades).
 *
 * @param id		Player index.
 */
forward zp_user_unfrozen(id)

/**
 * Called when a player becomes the last zombie.
 *
 * Note: This is called for the first zombie too.
 *
 * @param id		Player index.
 */
forward zp_user_last_zombie(id)

/**
 * Called when a player becomes the last human.
 *
 * @param id		Player index.
 */
forward zp_user_last_human(id)


/**
 * @deprecated - Do not use!
 * For backwards compatibility only.
 */
#define ZP_TEAM_ANY 0
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка на плъгина Fast Event

Мнение от OciXCrom » 10 Юли 2018, 23:12

fastev_reward_ap "10"

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zombieplague>
#include <colorchat>

#if AMXX_VERSION_NUM < 183
	#include <dhudmessage>
#endif

#pragma semicolon 1
#pragma ctrlchar  '\'

#define PLUGIN "Fast Event"
#define VERSION "1.0-zp"
#define AUTHOR "hackera457"

#define MAX_LENGTH  8

#define TASK_END_EVENT 111258

enum _:eSettings {
	
	EVENT_START_TIME,
	EVENT_REWARD_AP,
	EVENT_HUD_COLOR,
	EVENT_HUD_COORDX,
	EVENT_HUD_COORDY,
	EVENT_HUD_HOLD_TIME
};

new g_szChars[] = "abcdefghijklmnopqrstuvwxyz0123456789.!@#$&=}{";

new g_szRandomString[MAX_LENGTH];
new g_szCvarSettings[eSettings];

new bool:g_bIsEventStart;
new bool:g_bIsAnswered[33];

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd( "say","cmdSay");
	register_clcmd("say_team","cmdSay");
	
	g_szCvarSettings[EVENT_START_TIME] = register_cvar("fastevent_start_time","120.0");
	g_szCvarSettings[EVENT_REWARD_AP] = register_cvar("fastevent_reward_ap","10");
	g_szCvarSettings[EVENT_HUD_COLOR] = register_cvar("fastevent_hud_color","0 255 0");
	g_szCvarSettings[EVENT_HUD_COORDX] = register_cvar("fastevent_hud_coordX","0.04");
	g_szCvarSettings[EVENT_HUD_COORDY] = register_cvar("fastevent_hud_coordY","0.73");
	g_szCvarSettings[EVENT_HUD_HOLD_TIME] = register_cvar("fastevent_hud_hold_time","12.0");
	
	
	set_task(get_pcvar_float(g_szCvarSettings[EVENT_START_TIME]),"StartEvent",_,_,_,"b");
	
}

public client_connect(id)
{
	g_bIsAnswered[id] = false;
}

public StartEvent()
{
	g_bIsEventStart = true;
	
	GenerateString(g_szChars, charsmax(g_szChars),g_szRandomString, charsmax(g_szRandomString));
	
	new szColors[16];
	new szRed[4], szGreen[4], szBlue[4]; 
	new iRed, iGreen, iBlue;
	
	get_pcvar_string(g_szCvarSettings[EVENT_HUD_COLOR], szColors, charsmax(szColors));
	parse(szColors, szRed, charsmax(szRed), szGreen, charsmax(szGreen), szBlue, charsmax(szBlue));
	
	iRed = str_to_num(szRed); 
	iGreen = str_to_num(szGreen); 
	iBlue = str_to_num(szBlue);
	
	set_task(15.0,"EndEvent",TASK_END_EVENT,_,_,"b");
	
	set_dhudmessage(iRed,iGreen,iBlue,get_pcvar_float(g_szCvarSettings[EVENT_HUD_COORDX]),get_pcvar_float(g_szCvarSettings[EVENT_HUD_COORDY]),1,6.0,get_pcvar_float(g_szCvarSettings[EVENT_HUD_HOLD_TIME]));
	show_dhudmessage(0,"[FastEvent] Type in the following symbols to win: %s",g_szRandomString);	
		
}

public cmdSay(id)
{

	if(g_bIsEventStart)
	{
		new szSaid[ 192 ], szName[32];
		read_args( szSaid, charsmax( szSaid ) );
		remove_quotes( szSaid );
		trim( szSaid );
	
		if( equali( szSaid, "" ) )
			return PLUGIN_HANDLED;
			
		if(g_bIsAnswered[id])
		{
			ColorChat(id,TEAM_COLOR,"\1[\4FastEvent\1] You already answered and you can answer again on the next event!");
			return PLUGIN_HANDLED;
		}
		else
		{
		
			if(equali(szSaid,g_szRandomString))
			{
				g_bIsAnswered[id] = true;
				get_user_name(id,szName,charsmax(szName));
				
				new iReward = get_pcvar_num(g_szCvarSettings[EVENT_REWARD_AP]);
				zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + iReward);						
				ColorChat(0, TEAM_COLOR, "\1[\4FastEvent\1] Player \4%s\1 won \4%i Ammo Packs\1!", szName, iReward);
			}
			else
			{
				g_bIsAnswered[id] = true;
				ColorChat(id,TEAM_COLOR,"\1[\4FastEvent\1] Your answer is incorrect! You can try again on the next event!");
			}
		
		}
	}
	
	return PLUGIN_CONTINUE;		
}

public EndEvent()
{
	if(task_exists(TASK_END_EVENT))
		remove_task(TASK_END_EVENT);
		
	g_bIsEventStart = false;
	
	new iPlayers[32],iNum;
	
	get_players(iPlayers,iNum,"ch");
	
	for(new i=0; i < iNum;i++)
		g_bIsAnswered[iPlayers[i]] = false;
}

stock GenerateString(const choices[], const num_choices, output[], const len)
{
    for(new i = 0; i < len; i++)
    {
        output[i] = choices[random(num_choices)];
    }
    
    return len;
}

stock fm_set_user_health(index, health)
{
   set_pev(index, pev_health, float(health));
   return 1;
}

stock fm_get_user_health(index)
{
   return pev(index, pev_health);
}

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Преработка на плъгина Fast Event

Мнение от You Owe Me » 10 Юли 2018, 23:43

Много благодаря! Заключете. :)
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
g0gIch
Извън линия
Потребител
Потребител
Мнения: 206
Регистриран на: 20 Юли 2017, 17:29
Се отблагодари: 37 пъти
Получена благодарност: 24 пъти
Обратна връзка:

Преработка на плъгина Fast Event

Мнение от g0gIch » 10 Юли 2018, 23:51

Да не правя отделна тема, може ли да се направи за basebuilder 6.5? Да има същите cvar настройки, но наградите да са: hp, speed, gravity, points(за ocixcrom custom shop).

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка на плъгина Fast Event

Мнение от OciXCrom » 11 Юли 2018, 00:24

Направих го за точките. За другото не ми се занимава.

fastev_reward_points "10"

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <customshop>
#include <colorchat>

#if AMXX_VERSION_NUM < 183
	#include <dhudmessage>
#endif

#pragma semicolon 1
#pragma ctrlchar  '\'

#define PLUGIN "Fast Event"
#define VERSION "1.0-zp"
#define AUTHOR "hackera457"

#define MAX_LENGTH  8

#define TASK_END_EVENT 111258

enum _:eSettings {
	
	EVENT_START_TIME,
	EVENT_REWARD_POINTS,
	EVENT_HUD_COLOR,
	EVENT_HUD_COORDX,
	EVENT_HUD_COORDY,
	EVENT_HUD_HOLD_TIME
};

new g_szChars[] = "abcdefghijklmnopqrstuvwxyz0123456789.!@#$&=}{";

new g_szRandomString[MAX_LENGTH];
new g_szCvarSettings[eSettings];

new bool:g_bIsEventStart;
new bool:g_bIsAnswered[33];

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd( "say","cmdSay");
	register_clcmd("say_team","cmdSay");
	
	g_szCvarSettings[EVENT_START_TIME] = register_cvar("fastevent_start_time","120.0");
	g_szCvarSettings[EVENT_REWARD_POINTS] = register_cvar("fastevent_reward_points","10");
	g_szCvarSettings[EVENT_HUD_COLOR] = register_cvar("fastevent_hud_color","0 255 0");
	g_szCvarSettings[EVENT_HUD_COORDX] = register_cvar("fastevent_hud_coordX","0.04");
	g_szCvarSettings[EVENT_HUD_COORDY] = register_cvar("fastevent_hud_coordY","0.73");
	g_szCvarSettings[EVENT_HUD_HOLD_TIME] = register_cvar("fastevent_hud_hold_time","12.0");
	
	
	set_task(get_pcvar_float(g_szCvarSettings[EVENT_START_TIME]),"StartEvent",_,_,_,"b");
	
}

public client_connect(id)
{
	g_bIsAnswered[id] = false;
}

public StartEvent()
{
	g_bIsEventStart = true;
	
	GenerateString(g_szChars, charsmax(g_szChars),g_szRandomString, charsmax(g_szRandomString));
	
	new szColors[16];
	new szRed[4], szGreen[4], szBlue[4]; 
	new iRed, iGreen, iBlue;
	
	get_pcvar_string(g_szCvarSettings[EVENT_HUD_COLOR], szColors, charsmax(szColors));
	parse(szColors, szRed, charsmax(szRed), szGreen, charsmax(szGreen), szBlue, charsmax(szBlue));
	
	iRed = str_to_num(szRed); 
	iGreen = str_to_num(szGreen); 
	iBlue = str_to_num(szBlue);
	
	set_task(15.0,"EndEvent",TASK_END_EVENT,_,_,"b");
	
	set_dhudmessage(iRed,iGreen,iBlue,get_pcvar_float(g_szCvarSettings[EVENT_HUD_COORDX]),get_pcvar_float(g_szCvarSettings[EVENT_HUD_COORDY]),1,6.0,get_pcvar_float(g_szCvarSettings[EVENT_HUD_HOLD_TIME]));
	show_dhudmessage(0,"[FastEvent] Type in the following symbols to win: %s",g_szRandomString);	
		
}

public cmdSay(id)
{

	if(g_bIsEventStart)
	{
		new szSaid[ 192 ], szName[32];
		read_args( szSaid, charsmax( szSaid ) );
		remove_quotes( szSaid );
		trim( szSaid );
	
		if( equali( szSaid, "" ) )
			return PLUGIN_HANDLED;
			
		if(g_bIsAnswered[id])
		{
			ColorChat(id,TEAM_COLOR,"\1[\4FastEvent\1] You already answered and you can answer again on the next event!");
			return PLUGIN_HANDLED;
		}
		else
		{
		
			if(equali(szSaid,g_szRandomString))
			{
				g_bIsAnswered[id] = true;
				get_user_name(id,szName,charsmax(szName));
				
				new iReward = get_pcvar_num(g_szCvarSettings[EVENT_REWARD_POINTS]);
				cshop_give_points(id, iReward);					
				ColorChat(0, TEAM_COLOR, "\1[\4FastEvent\1] Player \4%s\1 won \4%i CSHOP Points\1!", szName, iReward);
			}
			else
			{
				g_bIsAnswered[id] = true;
				ColorChat(id,TEAM_COLOR,"\1[\4FastEvent\1] Your answer is incorrect! You can try again on the next event!");
			}
		
		}
	}
	
	return PLUGIN_CONTINUE;		
}

public EndEvent()
{
	if(task_exists(TASK_END_EVENT))
		remove_task(TASK_END_EVENT);
		
	g_bIsEventStart = false;
	
	new iPlayers[32],iNum;
	
	get_players(iPlayers,iNum,"ch");
	
	for(new i=0; i < iNum;i++)
		g_bIsAnswered[iPlayers[i]] = false;
}

stock GenerateString(const choices[], const num_choices, output[], const len)
{
    for(new i = 0; i < len; i++)
    {
        output[i] = choices[random(num_choices)];
    }
    
    return len;
}

stock fm_set_user_health(index, health)
{
   set_pev(index, pev_health, float(health));
   return 1;
}

stock fm_get_user_health(index)
{
   return pev(index, pev_health);
}

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 14 госта