Raised This Month: $ Target: $400
 0% 

Message bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kalkonen
Junior Member
Join Date: Aug 2015
Old 08-22-2015 , 04:33   Message bug?
Reply With Quote #1

Hello, im new to coding plugins. Anyway:
http://pastebin.com/19VLvgRA
It do not send a message wnen the warden method is runn'd. Also on some other places as !w when someone has took it. Is it a bug? Am i doing anything wrong?

EDIT: Ops, its in swedish, anyway i hope you can get the point anyway

Last edited by Kalkonen; 08-22-2015 at 04:35.
Kalkonen is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 08-22-2015 , 05:40   Re: Message bug?
Reply With Quote #2

Quote:
Originally Posted by Kalkonen View Post
Hello, im new to coding plugins. Anyway:
http://pastebin.com/19VLvgRA
It do not send a message wnen the warden method is runn'd. Also on some other places as !w when someone has took it. Is it a bug? Am i doing anything wrong?

EDIT: Ops, its in swedish, anyway i hope you can get the point anyway
Pastebin was removed. Just post it here on the forums...
headline is offline
Kalkonen
Junior Member
Join Date: Aug 2015
Old 08-22-2015 , 07:45   Re: Message bug?
Reply With Quote #3

Code:
#include <sourcemod>
#include <cstrike>
#pragma tabsize 0

new g_Buttons[10]
new Warden = -1;

public Plugin:myinfo = {
	name = "Advanced Warden System",
	author = "Kalkonen",
	description = "Custom made :D",
	url = "ThoraxNetwork.Com"
};

public OnPluginStart(){
	HookEvent("round_start", roundStart);
	HookEvent("player_death", playerDeath);
	AddCommandListener(HookPlayerChat, "say");
	RegConsoleCmd("sm_wmenu", wardenMenu);
	RegConsoleCmd("sm_w", takeWarden);
	RegConsoleCmd("sm_uw", removeWarden);
}public MenuCallBack(Handle:menu, MenuAction:action, Client, Position){
	if(action == MenuAction_Select){
	decl String:Item[20];
	GetMenuItem(menu, Position, Item, sizeof(Item));
	if(StrEqual(Item, "Sätt på noblock")){
	if(Client == Warden){
	ServerCommand("mp_solid_teammates 0");
	}
	}else if(StrEqual(Item, "Stäng av noblock")){
	if(Client == Warden){
	ServerCommand("mp_solid_teammates 1");
	}
	}else if(StrEqual(Item, "Splita Ts")){
	new players[32], num, player;{
	for (new i = 0, t; i < num; i++)
	{	
    if (IsClientInGame(i) && (!IsFakeClient(i)) && IsPlayerAlive(i)){
    player = players[i];
    switch(cs_get_user_team(player))
    {
        case CS_TEAM_T:
        {
		if(!(++t % 2))
            {
			SetEntityRenderColor(players[i], 0, 255, 0, 255);
            }
            else
            {
			SetEntityRenderColor(players[i], 255, 0, 0, 255);
            }
        }
		}
		}
    }
}
	}else if(StrEqual(Item, "Unsplita Ts")){
	new players[32], num, player;
	for (new i = 0; i < num; i++)
	{
    if (IsClientInGame(i) && (!IsFakeClient(i)) && IsPlayerAlive(i)){
    player = players[i];
		SetEntityRenderColor(player, 255, 255, 255, 255);
    }
	}
	}else if(StrEqual(Item, "Öppna cellerna")){
	for(new i = 0; i < sizeof(g_Buttons); i++)
	{
		if(g_Buttons[i])
		{
			ExecuteHamB(Ham_Use, g_Buttons[i], 0, 0, 1, 1.0)
			entity_set_float(g_Buttons[i], EV_FL_frame, 0.0)
		}
	}
	}
	}else if(action == MenuAction_End){
	CloseHandle(menu);
	}
}

public Action:wardenMenu(client, args){
if(client == Warden){
	new Handle:menu = CreateMenu(MenuCallBack);
	SetMenuTitle(menu, "Warden menu!")
	AddMenuItem(menu, "Sätt på noblock", "Sätt på noblock");
	AddMenuItem(menu, "Stäng av noblock", "Stäng av noblock");
	AddMenuItem(menu, "Öppna cellerna", "Öppna cellerna");
	AddMenuItem(menu, "Splita Ts", "Unsplita Ts");
	AddMenuItem(menu, "Unsplita Ts", "Unsplita Ts");
	SetMenuExitButton(menu, true);
	SetMenuPagination(menu, 30);
	DisplayMenu(menu, client, 15);
}else{
		PrintToChat(client, "Endast warden kan ta !wmenu!");
}
}

public Action:removeWarden(client, args){
if(client == Warden){
	PrintToChatAll("%t tog precis bort sin warden! Skriv !w om du vill bli warden!", client);
		SetEntityRenderColor(client, 255, 255, 255, 255);
	Warden = -1;
}else{
		PrintToChat(client, "Endast warden kan ta !uw!");
}
}

public Action:takeWarden(client, args){
	if(Warden == -1){
		if(GetClientTeam(client) == 3){
			if(IsPlayerAlive(client)){
		Warden = client;
		SetEntityRenderColor(client, 255, 255, 255, 255);
		PrintToChatAll("%t blev precis warden!", client);
		PrintToChat(client, "!wmenu funkar nu eftersom du blev warden!");
		}else{
		PrintToChat(client, "Endast folk vid liv kan ta warden!");
		}
		}else{
		PrintToChat(client, "Endast CTs kan vara warden!");
		}
	}else{
		PrintToChat(client, "Det finns redan en warden(%t)!", Warden);
	}
}

public Action:roundStart(Handle:event, const String:name[], bool:dontBroadcast) 
{
	PrintToChatAll("En ny runda har startat! Skriv !w om du vill bli warden!");
	Warden = -1;
	ServerCommand("mp_solid_teammates 0");
}

public Action:playerDeath(Handle:event, const String:name[], bool:dontBroadcast) 
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(client == Warden){
		PrintToChatAll("Warden dog precis! Skriv !w om du vill bli warden!");
		Warden = -1;
		SetEntityRenderColor(client, 255, 255, 255, 255);
	}
}

public OnClientDisconnect(client)
{
	if(client == Warden)
	{
	PrintToChatAll("Warden loggade precis ut! Skriv !w om du vill bli warden!");
	Warden = -1;
	}	
}

public Action:HookPlayerChat(client, const String:command[], args)
{
	if(Warden == client && client != 0)
	{
			new String:szText[256];
		GetCmdArg(1, szText, sizeof(szText));
		
		if(szText[0] == '/' || szText[0] == '@' || IsChatTrigger())
		{
			return Plugin_Handled;
		}
		
		if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3)
		{
			PrintToChatAll("[Warden]%N: %s", client, szText);
			return Plugin_Handled;
		}
	}
	
	return Plugin_Continue;
}
Btw it gives me an error at every cs_ anyway, heres the code
Kalkonen 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 10:38.


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