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

[CS:GO] ckSurf (1.18f, 24.11.2015)


Post New Thread Reply   
 
Thread Tools Display Modes
rowedahelicon
Senior Member
Join Date: Feb 2011
Location: The Observatory
Old 04-21-2017 , 18:04   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2551

I'm looking to update the web panel for the cksurf data, but I need someone to send me an .sql of their player database so I can have some data to work with. I don't run a surf server so I'm pretty high and dry here.

I'm looking for one that has stage records included. Thanks!
__________________
SCG, A furry community in the stars - https://www.scg.wtf
rowedahelicon is offline
Send a message via Skype™ to rowedahelicon
Kryptanyte
Junior Member
Join Date: Dec 2015
Old 04-21-2017 , 22:36   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2552

I'm aware this is the broken statement but you could always compile the checkpoints into one large string/text field, means you aren't limited to x number of checkpoints without changing the db structure.

Code:
char sQuery_checkPoints[] = "SELECT zonegroup, cps FROM ck_checkpoints WHERE steamid = '%s' AND mapname = '%s'
				UNION SELECT a.zonegroup, b.cps FROM ck_bonus AS a
					LEFT JOIN ck_checkpoints AS b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup;";
If you were to do that you would have to create a plugin to transfer all the data over to the new table structure which wouldn't be difficult.

Code to extract checkpoints:

PHP Code:
#define MAXCHECKPOINTS 256

float gF_PlayerCheckpoints[MAXPLAYERS+1][MAXCHECKPOINTS];

