Raised This Month: $12 Target: $400
 3% 

[DeathRun] Queue to TT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.WhiteBlue
Junior Member
Join Date: May 2016
Old 09-14-2016 , 12:52   [DeathRun] Queue to TT
Reply With Quote #1

Hello!
*
Recently I got the idea to move the queue from the CS 1.6 by DarkGL (https://amxx.pl/topic/72351-kolejka-do-tt-na-deathrun/) to CS: GO then joined the timer deathrun Shavit.
I have all the time with her problems because as uploaded to the server, no one can enter it on and get the error "Connection rejected".
*
What is incorrect in this code?

Code:
/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>

#include <shavit>
#include <dynamic>

#define dmg(%1,%2) (GetArraySize(arKolejka) > 0 && GetArrayCell(arKolejka, 0) == %2 && GetClientTeam(%1) == 2)
#define dmg2(%1,%2) (GetArraySize(arKolejka) > 0 && GetArrayCell(arKolejka, 0) == %1 && GetClientTeam(%2) == 2)

Handle: arKolejka;

public Plugin:myinfo = 
{
	name = "[DR] Kolejka do TT",
	author = "DarkGL & .WhiteBlue",
	description = "Ten plugin dodaje kolejkę do zabicia Terrorysty.",
	version = "1.0",
	url = "http://amxx.pl/ | http://ogrpg.pl/"
}

public OnPluginStart()
{
	// inicjalizacja tabely
	arKolejka = CreateArray(1, 64);
	
	// rozpoczęcie rundy
	HookEvent("round_start", Event_RoundStart);
	
	// zadawane obrażenia
	//HookEvent("player_hurt", Event_PlayerHurt);
	
	// odrodzenie gracza
	HookEvent("player_spawned", Event_PlayerSpawned);
	
	// śmierć gracza
	HookEvent("player_death", Event_PlayerDeath);
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new victim = GetEventInt(event, "userid");
	new client = GetClientOfUserId(victim);
	
	new iRet = iFind(victim);
	if (iRet != -1)
	{
		RemoveFromArray(arKolejka, iRet);
		
		if (iRet == 0 && GetArraySize(arKolejka) > 0 && GetArrayCell(arKolejka, 0) == victim)
		{
			RemoveFromArray(arKolejka, 0);
			
			if (GetArraySize(arKolejka) > 0)
				SetEntityRenderColor(client, 255, 255, 255, 255);
		}
	}
	
	return Plugin_Handled;
}

public Action:Event_PlayerSpawned(Handle:event, const String:name[], bool:dontBroadcast)
{
	new victim = GetEventInt(event, "userid");
	new client = GetClientOfUserId(victim);
	
	if (!IsPlayerAlive(client)) return;
	
	SetEntityRenderColor(client, 255, 255, 255, 255);
}

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	ClearArray(arKolejka);
}

public Shavit_OnFinish(client)
{
	if (IsPlayerAlive(client) && GetClientTeam(client) == 3)
	{
		new iRet = iFind(client);
		
		if (iRet == -1)
			PushArrayCell(arKolejka, client);
		
		if (IsPlayerAlive(GetArrayCell(arKolejka, 0)))
			SetEntityRenderColor(GetArrayCell(arKolejka, 0), 255, 255, 255, 155);
		else
			RemoveFromArray(arKolejka, 0);
	}
}

public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
{
	if (!IsFakeClient(client))
		arClear(client);
}

public OnClientDisconnect(client)
{
	arClear(client);
}

public arClear(client)
{
	new iRet = iFind(client);
	
	if(iRet == -1)	return;
	
	RemoveFromArray(arKolejka, iRet);
}

public iFind(client)
{
	for (new i = 0; i < GetArraySize(arKolejka); i++)
	{
		if (GetArrayCell(arKolejka, i) == client) return i;
	}
	return -1;
}
PLEASE!
.WhiteBlue is offline
Reply



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 17:06.


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