Raised This Month: $32 Target: $400
 8% 

Issue Zephyrus store more credits for vips


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
workes
Junior Member
Join Date: Mar 2020
Old 03-24-2020 , 11:02   Zephyrus store more credits for vips
Reply With Quote #1

Hello, I am currently trying to figure out how to give different amounts of credits (for kills) for different flags. I have tried a lot of different things but nothing has worked so far, so now I'm reaching out here, does anyone have any good ideas?
workes is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 03-25-2020 , 02:06   Re: Zephyrus store more credits for vips
Reply With Quote #2

A quick Google search for "zephyrus store vip" gave:

[Zephyrus Store] Give credits on flag

Any particular reason why the advice given over there won't work for you?
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
workes
Junior Member
Join Date: Mar 2020
Old 03-25-2020 , 06:57   Re: Zephyrus store more credits for vips
Reply With Quote #3

they are talking about a one-time amount of credits for when somebody gets VIP, I'm talking of a constant amount of x credits for VIPs, either an additional amount or a multiplier, but as I've said i have tried to fool around in the .sp (and compiling ofc) but I don't seem to be able to set up a statement that would for if(VIP) give (credits * multiplier) else if give (credits), I've tried 2 different methods and both with no success.
workes is offline
workes
Junior Member
Join Date: Mar 2020
Old 03-25-2020 , 07:38   Re: Zephyrus store more credits for vips
Reply With Quote #4

Finally figured out something that workes using https://forums.alliedmods.net/showthread.php?t=273791

If anyone else needs this
For the timed credits:
Code:
public Action:Timer_CreditTimer(Handle:timer, any:userid)
{
	new client = GetClientOfUserId(userid);
	if(!client || !IsClientInGame(client))
		return Plugin_Continue;
	
	decl m_iCredits;

	if(2<=GetClientTeam(client)<=3 && CheckCommandAccess(client, "GiveExtraCredits", ADMFLAG_CUSTOM6, true)) //Credits for chief-admins(which have the flag CUSTOM6)
		m_iCredits = 100;
	else if(2<=GetClientTeam(client)<=3 && CheckCommandAccess(client, "GiveExtraCredits", ADMFLAG_CUSTOM5, true)) //Credits for Head-admins
		m_iCredits = 80;
	else if(2<=GetClientTeam(client)<=3 && CheckCommandAccess(client, "GiveExtraCredits", ADMFLAG_CUSTOM4, true)) //Admins etc...
		m_iCredits = 60;
	else if(2<=GetClientTeam(client)<=3 && CheckCommandAccess(client, "GiveExtraCredits", ADMFLAG_RESERVATION, true))
		m_iCredits = 40;
	else if(2<=GetClientTeam(client)<=3)
		m_iCredits = 25;
	else
		m_iCredits = 0; //Inactive players

	if(m_iCredits)
	{
		g_eClients[client][iCredits] += m_iCredits;
		if(g_eCvars[g_cvarCreditMessages][aCache])
			Chat(client, "%t", "Credits Earned For Playing", m_iCredits);
		Store_LogMessage(client, m_iCredits, "Earned for playing");
	}

	return Plugin_Continue;
}
For the per-kill credits:
Code:
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new victim = GetClientOfUserId(GetEventInt(event, "userid"));
	new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));

	if(g_eCvars[g_cvarSaveOnDeath][aCache])
	{
		Store_SaveClientData(victim);
		Store_SaveClientInventory(victim);
		Store_SaveClientEquipment(victim);
	}

	if(!attacker || victim == attacker || !IsClientInGame(attacker) || IsFakeClient(attacker))
		return Plugin_Continue;

	if(g_eCvars[g_cvarCreditAmountKill][aCache] && CheckCommandAccess(attacker, "GiveExtraCredits", ADMFLAG_CUSTOM6, true)) //Chief admins
	{
		g_eClients[attacker][iCredits] += 50;
		if(g_eCvars[g_cvarCreditMessages][aCache])
			Chat(attacker, "%t", "Credits Earned For Killing", 50, g_eClients[victim][szName]);
		Store_LogMessage(attacker, 50, "Earned for killing"); //Head-admins etc..
	}
	else if(g_eCvars[g_cvarCreditAmountKill][aCache] && CheckCommandAccess(attacker, "GiveExtraCredits", ADMFLAG_CUSTOM5, true))
	{
	g_eClients[attacker][iCredits] += 35;
	if(g_eCvars[g_cvarCreditMessages][aCache])
		Chat(attacker, "%t", "Credits Earned For Killing", 35, g_eClients[victim][szName]);
	Store_LogMessage(attacker, 35, "Earned for killing");
	}
	else if(g_eCvars[g_cvarCreditAmountKill][aCache] && CheckCommandAccess(attacker, "GiveExtraCredits", ADMFLAG_CUSTOM4, true))
	{
	g_eClients[attacker][iCredits] += 25;
	if(g_eCvars[g_cvarCreditMessages][aCache])
		Chat(attacker, "%t", "Credits Earned For Killing", 25, g_eClients[victim][szName]);
	Store_LogMessage(attacker, 25, "Earned for killing");
	}
	else if(g_eCvars[g_cvarCreditAmountKill][aCache] && CheckCommandAccess(attacker, "GiveExtraCredits", ADMFLAG_RESERVATION, true))
	{
	g_eClients[attacker][iCredits] += 20;
	if(g_eCvars[g_cvarCreditMessages][aCache])
		Chat(attacker, "%t", "Credits Earned For Killing", 20, g_eClients[victim][szName]);
	Store_LogMessage(attacker, 20, "Earned for killing");
	}
	else
	{
	g_eClients[attacker][iCredits] += 10;
	if(g_eCvars[g_cvarCreditMessages][aCache])
		Chat(attacker, "%t", "Credits Earned For Killing", 10, g_eClients[victim][szName]);
	Store_LogMessage(attacker, 10, "Earned for killing");
	}
	return Plugin_Continue;
}
workes is offline
Reply


Thread Tools
Display Modes

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 18:58.


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