[Cerere Plugin] Tags Error

Cauți un plugin și nu găsești? Încearcă-ți norocul în această categorie!

Moderators: Moderatori ajutatori, Moderatori

Post Reply
Krripe21
Membru, skill 0
Membru, skill 0
Posts: 7
Joined: 14 May 2017, 22:26
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

02 Dec 2018, 16:34

Salut! Am si eu o problema cu acest plugin!
- Imi da eroare cand incerc sa compilez!

Sursă
| Afiseaza codul
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#define LoopClients(%1) for(int %1 = 1; %1 <= MaxClients; %1++) if(IsClientInGame(%1))

public Plugin:myinfo =
{
	name = "[Scoreboard] Tags-Fix",
	description = "Scoreboard tags-fix",
	author = ".P4NDAzz",
	version = "0.2",
	url = ""
};

public void OnPluginStart()
{
	HookEvent("player_team", EventDeath, EventHookMode:1);
	HookEvent("player_spawn", EventSpawn, EventHookMode:1);
	HookEvent("round_start", RoundStart, EventHookMode:1);
	return 0;
}
 
public void OnClientPutInServer(client)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}

public Action RoundStart(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}

public Action EventSpawn(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}

public Action EventDeath(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}
 
void HandleTag(client)
{
    if (CheckCommandAccess(client, "fondator", ADMFLAG_ROOT))
    {
        CS_SetClientClanTag(client, "[Fondator]");
    }
    else if (CheckCommandAccess(client, "Owner", ADMFLAG_CUSTOM1))
	{
		CS_SetClientClanTag(client, "[Owner]");
	}
	else if (CheckCommandAccess(client, "admin", ADMFLAG_GENERIC))
	{
		CS_SetClientClanTag(client, "[Admin]");
	}
	else if (CheckCommandAccess(client, "helper", ADMFLAG_CUSTOM5))
	{
		CS_SetClientClanTag(client, "[Helper]");
	}
	else if (CheckCommandAccess(client, "vip", ADMFLAG_CUSTOM6))
	{
		CS_SetClientClanTag(client, "[VIP]");
	}
}
Eroare
| Afiseaza codul
tags.sp(21) : error 088: cannot return a value from a void function
tags.sp(21) : warning 213: tag mismatch
tags.sp(26) : warning 219: local variable "client" shadows a variable at a preceding level
Vă multumesc de răspunsuri!
User avatar
LondoN eXtream
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2888
Joined: 10 Oct 2014, 05:21
Detinator Steam: Da
SteamID: /id/london_extreamcs
Reputatie: Scripter eXtreamCS
Moderator ajutator
Membru Club eXtreamCS (6 luni)
Fond eXtream: 0
Location: Roman, Neamț
Has thanked: 2 times
Been thanked: 2 times

02 Dec 2018, 21:30

| Afiseaza codul
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#define LoopClients(%1) for(int %1 = 1; %1 <= MaxClients; %1++) if(IsClientInGame(%1))

public Plugin:myinfo =
{
	name = "[Scoreboard] Tags-Fix",
	description = "Scoreboard tags-fix",
	author = ".P4NDAzz",
	version = "0.2",
	url = ""
};

public void OnPluginStart()
{
	HookEvent("player_team", EventDeath, EventHookMode:1);
	HookEvent("player_spawn", EventSpawn, EventHookMode:1);
	HookEvent("round_start", RoundStart, EventHookMode:1);
}
 
public void OnClientPutInServer(client)
{
	if(client > 0)
	{
		HandleTag(client);
	}
}

public Action RoundStart(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}

public Action EventSpawn(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}

public Action EventDeath(Event event, const char[] name, bool dontBroadcast)
{
	LoopClients(client)
	{
		if(client > 0)
		{
			HandleTag(client);
		}
	}
}
 
void HandleTag(client)
{
    if (CheckCommandAccess(client, "fondator", ADMFLAG_ROOT))
    {
        CS_SetClientClanTag(client, "[Fondator]");
    }
    else if (CheckCommandAccess(client, "Owner", ADMFLAG_CUSTOM1))
	{
		CS_SetClientClanTag(client, "[Owner]");
	}
	else if (CheckCommandAccess(client, "admin", ADMFLAG_GENERIC))
	{
		CS_SetClientClanTag(client, "[Admin]");
	}
	else if (CheckCommandAccess(client, "helper", ADMFLAG_CUSTOM5))
	{
		CS_SetClientClanTag(client, "[Helper]");
	}
	else if (CheckCommandAccess(client, "vip", ADMFLAG_CUSTOM6))
	{
		CS_SetClientClanTag(client, "[VIP]");
	}
}
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests