Author Topic: Clan tag XP  (Read 20148 times)

Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Clan tag XP
« on: January 16, 2012, 05:44:21 PM »
It would be great if someone code this script that if person wearing server clan tag, xp rate will be like 1.2 higher!

Vulpone

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Clan tag XP
« Reply #1 on: January 17, 2012, 12:46:22 AM »
It would be great if someone code this script that if person wearing server clan tag, xp rate will be like 1.2 higher!

Would be sorta hard to code, as afaik it would have to be coded for every Server.

I could do it for you if you give me the clan-tag... But being flexible is hard.
Sapere aude!

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: Clan tag XP
« Reply #2 on: January 17, 2012, 02:32:35 AM »
There's a extension to query steam groups. It would be quite easy to make a addon that gives a xp bonus to everyone in a specific steam group.

That's most likely the safest and most reliable way to code this.

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #3 on: January 17, 2012, 02:57:52 AM »
It's possible to return the clantag from a Player.. There's a snippet somewhere on the sm Forums - to be dynamic you should use convars or something similar
#war3source on gamesurge

nvn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Clan tag XP
« Reply #4 on: January 17, 2012, 03:03:03 AM »
There's a extension to query steam groups. It would be quite easy to make a addon that gives a xp bonus to everyone in a specific steam group.

That's most likely the safest and most reliable way to code this.

sm 1.4 have GetClientClanTag stock, it would be easier to use it instead of fetching all groups client have. As i see, Chuck is asking about clantags, not groups. The difference is that we dont need to know in what group he is, we just compare if clantag he have matchs clantag we set with cvar (or just hardcoded)




iceman

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Clan tag XP
« Reply #5 on: January 17, 2012, 05:52:28 AM »
As glider said would it not be safer using steam tools so we don't have to worry about running clan name protection

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: Clan tag XP
« Reply #6 on: January 17, 2012, 06:51:56 AM »
As glider said would it not be safer using steam tools so we don't have to worry about running clan name protection

Exactly. What prevents me from changing my name to [ExtraXP] Glider? Some sort of protection that querys if I'm actually in the steam group for the [ExtraXP] clan? I see some unnecessary hoops here  ;D

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #7 on: January 17, 2012, 08:30:18 AM »
U dont played CSS? There's no clantag faking - u can only choose a clantag if u are in the steamgroup.
clantags aren't the Same as playernames

pic
« Last Edit: January 17, 2012, 09:43:46 AM by Revan »
#war3source on gamesurge

Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Clan tag XP
« Reply #8 on: January 17, 2012, 10:55:41 AM »
it should read steam group if there is a code for api! example player join my server and wearing my steam group  clan tag so mine is .:|Tmu|:., only in scoreboard you can see clan tag .:|Tmu|:. but not in chat box like normally! If it really hard then I'll take it as clan tag name! But it would be great idea to have this addons for next war3 release! I see Schandmaul's server already have that in their server!

Schmarotzer

  • Full Member
  • ***
  • Posts: 189
  • Ich schmarotze dich!
    • ICQ Messenger - 258631507
    • View Profile
    • Russian Fan-Site for german folk-rock-metal band Schandmaul
Re: Clan tag XP
« Reply #9 on: January 17, 2012, 11:35:06 AM »
I'm not Schandmaul.I am Schmarotzer
Yup, I made this plugin
Welcome to my server

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #10 on: January 17, 2012, 11:41:34 AM »
- dont uses steamtools ext. but checks for clantag(not playername, uses cstrike extension instead[only works in css]) -
Note: untested, tell me if this isn't working correctly
Code: [Select]
#include <sourcemod>
#include <cstrike>
#include "W3SIncs/War3Source_Interface"  
new Handle:g_hClanVar = INVALID_HANDLE;
new Handle:g_hGOMultipler = INVALID_HANDLE;
new Handle:g_hXPMultipler = INVALID_HANDLE;
public Plugin:myinfo=
{
name="W3S Addon ClanBonus",
author="Revan",
description="War3Source Addon Plugin",
version="1.0",
};

public OnPluginStart()
{
   g_hClanVar = CreateConVar("war3_bonusclan_name",".:|Tmu|:.","Player who are wearing this clantag will gain bonus XP");
   g_hGOMultipler = CreateConVar("war3_bonusclan_xprate","1.2","Bonus XP Multipler");
   g_hXPMultipler = CreateConVar("war3_bonusclan_goldrate","1.0","Bonus Gold Multipler");
}

