Raised This Month: $ Target: $400
 0% 

random player help Code!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
XxScripteRxX
Member
Join Date: Aug 2019
Old 01-02-2021 , 17:08   random player help Code!
Reply With Quote #1

i want wehen i write /random example : amxx selected player roki and when roki is already selected by the plugin and when you write again / random not to select roki only the other players who are not selected roki not to be selected a second time by the plugin I need such a function


Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init()
{
	register_plugin("Random Player knife arena", "0.2.1", "badboy");
	register_clcmd("say /random", "RandomPlayer");
}

public RandomPlayer(id)
{
	if(~get_user_flags(id) & ADMIN_BAN)
		return PLUGIN_HANDLED;
	
	getweps()
    
	static player1, player2;
	static players[32], iPnum;
	get_players(players, iPnum, "e", "TERRORIST");
	
	player1 = players[random(iPnum)];
	
	if(!player1)
	{
		console_print(id, "[ShowUrSkills] Random player not found.");
		return PLUGIN_HANDLED;
	}
            
	get_players(players, iPnum, "e", "CT");
	
	player2 = players[random(iPnum)];
	
	if(!player2)
	{
		console_print(id, "[ShowUrSkills] Random player not found.");
		return PLUGIN_HANDLED;
	}
            
	static sName[32];
	static const iNameLen = sizeof(sName) - 1
	
	get_user_name(player1, sName, iNameLen);
	client_print(0, print_chat, "[ShowUrSkills] TERRORIST Random player are Chosed %s.", sName);
	
	get_user_name(player2, sName, iNameLen);
	client_print(0, print_chat, "[ShowUrSkills] CT Random player are Chosed %s.", sName);

	return PLUGIN_HANDLED;
}

stock getweps()
{
	new Players[32], PlayersNum, id
	get_players(Players, PlayersNum, "h")
	
	for( new i; i < PlayersNum; i++ )
	{
		id = Players[i]
		
		if( is_user_connected(id) && is_user_alive(id) )
		{

		}
	}
}
XxScripteRxX is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode