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!