public OnWar3Event(W3EVENT:event,client)
{
if(event==OnPreGiveXPGold && !IsFakeClient(client))
{
decl String:buffer[32],String:buffer2[32];
CS_GetClientClanTag(client, buffer, sizeof(buffer));
GetConVarString(g_hClanVar,buffer2,sizeof(buffer2))
if(strlen(buffer)>0 && strlen(buffer2)>0) {
if(strcmp(buffer, buffer2)==0) {
W3SetVar(EventArg2,FloatMul(W3GetVar(EventArg2),GetConVarFloat(g_hXPMultipler)));
                                W3SetVar(EventArg3,FloatMul(W3GetVar(EventArg3),GetConVarFloat(g_hGOMultipler)));
}
}
}
}

cvarlist:
war3_bonusclan ".:|Tmu|:." - actually the bonused clan
war3_bonusclan_xprate "1.2" - xp multipler
war3_bonusclan_goldrate "1.0" - gold multipler

EDIT:
I can look into steamtools extension if u want
« Last Edit: February 14, 2012, 12:30:52 PM by Revan »
#war3source on gamesurge

alex0310

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • http://forum.cmepiii.ru/
Re: Clan tag XP
« Reply #11 on: January 17, 2012, 12:11:07 PM »
must I have sm1.4?

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #12 on: January 17, 2012, 01:47:51 PM »
basicly yes. but you can try just updating the cstrike extension, it should work too
#war3source on gamesurge

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #13 on: January 17, 2012, 03:31:04 PM »
seems like something is wrong with the XP Multipler, I gonna check this tomorrow or u can do this by yourself( just don't forget posting it ;) )
just some notice
#war3source on gamesurge

nvn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Clan tag XP
« Reply #14 on: January 18, 2012, 01:46:42 AM »
must I have sm1.4?

It will be kind of weird to recompile all ur plugins coz of this addon, use stocks by psychonic otherwise: http://forums.alliedmods.net/showthread.php?t=149322


Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Clan tag XP
« Reply #15 on: January 18, 2012, 03:50:15 AM »
revan got everything working except the xp rate and gold rate having problem!

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: Clan tag XP
« Reply #16 on: January 18, 2012, 06:33:05 AM »
U dont played CSS? There's no clantag faking - u can only choose a clantag if u are in the steamgroup.
clantags aren't the Same as playernames

pic

No I do not play CSS. I messed around with War3Source on it before, but only locally against bots. I never played it online and I don't intend to ever do it either. With this addon I was thinking of something that would work across games and not just in CSS...

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Clan tag XP
« Reply #17 on: January 18, 2012, 12:51:48 PM »
OOOO put that on svn

Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Clan tag XP
« Reply #18 on: January 23, 2012, 04:04:09 PM »
@Ownz, can you figure out what's wrong with clan tag script if you have time....... Revan done everything good but something wrong with xp rate system

alex0310

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • http://forum.cmepiii.ru/
Re: Clan tag XP
« Reply #19 on: February 17, 2012, 09:27:44 AM »
I tested this addon.
i had some trouble with cstrike.inc
therefore i used  cssclantags.inc and cssclantags.txt
also i fixed some inaccuracy...

cvarlist:
war3_bonusclan_name  - actually the bonused clan
war3_bonusclan_xprate  - xp multipler
war3_bonusclan_goldrate  - gold multipler

Thank Revan and Chuck (for your idea & code)
« Last Edit: March 04, 2012, 05:40:46 AM by alex0310 »

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Clan tag XP
« Reply #20 on: February 17, 2012, 09:56:18 AM »
Cool! If it works now we can put it on the svn
#war3source on gamesurge

alex0310

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • http://forum.cmepiii.ru/
Re: Clan tag XP
« Reply #21 on: February 17, 2012, 10:52:25 PM »
I continue with my test
I hope get responses to this version addon
maybe have to add something )))

Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Clan tag XP
« Reply #22 on: February 20, 2012, 06:12:13 AM »
Calculation for wearing clan tax is same as without wearing clan tag when it set 1.2xp!

alex0310

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • http://forum.cmepiii.ru/
Re: Clan tag XP
« Reply #23 on: February 20, 2012, 08:19:51 AM »
Calculation for wearing clan tax is same as without wearing clan tag when it set 1.2xp!
you should set cvar war3_bonusclan_name Your_ClanName
if you don't set this cvar then calculation evaluate as usual

Chuck

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Clan tag XP
« Reply #24 on: February 20, 2012, 04:40:38 PM »
Ya my group steam clan tag is  set .:Tmu:.! still same