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

whats wrong here


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Joob
Member
Join Date: Apr 2007
Old 10-12-2017 , 06:51   whats wrong here
Reply With Quote #1

Hello,

Whats wrong here in this code..
Don't show nothing in TAG and I want to update in every kill

PHP Code:
public void OnPluginStart()
{
   
g_Game GetEngineVersion();
   if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
   {
       
SetFailState("CSGO");
   }
   
}
public 
void OnMapStart()
{
   
CreateTimer(1.0t_TagTIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action t_Tag(Handle timer)
{
   
LoopValidClients(i)
   {
       
char pkt[64];
       
Format(pktsizeof(pkt), "[%i]"RankMe_GetPoints(i));
       
CS_SetClientClanTag(ipkt);
       
CS_SetClientContributionScore(iRankMe_GetPoints(i));
   }
}
stock bool IsValidClient(int client)
{
if (
client && client <= MaxClients && IsClientInGame(client) && IsFakeClient(client) == false)
{
return 
true;
}
return 
false;

Regards
__________________
Joob is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-12-2017 , 07:59   Re: whats wrong here
Reply With Quote #2

1st of all does it compile?
2nd of all are there any error msgs?
8guawong is offline
Joob
Member
Join Date: Apr 2007
Old 10-12-2017 , 12:26   Re: whats wrong here
Reply With Quote #3

yes, the compile is ok..
no errors.. there are also no logs with errors..

but also wanted to be updated on each kill..
__________________
Joob is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-12-2017 , 12:46   Re: whats wrong here
Reply With Quote #4

You should show all of your code, as what you pasted isn't something that would compile.
Fyren is offline
Joob
Member
Join Date: Apr 2007
Old 10-13-2017 , 06:32   Re: whats wrong here
Reply With Quote #5

check
I know that what I put can not compile .. but said that when compiling does not give any error!

#pragma semicolon 1
#define LoopValidClients(%1) for(int %1 = 1; %1 < MaxClients; %1++) if(IsValidClient(%1))
#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION ""

#include <sourcemod>
#include <cstrike>
#include <rankme>
#pragma newdecls required

EngineVersion g_Game;

public Plugin myinfo =
{
name = "",
author = PLUGIN_AUTHOR,
description = "",
version = PLUGIN_VERSION,
url = ""
};

public void OnPluginStart()
{
g_Game = GetEngineVersion();
if (g_Game != Engine_CSGO && g_Game != Engine_CSS)
{
SetFailState("CSGO");
}

}
public void OnMapStart()
{
CreateTimer(1.0, t_Tag, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}

public Action t_Tag(Handle timer)
{
LoopValidClients(i)
{
char pkt[64];
Format(pkt, sizeof(pkt), "[ %i ]", RankMe_GetPoints(i));
CS_SetClientClanTag(i, pkt);
CS_SetClientContributionScore(i, RankMe_GetPoints(i));
}
}
stock bool IsValidClient(int client)
{
if (0 < client && client <= MaxClients && IsClientInGame(client) && IsFakeClient(client) == false)
{
return true;
}
return false;
}
__________________
Joob is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-13-2017 , 11:08   Re: whats wrong here
Reply With Quote #6

For the love of god if you want help please use [CODE] tags. I removed your loop definition and just made a loop in t_Tag. Idk why you'd define a loop if you only uses it once let alone define it at all. Safer just to loop when you need it.

Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION ""
#include <sourcemod>
#include <rankme>
#include <cstrike>
#pragma newdecls required

EngineVersion g_Game;

public Plugin myinfo = 
{
	name = "", 
	author = PLUGIN_AUTHOR, 
	description = "", 
	version = PLUGIN_VERSION, 
	url = ""
};

public void OnPluginStart()
{
	g_Game = GetEngineVersion();
	if (g_Game != Engine_CSGO && g_Game != Engine_CSS)
	{
		SetFailState("CSGO");
	}

}
public void OnMapStart()
{
	CreateTimer(1.0, t_Tag, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}

public Action t_Tag(Handle timer)
{
	for	(int Client; Client <= MaxClients; Client++)
	{
	if	(IsValidClient(Client) && IsClientInGame(Client))
		{
			char pkt[64];
			Format(pkt, sizeof(pkt), "[ %Client ]", RankMe_GetPoints(Client));
			CS_SetClientClanTag(Client, pkt);
			CS_SetClientContributionScore(Client, RankMe_GetPoints(Client));
		}
	}

}
stock bool IsValidClient(int client)
{
	if (0 < client && client <= MaxClients && IsClientInGame(client) && IsFakeClient(client) == false)
	{
		return true;
	}
	return false;
}
Edit: When asking for help you need to provide more information such as what 8guawong & Fyren said.

Compile errors
Code using [CODE] [/ CODE]
The entire plugin
And it'd be nice if you provided information on what the plugin should do, although not necessary.

Last edited by Halt; 10-13-2017 at 11:10.
Halt is offline
Joob
Member
Join Date: Apr 2007
Old 10-13-2017 , 12:30   Re: whats wrong here
Reply With Quote #7

Sorry, I completely forgot .. but that's what I always do .. I'm going to do a test .. thanks u ;) !
__________________
Joob is offline
Joob
Member
Join Date: Apr 2007
Old 10-13-2017 , 20:45   Re: whats wrong here
Reply With Quote #8

....
__________________

Last edited by Joob; 10-14-2017 at 20:19.
Joob is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-16-2017 , 09:35   Re: whats wrong here
Reply With Quote #9

We cannot read minds, use your words.
Halt 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 09:47.


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