void CheckpointsFromString(int clientchar[] cpStringint sSize)
{
    
//You could calculate the rough size needed from sSize if you would prefer but
    //I'm pretty sure you're not going to go over 256 checkpoints or have a time that is 
    //Going to exceed 16 characters (Incl decimals)
    
char[][] Checkpoints = new char[MAXCHECKPOINTS][16
    
int i 0;
    
    
ReplaceString(cpStringsSize" """);
    
ReplaceString(cpStringsSize",,"",0.0,");
    
    
SplitString(cpString","Checkpoints16);
    
    while(!
StrEqual(Checkpoints[i], "")) 
    {
        
gF_PlayerCheckpoints[client][i] = StringToFloat(Checkpoints[i]);
        
        
i++;
    }
}

void CheckpointsToString(int clientchar[] cpStringint sSize)
{
    
int i 0;
    while(!
StrEqual(gF_PlayerCheckpoints[client][i], ""))
    {
        
Format(cpStringsSize"%s,%f.4"cpStringgF_PlayerCheckpoints[client][i]);
        
        
i++;
    }

I haven't tested this but I've used a system like this in a plugin I made a long time ago.

If you're really worried about query times/load times with ckSurf you could always cache player data that isn't map specific on map end to the server then load it back when they join the next map and only have to pull player info for that map. Could even pull player maptimes before map change and cache that too if you really wanted to but do it over the course of say 2 minutes so you don't choke the server.
Kryptanyte is offline
Dreamplay
Junior Member
Join Date: Apr 2017
Old 04-24-2017 , 14:34   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2553

So, I want to use ckSurf for a MG-server. As such, i want it to be played out in rounds. How do i enable so players respawn for 60 sec, then stop. And after 60 sec, and all players have died, a new round starts(basically only using the start, checkpoint, stop and point-system)?
Dreamplay is offline
DaddyApex
Junior Member
Join Date: Feb 2017
Old 04-25-2017 , 15:24   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2554

If I add a new surf map and upload it on my server, i write the mapname in the maplist and mapcycle.
After a restart and a rtv in the chat, you can vote for the new maps i added.

But there is a "*" in front of the mapname -> like

*surf_me

The other standart surf maps are without the * in front of the name.

How can i fix it?
DaddyApex is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 04-26-2017 , 14:41   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2555

So using SourceMod Store (Not Zeph's Store) is there a way to give credits on map completions? There is one here: https://forums.alliedmods.net/showthread.php?p=1883627

But that is for TIMER (CS:S). Not ckSurf

Last edited by TrappaTroopa; 04-26-2017 at 14:44.
TrappaTroopa is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 04-26-2017 , 15:08   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2556

Quote:
Originally Posted by TrappaTroopa View Post
So using SourceMod Store (Not Zeph's Store) is there a way to give credits on map completions? There is one here: https://forums.alliedmods.net/showthread.php?p=1883627

But that is for TIMER (CS:S). Not ckSurf
try this, not tested
PHP 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?"_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;
    }

    
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 clientfloat fRunTimechar sRunTime[54], int rankint totalint 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 clientfloat fRunTimechar 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 clientbool bAlive false)
{
    if(
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return 
true;
    }
    
    return 
false;

Quote:
Originally Posted by sneaK View Post
Search, somewhere in this thread or elsewhere there is a plugin. Pretty sure yash made it.
yashs is made for zephs
Attached Files
File Type: sp Get Plugin or Get Source (ckcredits.sp - 111 views - 2.5 KB)
File Type: smx ckcredits.smx (6.0 KB, 126 views)
__________________
coding & free software

Last edited by shanapu; 04-26-2017 at 15:32. Reason: added bonus & practise
shanapu is offline
SockerkakaN
Junior Member
Join Date: Apr 2017
Old 04-26-2017 , 16:17   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2557

Quote:
Originally Posted by jonitaikaponi View Post
ckSurf 1.18 final
a basic CS:GO surf plugin

Installing:
Spoiler


Client Commands:
Spoiler


Admin Commands:
Spoiler


CVars:
Spoiler












I having this issue:
L 04/26/2017 - 20:47:25: [admin-sql-prefetch.smx] Could not connect to database "default": [2003]: Can't connect to MySQL server on 'localhost' (10061)
L 04/26/2017 - 20:47:27: [admin-sql-prefetch.smx] Could not connect to database "default": [2003]: Can't connect to MySQL server on 'localhost' (10061)
L 04/26/2017 - 20:47:28: [admin-sql-prefetch.smx] Could not connect to database "default": [2003]: Can't connect to MySQL server on 'localhost' (10061)
L 04/26/2017 - 20:47:29: [admin-sql-threaded.smx] Failed to connect to database: [2003]: Can't connect to MySQL server on 'localhost' (10061)
L 04/26/2017 - 20:48:02: [SM] Exception reported: Language phrase "Enabled" not found (arg 3)

How do i fix it?
SockerkakaN is offline
TheEdgeClan.Eu
Member
Join Date: Jun 2016
Old 04-27-2017 , 11:03   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2558

L 04/27/2017 - 15:42:51: [SM] Blaming: ckSurf.smx
L 04/27/2017 - 15:42:51: [SM] Call stack trace:
L 04/27/2017 - 15:42:51: [SM] [1] Line 502, ckSurf/buttonpress.sp::CL_OnEndTimerPress
L 04/27/2017 - 15:42:51: [SM] [2] Line 182, ckSurf/surfzones.sp::StartTouch
L 04/27/2017 - 15:42:51: [SM] [3] Line 101, ckSurf/surfzones.sp::StartTouchTrigger


any fix the update has did this to the timer
__________________
TheEdgeClan.Eu is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-27-2017 , 11:53   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2559

Quote:
Originally Posted by TheEdgeClan.Eu View Post
L 04/27/2017 - 15:42:51: [SM] Blaming: ckSurf.smx
L 04/27/2017 - 15:42:51: [SM] Call stack trace:
L 04/27/2017 - 15:42:51: [SM] [1] Line 502, ckSurf/buttonpress.sp::CL_OnEndTimerPress
L 04/27/2017 - 15:42:51: [SM] [2] Line 182, ckSurf/surfzones.sp::StartTouch
L 04/27/2017 - 15:42:51: [SM] [3] Line 101, ckSurf/surfzones.sp::StartTouchTrigger


any fix the update has did this to the timer
Use SM 1.8, not 1.9.
__________________
sneaK is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 04-27-2017 , 12:11   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2560

Quote:
Originally Posted by shanapu View Post
try this, not tested
PHP 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?"_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;
    }

    
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 clientfloat fRunTimechar sRunTime[54], int rankint totalint 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 clientfloat fRunTimechar 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 clientbool bAlive false)
{
    if(
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return 
true;
    }
    
    return 
false;


yashs is made for zephs
I will test this weekend and let you know. I have gone back to Zeph's store for now as Iran into other issues with SourceMod Store (No Arms on Models, No Colored Tags, etc) But I plan to try again.

Can you link the one for zeph's Store? I tried one in the past but it didn't work. I search for the one made by "yash" but I only found his Math credits and his Hunter Mode Credits plugins.

Last edited by TrappaTroopa; 04-27-2017 at 12:22.
TrappaTroopa 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 05:50.


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