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

[REQ] Store credits for finishing surf maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
B_R
Member
Join Date: May 2017
Old 05-10-2017 , 16:27   [REQ] Store credits for finishing surf maps
Reply With Quote #1

Hi guys,
i have a surf server and i need a plugin that awards players on my server credits for finishing surf maps
Thank you for any help !
B_R is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-10-2017 , 16:49   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #2

How do you finish a surf map?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-11-2017 , 06:53   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
How do you finish a surf map?
By killing the other team ?
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-11-2017 , 08:59   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #4

Doesn't sound like it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-11-2017 , 13:46   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #5

I feel like this is a request for SourceMod.

However, even in CS 1.6 there were maps that you would race through, just like in KreedZ mod. I liked such servers more than those classic CT vs TT surf servers.
klippy is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-12-2017 , 09:27   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #6

Quote:
Originally Posted by B_R View Post
Hi guys,
i have a surf server and i need a plugin that awards players on my server credits for finishing surf maps
Thank you for any help !
You must be using the cksurf timer for this to work.
Zephyrus Store.

Code:
// Includes
#include <sourcemod>
#include <store>
#include <cksurf>

// Compiler Options
#pragma semicolon 1
#pragma newdecls required

ConVar gc_iCreditsNormal;
ConVar gc_iCreditsBonus;
ConVar gc_iCreditsPrac;

// Info
public Plugin myinfo = 
{
    name = "[CKsurf] Store Credits Giver",
    author = "shanapu",
    description = "Give Credits for Zephs Store on finished map",
    version = "1.0",
    url = "https://github.com/shanapu/"
};

public void OnPluginStart()
{
    gc_iCreditsNormal = CreateConVar("sm_cksurfcredits_normal", "50", "How many credits for finishing map?", _, true, 1.0);
    gc_iCreditsBonus = CreateConVar("sm_cksurfcredits_bonus", "100", "How many credits for finishing bonus?", _, true, 1.0);
    gc_iCreditsPrac = CreateConVar("sm_cksurfcredits_practise", "25", "How many credits for finishing practise?", _, true, 1.0);
}

public Action ckSurf_OnMapFinished(int client, float fRunTime, char sRunTime[54], int rank, int total)
{
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsNormal.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsNormal.IntValue);
}

public Action ckSurf_OnBonusFinished(int client, float fRunTime, char sRunTime[54], int rank, int total, int bonusid)
{    
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsBonus.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing the bonus.", gc_iCreditsBonus.IntValue);
}

public Action ckSurf_OnPracticeFinished(int client, float fRunTime, char sRunTime[54])
{
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsPrac.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing the practise.", gc_iCreditsPrac.IntValue);
}

bool IsValidClient(int client, bool bAlive = false)
{
    if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return true;
    }
    
    return false;
}
CVARs:
Code:
sm_cksurfcredits_normal "50"
sm_cksurfcredits_bonus "100"
sm_cksurfcredits_practise "25"
For Sourcemod Store (Not Tested as I use Zephyrus's Store.

Code:
// Includes
#include <sourcemod>
#include <store/store-core>
#include <cksurf>

// Compiler Options
#pragma semicolon 1
#pragma newdecls required

ConVar gc_iCreditsNormal;
ConVar gc_iCreditsBonus;
ConVar gc_iCreditsPrac;

// Info
public Plugin myinfo = 
{
    name = "[CKsurf] Store Credits Giver",
    author = "shanapu",
    description = "Give Credits for SM Store on finished map",
    version = "1.1",
    url = "https://github.com/shanapu/"
};

public void OnPluginStart()
{
    gc_iCreditsNormal = CreateConVar("sm_cksurfcredits_normal", "50", "How many credits for finishing map?", _, true, 1.0);
    gc_iCreditsBonus = CreateConVar("sm_cksurfcredits_bonus", "100", "How many credits for finishing bonus?", _, true, 1.0);
    gc_iCreditsPrac = CreateConVar("sm_cksurfcredits_practise", "25", "How many credits for finishing practise?", _, true, 1.0);
}

public Action ckSurf_OnMapFinished(int client, float fRunTime, char sRunTime[54], int rank, int total)
{
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsNormal.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsNormal.IntValue);
}

public Action ckSurf_OnBonusFinished(int client, float fRunTime, char sRunTime[54], int rank, int total, int bonusid)
{    
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsBonus.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsBonus.IntValue);
}

public Action ckSurf_OnPracticeFinished(int client, float fRunTime, char sRunTime[54])
{
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsPrac.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsPrac.IntValue);
}

bool IsValidClient(int client, bool bAlive = false)
{
    if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return true;
    }
    
    return false;
}
All Credit goes to shanapu. He made these for my server a couple weeks ago.
Attached Files
File Type: smx smstore_ckcredits.smx (6.0 KB, 193 views)
File Type: sp Get Plugin or Get Source (smstore_ckcredits.sp - 174 views - 2.5 KB)
File Type: sp Get Plugin or Get Source (zeph-ck-credits.sp - 173 views - 2.2 KB)
File Type: smx zeph-ck-credits.smx (4.7 KB, 197 views)
TrappaTroopa is offline
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 05-12-2017 , 09:55   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #7

