View Single Post
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 04-27-2017 , 13:09   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2563

Quote:
Originally Posted by TrappaTroopa View Post
OK yes I do remember this one and I did test it a couple of weeks ago. However it no longer works. The plugin loads fine no credits are given. Error logs don't show anything since plugin loads just fine. Confirmed by me and 1 other person earlier in this thread.
Try this for zephyrus store
PHP 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?"_true1.0);
    
gc_iCreditsBonus CreateConVar("sm_cksurfcredits_bonus""100""How many credits for finishing bonus?"_true1.0);
    
gc_iCreditsPrac CreateConVar("sm_cksurfcredits_practise""25""How many credits for finishing practise?"_true1.0);
}

public 
Action ckSurf_OnMapFinished(int clientfloat fRunTimechar sRunTime[54], int rankint total)
{
    if(!
IsValidClient(client))
    {
        return;
    }

    
Store_SetClientCredits(clientStore_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 clientfloat fRunTimechar sRunTime[54], int rankint totalint bonusid)
{    
    if(!
IsValidClient(client))
    {
        return;
    }

    
Store_SetClientCredits(clientStore_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 clientfloat fRunTimechar sRunTime[54])
{
    if(!
IsValidClient(client))
    {
        return;
    }

    
Store_SetClientCredits(clientStore_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 clientbool bAlive false)
{
    if(
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return 
true;
    }
    
    return 
false;

Attached Files
File Type: sp Get Plugin or Get Source (zeph-ck-credits.sp - 117 views - 2.2 KB)
File Type: smx zeph-ck-credits.smx (4.7 KB, 115 views)
__________________
coding & free software
shanapu is offline