Quote:
Originally Posted by TrappaTroopa View Post
You must be using the cksurf timer for this to work.
Zephyrus Store.

Code:
// Includes
#include <sourcemod>
#include <store>
#include <cksurf>

// Compiler Options
#pragma semicolon 1
#pragma newdecls required

ConVar gc_iCreditsNormal;
ConVar gc_iCreditsBonus;
ConVar gc_iCreditsPrac;

// Info
public Plugin myinfo = 
{
    name = "[CKsurf] Store Credits Giver",
    author = "shanapu",
    description = "Give Credits for Zephs Store on finished map",
    version = "1.0",
    url = "https://github.com/shanapu/"
};

public void OnPluginStart()
{
    gc_iCreditsNormal = CreateConVar("sm_cksurfcredits_normal", "50", "How many credits for finishing map?", _, true, 1.0);
    gc_iCreditsBonus = CreateConVar("sm_cksurfcredits_bonus", "100", "How many credits for finishing bonus?", _, true, 1.0);
    gc_iCreditsPrac = CreateConVar("sm_cksurfcredits_practise", "25", "How many credits for finishing practise?", _, true, 1.0);
}

public Action ckSurf_OnMapFinished(int client, float fRunTime, char sRunTime[54], int rank, int total)
{
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsNormal.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsNormal.IntValue);
}

public Action ckSurf_OnBonusFinished(int client, float fRunTime, char sRunTime[54], int rank, int total, int bonusid)
{    
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsBonus.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing the bonus.", gc_iCreditsBonus.IntValue);
}

public Action ckSurf_OnPracticeFinished(int client, float fRunTime, char sRunTime[54])
{
    if(!IsValidClient(client))
    {
        return;
    }

    Store_SetClientCredits(client, Store_GetClientCredits(client) + gc_iCreditsPrac.IntValue);

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing the practise.", gc_iCreditsPrac.IntValue);
}

bool IsValidClient(int client, bool bAlive = false)
{
    if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return true;
    }
    
    return false;
}
CVARs:
Code:
sm_cksurfcredits_normal "50"
sm_cksurfcredits_bonus "100"
sm_cksurfcredits_practise "25"
For Sourcemod Store (Not Tested as I use Zephyrus's Store.

Code:
// Includes
#include <sourcemod>
#include <store/store-core>
#include <cksurf>

// Compiler Options
#pragma semicolon 1
#pragma newdecls required

ConVar gc_iCreditsNormal;
ConVar gc_iCreditsBonus;
ConVar gc_iCreditsPrac;

// Info
public Plugin myinfo = 
{
    name = "[CKsurf] Store Credits Giver",
    author = "shanapu",
    description = "Give Credits for SM Store on finished map",
    version = "1.1",
    url = "https://github.com/shanapu/"
};

public void OnPluginStart()
{
    gc_iCreditsNormal = CreateConVar("sm_cksurfcredits_normal", "50", "How many credits for finishing map?", _, true, 1.0);
    gc_iCreditsBonus = CreateConVar("sm_cksurfcredits_bonus", "100", "How many credits for finishing bonus?", _, true, 1.0);
    gc_iCreditsPrac = CreateConVar("sm_cksurfcredits_practise", "25", "How many credits for finishing practise?", _, true, 1.0);
}

public Action ckSurf_OnMapFinished(int client, float fRunTime, char sRunTime[54], int rank, int total)
{
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsNormal.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsNormal.IntValue);
}

public Action ckSurf_OnBonusFinished(int client, float fRunTime, char sRunTime[54], int rank, int total, int bonusid)
{    
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsBonus.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsBonus.IntValue);
}

public Action ckSurf_OnPracticeFinished(int client, float fRunTime, char sRunTime[54])
{
    if(!IsValidClient(client))
    {
        return;
    }

    int accountId = Store_GetClientAccountID(client);
    int oldCredits = Store_GetCreditsEx(accountId);
    
    Store_GiveCredits(accountId, (oldCredits+gc_iCreditsPrac.IntValue));

    PrintToChat(client, "\x04[Store]\x01 You have successfully earned %d cash for finishing this map.", gc_iCreditsPrac.IntValue);
}

bool IsValidClient(int client, bool bAlive = false)
{
    if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return true;
    }
    
    return false;
}
All Credit goes to shanapu. He made these for my server a couple weeks ago.
this amxx section...
__________________
√ Zombie plague + greats updates. finished.
√ Surf-Mod level + greats updates Finished.
√ Zombie Scenario like cso. Finished.
Click Here
√ Call Of Duty MOD. Finished.
Click Here


Sorry for my bad english. I'm using translate.
sirerick is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-12-2017 , 09:57   Re: [REQ] Store credits for finishing surf maps
Reply With Quote #8

Quote:
Originally Posted by sirerick View Post
this amxx section...
Well Crap. My Apologies!
TrappaTroopa 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 19:41.


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