PDA

View Full Version : Basic SkillPoints v2.0.2 SE with API [FVault & SQL]


guipatinador
08-01-2012, 16:43
Basic SkillPoints v2.0.2 Special Edition

http://i.imgur.com/UyuV9.png


Introduction

This is the first time I post a plugin in alliedmodders.
The plugin basically gives you skillpoints for when you kill, plant, disarm or when your team wins the round. These points are stored in a database within the server and all SkillPoints are customizable by cvars.


Commands



/myskill – Shows your skillpoints in the server chat.
/restartskill - Restart your skillpoints and level
/rankskill - Show your current rank
/topskill- Show the Top15 players with the highest SkillPoints


Admin Commands


bps_give <target> <skillpoints to give>
bps_take <target> <skillpoints to take>



CVARS


/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////// SkillPoints Configuration //////////////////////////////////
bps_ads 1 // Turn on/off the commands announcements in the chat
bps_time_between_ads 300.0 // Time between adds (in seconds)
bps_announce_on_chat 1 // Turn on/off the announcements in the chat when you win/lose points
bps_skillpoints_on_nick 1 // Turn on/off SkillPoints in nickname ex: (nick <1337>) (updates when player spawn)
bps_hide_change_nick_notification 1 // Hide change nick announcement
bps_skillpoints_cmd 1 // Turn on/off /myskill command
bps_skillpoints_cmd_restart 1 // Turn on/off /restartskill command
bps_skillpoints_cmd_rank 1 // Turn on/off /rankskill command
bps_skillpoints_cmd_top15 1 // Turn on/off /topskill command
bps_hide_cmd 0 // Hide the commands
bps_enable_win_per_hour 1 // Turn on/off hourly points
bps_won_points_hour 5 // Points awarded for playing more than 1hour
bps_lost_points_tk 5 // Points lost for TeamKilling
bps_lost_points_suicide 1 // Points lost for suicide
bps_won_points_kill 1 // Points awarded per kill
bps_lost_points_kill 1 // Points lost per death
bps_won_points_headshot 2 // Points awarded per headshot
bps_lost_points_headshot 2 // Points lost for dying with an headshot
bps_won_points_knife 3 // Points awarded per knife kill
bps_lost_points_knife 3 // Points lost for dying with knife
bps_won_points_grenade 3 // Points awarded per HE kill
bps_lost_points_grenade 3 // Points lost for dying with an HE
bps_won_points_ts 1 // Points awarded to Terrorist Team for winning the round
bps_won_points_cts 1 // Points awarded to Counter-Terrorist Team for winning the round
bps_lost_points_ts 1 // Points lost to Terrorist Team for losing the round
bps_lost_points_cts // 1 Poits lost to Counter-Terrorist Team for losing the round
bps_won_points_planter 1 // Points awarded for planting the bomb
bps_won_points_planter_explode 2 // Points awarded for bomb successfully exploding
bps_won_points_defuser 3 // Points awarded for successfully disarming the bomb
bps_won_points_4k 4 // Points awarded for killing 4 in a round (almost)
bps_won_points_5k 5 // Points awarded for killing 5 (or more) in a round (ace)
bps_negative_points 0 // Turn on/off negative skillpoints
bps_sql_host "" // Host (SQL ONLY)
bps_sql_user "" / Username of the database (SQL ONLY)
bps_sql_pass "" // Password of the database (SQL ONLY)
bps_sql_db "" // Name of the database (SQL ONLY)
/////////////////////////////////////////////////////////////////////////////////////////////////


Requirements

FVault version

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < csx >
#include < hamsandwich >
#include < fvault >
SQL version

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < csx >
#include < hamsandwich >
#include < sqlx >
IMPORTANT
Requires amx mod x 1.8.1 or higher


Defines

FVault version

#define MAX_PLAYERS 32
#define ADMIN ADMIN_RCON
#define EXPIREDAYS 30
#define MAX_CLASSES 5
#define MAX_LEVELS 5
#define MAX_PONTUATION 10000 // max skillpoints per player
SQL version

#define MAX_PLAYERS 32
#define ADMIN ADMIN_RCON
#define CONNECT_TASK 1024
#define MAX_CLASSES 5
#define MAX_LEVELS 5
#define MAX_PONTUATION 10000 // max skillpoints per player


Levels

(This is just a reference, change at your own way)
SkillPoints < 500 Level: BOT
500 <= SkillPoints < 1200 Level: NOOB
1200 <= SkillPoints < 1800 Level: GAMER
1800 <= SkillPoints < 2500 Level: LEET
SkillPoints >= 2500 Level: TOP


new const CLASSES[ MAXCLASSES ][ ] = {
"BOT",
"NOOB",
"GAMER",
"LEET",
"TOP"
}

new const LEVELS[ MAXLEVELS ] = {
500,
1200,
1800,
2500,
100000 /* high value (not reachable) */
}


API


#pragma reqlib "skillpoints"

/**
* Returns the number of SkillPoints
*
* @param id - Index of the player
*/
native skillpoints( id )

Simple example,

#include < amxmodx >
#include < hamsandwich >
#include < skillpoints >

public plugin_init( )
{
register_plugin( "Test skillpoints.inc", "1.0.0", "guipatinador" )

RegisterHam( Ham_Spawn, "player", "Fwd_PlayerSpawnPost", 1 )
}

public Fwd_PlayerSpawnPost( id )
{
if( is_user_alive( id ) )
{
if( skillpoints( id ) > 0 )
{
client_print( id, print_chat, "WOW, you have positive SkillPoints!" )
}
}
}
Instalation


FVault version

1. Download and unzip the attached file
2. Find BasicSkillPointsFVault_SE.sma and compile it.
3. Copy BasicSkillPointsFVault_SE.amxx to the cstrike/addons/amxmodx/plugins folder
4. Add BasicSkillPointsFVault_SE.amxx to your plugins.ini file
5. Copy the cvars to your server.cfg and customize at your own way
6. Change map or restart your server

SQL version

1. Download and unzip the attached file
2. Find BasicSkillPointsSQL_SE.sma and compile it.
3. Copy BasicSkillPointsSQL_SE.amxx to the cstrike/addons/amxmodx/plugins folder
4. Add BasicSkillPointsSQL_SE.amxx to your plugins.ini file
5. Copy the cvars to your server.cfg and customize at your own way
6. Open index.php


// database connection
$sql_ip = "localhost";
$sql_user = "mysql_user";
$sql_password = "mysql_password";
$sql_database = "database_name";
6. Modify this, save and close
7. Upload index.php and style.css to your web server
8. Change map or restart your server

Useful tutorial: [HOWTO] Compile locally with custom includes (http://forums.alliedmods.net/showthread.php?t=130511)

To-Do List

-


Bugs

- When a player loses a lot of points, his level doesn't downgrade
- When a player die with the bomb explosion, he lost 1 point (for suicide)
- When you start the server for the first time, the plugin is forced to stop, with the following error,


L 02/23/2013 - 20:27:27: Start of error session.
L 02/23/2013 - 20:27:27: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20130223.log")
L 02/23/2013 - 20:27:27: [AMXX] Plugin ("BasicSkillPointsSQL.amxx") is setting itself as failed.
L 02/23/2013 - 20:27:27: [AMXX] Plugin says: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 02/23/2013 - 20:27:27: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL.amxx") - forced exit
Just change your map and it will be ok.


Changelog


v2.0.2 (18/04/2014) FVault & SQL SPECIAL EDITION
- Some parts of the code were rewritten, requested by hornet

v2.0.1 (06/04/2014) FVault & SQL SPECIAL EDITION
- Max size of array changed (192 -> 190) to prevent server crash

v2.0.0 (28/03/2013) FVault & SQL SPECIAL EDITION
- Inclusion of Kills, Deaths, HeadShots, Knife Kills / Deaths, Grenade Kills / Deaths, Bomb Explosions, Defused Bombs and Won Rounds
- Top15 restructured (JumpStats style)

v1.2.0 (27/03/2013) FVault & SQL
- Code improvements

v1.1.9 (04/03/2013) FVault & SQL
- award for killing 4 (almost) ou 5 (ace) in a round

v1.1.8 (04/03/2013) FVault
- Top15 to the FVault version
- Fixed a bug in the rank command

v1.1.7 (23/02/2013) FVault & SQL
- Add a rank to the FVault version
- Fixed a bug in bps_give and bps_take
- Add an advertisement to /topskill command

v1.1.6 (23/02/2013) FVault & SQL
- Add a Top15 for the SQL version (like the original /top15 of statsx)
- Fixed a cvar name

v1.1.5 (23/02/2013) FVault & SQL
- a lot of things were changed

v1.1.4 (29/08/2012) nVault & SQL
- When T/CT loose the round, they lose points (added 2 cvars for that)
- Points are saved at the end of the round with a delay of 0.5 sec
- Now players can win points if they kill BOT's

v1.1.3 (22/08/2012) nvault & SQL
- Now points are saved when a player spawn / disconnect
- Important fix when the plugin load the points (SQL version)

v1.1.2 (19/08/2012) nVault & SQL
- Bug fixed when a player connect / disconnect
- Fixed SQL Injection

v1.1.1 (19/08/2012) SQL
- Now /rankskill works faster !!!

v1.1.0 (19/08/2012) SQL
- Add an advertisement to /rankskill command

v1.0.9 (19/08/2012) SQL
- Add SQL
- Add rank system
- In SQL version points are saved in the end of the round

v1.0.8 (11/08/2012) nVault
- Fixed bug when you give/take points. -> This is not fixed yet
- Fixed string size

v1.0.7 (08/08/2012) nVault
- Add #define EXPIREDAYS 30

v1.0.6 (05/08/2012) nVault
- Fixed skillpoints when CT's win the round
- Code optimized

v1.0.5 (04/08/2012) nVault
- Add the code of ColorChat Stock to the .sma. Now you don't need to compile locally

v1.0.4 (03/08/2012) nVault
- Add API

v1.0.3 (03/08/2012) nVault
- Now SkillPoints in nickname updates at the player spawn (instead of new round)

v1.0.2 (02/08/2012) nVault
- Add /restartskill for restart SkillPoints and level
- Add bps_give and bps_take (admin only)

v1.0.1 (02/08/2012) nVault
- Fixed skillpoints when you die with a headshot

v1.0.0 (01/082012) nVault
- Initial release

Credits

- ramais and FallenAngel for translating to English
- ramais for the php script
- fysiks - SkillPoints in nickname - http://forums.alliedmods.net/showpost.php?p=1198447&postcount=4
- Exolent[jNr] - Hide change nick notification - https://forums.alliedmods.net/showpost.php?p=919005&postcount=23
- ConnorMcLeod - cs_get_user_team http://forums.alliedmods.net/showthread.php?t=191400
- ConnorMcLeod - ColorChat Stock http://forums.alliedmods.net/showpost.php?p=1417992&postcount=90
- Exolent[jNr] - JumpStats MOTD

Screenshots


http://i.imgur.com/hoGLp.png

http://i.imgur.com/KcL7o.png

http://i.imgur.com/LAvfs.png

http://i.imgur.com/5HYwc.png

http://i.imgur.com/bwgqQ.png

http://i.imgur.com/ic45c.png

http://i.imgur.com/Kuv9C.png

http://i.imgur.com/vJUmi.png

http://i.imgur.com/BzOAO.png

http://i.imgur.com/dka1U.png

http://i.imgur.com/hMpXs.png

http://i.imgur.com/QTmAV.png

http://i.imgur.com/sFOzZ.png

http://i.imgur.com/wSHdR.jpg

http://i.imgur.com/BhuqMDy.png

quilhos
08-01-2012, 18:32
Another SkillPoints plugin. What is the difference to all the others?

guipatinador
08-01-2012, 18:53
I only know this... http://forums.alliedmods.net/showthread.php?t=74175
And this http://forums.alliedmods.net/showthread.php?t=131720 don't work properly.

jonnzus
08-02-2012, 05:42
So this is bit like hlxce?
E. Suggestion: Make some php script what shows points.

quark
08-02-2012, 05:58
Sugest: Make sql version, and web files, add lang, command to restart points.

guipatinador
08-02-2012, 05:58
So this is bit like hlxce?
Yes is similar to hlxce. But hlxce is hard to set-up for many people so I made this plugin.

E. Suggestion: Make some php script what shows points.
Sugest: Make sql version, and web files, add lang, command to restart points.

I will add SQL in To-Do List.

KillerMasa
08-02-2012, 20:24
This Looks Really Good,Maybe I Will Use It.
Good Work :up:

guipatinador
08-03-2012, 16:53
This Looks Really Good,Maybe I Will Use It.
Good Work :up:
Thanks :)

Now with API... (was not in the to-do list)
Next: SQL

Bence98007
08-03-2012, 19:29
Dont works for me. 10 errors.



Error: Initialization data exceeds declared size on line 133
Error: Initialization data exceeds declared size on line 205
Error: Undefined symbol "TrieCreate" on line 267
Error: Undefined symbol "TrieSetCell" on line 268
Error: Undefined symbol "TrieSetCell" on line 269
Error: Undefined symbol "TrieSetCell" on line 270
Error: Undefined symbol "TrieSetCell" on line 271
Error: Undefined symbol "TrieSetCell" on line 272
Error: Undefined symbol "TrieSetCell" on line 273
Error: Undefined symbol "TrieKeyExists" on line 316
Warning: Symbol is assigned a value that is never used: "IgnoredAuthID" on line 781

10 Errors.
Could not locate output file C:\Documents and Settings\Rendszergazda\Asztal\Sunwell\Átkonve rtált pluginok\BasicSkillPoints.amx (compile failed).

guipatinador
08-03-2012, 19:34
It seems that you have a old amx mod x version.
Update to version 1.8.1 or higher http://www.amxmodx.org/downloads.php

EDIT: You don't need to compile anymore. Just download the .amxx

Napoleon_be
08-04-2012, 19:17
Somethin simular to your plugin tho..
http://forums.alliedmods.net/showthread.php?t=184162

jonnzus
08-10-2012, 21:13
Suggestion: When round ends there will become message who got most points:
Example: Player x got the most points in round. ( 8 )

Merciless
08-10-2012, 22:55
Nice to see something new on Alliedmodders.

http://i0.kym-cdn.com/photos/images/original/000/175/315/PicardDoubleFacepalm-1.jpg?1316330080

pepe_thugs
08-11-2012, 10:10
This plugin have one Bug :
When i give points and then take the level do not restart...



Suggestion: Try to add difficulty when player change the next level.

guipatinador
08-11-2012, 10:37
That happen because the plugin only check the level when you earn points.
Thanks for the report. I will fix that.

pepe_thugs
08-12-2012, 07:25
And about my Suggestion try to add more difficulty in each level?

Request: Remove the negative points and check points in name only when the player change name and when he connects or disconnect in the server. :up::up:

quilhos
08-12-2012, 09:26
I have a question, if this plugin change the name of players when the points change, this dont do a lot of spam in the chat?

guipatinador
08-12-2012, 09:35
And about my Suggestion try to add more difficulty in each level?
You can change the skillpoints for each level.

Request: Remove the negative points and check points in name only when the player change name and when he connects or disconnect in the server. The points in nickname update when a player spawn, so I think that isn't necessary. But if you want I can do that for you.

I have a question, if this plugin change the name of players when the points change, this dont do a lot of spam in the chat?

No. You have a cvar for enable/disable that spam.

bps_hide_change_nick_notification 1 // Hide change nick announcement

pepe_thugs
08-13-2012, 07:50
You can change the skillpoints for each level.

How ?
I told you more difficulty like this Example: 5 points for headshot in level "BOT" and to the next level give 3 points for headshot you understand me ?

The points in nickname update when a player spawn, so I think that isn't necessary. But if you want I can do that for you.

Yes i want the points update only when map change or client disconnect or connect.
And i want positive points only.
You can do this for me ???
Thanks.

guipatinador
08-13-2012, 08:01
How ?
I told you more difficulty like this Example: 5 points for headshot in level "BOT" and to the next level give 3 points for headshot you understand me ?
Hmm now I understand.
That is possible, but if I put cvars for each level, the plugin will have a lot of cvars.
For example, 5 points in level BOT, 4 points in level NOOB, 3 points in level GAMER, etc

Yes i want the points update only when map change or client disconnect or connect.
And i want positive points only.
You can do this for me ???
Thanks.Ok will do that.
I will sent you a PM when I finish.

pepe_thugs
08-13-2012, 08:53
Hmm now I understand.
That is possible, but if I put cvars for each level, the plugin will have a lot of cvars.
For example, 5 points in level BOT, 4 points in level NOOB, 3 points in level GAMER, etc

Yes it is.

Ok will do that.
I will sent you a PM when I finish.

Big Thanks guipatinador :up: :up:

guipatinador
08-19-2012, 12:02
SQL version already made :D

http://i.imgur.com/7cv14.png

jonnzus
08-19-2012, 14:33
Thanks for mysql :)

e. Can you add something like /skilltop or something like that to show players with most points.

guipatinador
08-19-2012, 15:21
Thanks for mysql :)

e. Can you add something like /skilltop or something like that to show players with most points.

/topskill is in my to-do list :)

edit: v1.1.1 is out. Now /rankskill command works faster.

Swat-inc
08-19-2012, 16:01
Hi ;) can you make to save skillpoits by IP or Player name ?

Alka
08-19-2012, 16:15
Take care of SQL Injection and fix it.

guipatinador
08-19-2012, 16:44
Take care of SQL Injection and fix it.



replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )

Is this ok?

Alka
08-19-2012, 16:51
Yea, a quick method. :)

guipatinador
08-20-2012, 11:59
Hi hi hi,
I don't add /topskill for SQL yet, but you can do the following,


public plugin_init( )
{
// code

register_clcmd( "say /topskill", "TopSkill" )

// rest of the code
}

// somewhere at the plugin

public TopSkill( id )
show_motd( id, "URL_TO_SKILLPOINTS", "SkillPoints" )
And the result will be http://i.imgur.com/YH34u.jpg

jonnzus
08-20-2012, 15:48
Can you add page system to .php file so it would be able to see all players?:)

guipatinador
08-20-2012, 15:57
I don't know how to work with PHP (that script was made by a friend). I will talk to him to do that soon as possible.

jonnzus
08-20-2012, 16:09
Okay :D

quark
08-20-2012, 18:24
Woow thanks now im not gonna sell my skillpoints anymore :(

Subray
08-20-2012, 18:27
Woow thanks now im not gonna sell my skillpoints anymore :(

lol fail!

pepe_thugs
08-21-2012, 07:38
Woow thanks now im not gonna sell my skillpoints anymore :(


That version of skillpoints is not your. :nono::nono:
You edited one plugin already made.

Lokogaditano
08-21-2012, 11:25
your nvault version works fine, but I put sql version, and not work, in pauseplugins of amxmodmenu say: BLOQUED, why? I have mysql running

guipatinador
08-21-2012, 13:39
Make sure that you have the server IP in your cPanel.

Lokogaditano
08-21-2012, 13:45
the server ip en my cpanel?
in pause plugins appear
BasicSkillPointsSQL BLOQUED
but not unknow...

pepe_thugs
08-21-2012, 15:17
With your exprience join with NiceGuyx (http://forums.alliedmods.net/member.php?u=162888) and say that you are the best coders of alliedmodders. :up:

kwpd
08-22-2012, 02:30
como se puede crear A = asistencia + 3k 4k 5k ?
chekea skillpoint modo rank :D
http://ultratek-panama.com/skillpoints/index.php

jonnzus
08-22-2012, 05:13
nice :o

guipatinador
08-22-2012, 08:38
Yesterday I did something similiar :)
http://i.imgur.com/x0Qq3.png
http://i.imgur.com/WBbui.jpg

guipatinador
08-22-2012, 11:56
Sorry for double post
I update both versions. If you have SQL version, I strongly recommend you to update to v1.1.3

Old,

format( szTemp, charsmax( szTemp ), "SELECT skillpoints FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )


New,

format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )

kwpd
08-22-2012, 14:15
el rank deberia ser por points
nick - points - kill - death - HS - BP - BD - 3K - 4K - 5K

g_szPoints[ killer ] += get_pcvar_num( g_iWonPointsKill )
g_szPoints[ victim ] -= get_pcvar_num( g_iLostPointsDeath )=>

g_szPoints[ killer ] += get_pcvar_num( g_iWonPointsKill )
g_szPoints[ victim ] -= get_pcvar_num( g_iLostPointsDeath )

g_szPoints_K[ killer ] += get_pcvar_num( g_iWonPointsKill_kill )
g_szPoints_D[ victim ] += get_pcvar_num( g_iWonPointsDeath_death )este metodo sera mas efectivo? .topskill o .toppoints reemplaza el viejo rank /top15

google traductor xD
This method will be most effective? . TOPSKILL or. toppoints replaces the old rank / top15

guipatinador
08-22-2012, 14:28
I don't know what you are trying to do.
What is 3K 4K and 5K ?

kwpd
08-22-2012, 14:40
nick - points - kill - death - HS - BP - BD - KK - KB- KW

the points of first. as ranking :D

YamiKaitou
08-22-2012, 15:26
English Only please

kwpd
08-26-2012, 00:24
not a bad ideas. adds round loss. -1 points

register_event( "SendAudio", "TerroristsWin", "a", "2&%!MRAD_terwin" )
register_event( "SendAudio", "CounterTerroristsLoss", "a", "2&%!MRAD_terwin" )

register_event( "SendAudio", "TerroristsLoss", "a", "2&%!MRAD_ctwin" )
register_event( "SendAudio", "CounterTerroristsWin", "a", "2&%!MRAD_ctwin" )public TerroristsLoss( )
{
if( get_pcvar_num( g_iWonPointsTerrorists ) > 0 )
{
new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( cs_get_user_team( i ) == CS_TEAM_T && !is_user_ignored[ i ] )
g_szPoints[ i ] -= get_pcvar_num( g_iWonPointsTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Terrorists have loses^3 %i^1 point%s for lose the round", PREFIX, get_pcvar_num( g_iWonPointsTerrorists ), get_pcvar_num( g_iWonPointsTerrorists ) > 1 ? "s" : "" )
}
}
}

public CounterTerroristsLoss( )
{
if( get_pcvar_num( g_iWonPointsCounterTerrorists ) > 0 )
{
new players[ 32 ]
new num
new j

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
j = players[ num ]

if( cs_get_user_team( j ) == CS_TEAM_CT && !is_user_ignored[ j ] )
g_szPoints[ j ] -= get_pcvar_num( g_iWonPointsCounterTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( j, GREEN, "%s^1 Counter-Terrorists have loses^3 %i^1 point%s for lose the round", PREFIX, get_pcvar_num( g_iWonPointsCounterTerrorists ), get_pcvar_num( g_iWonPointsCounterTerrorists ) > 1 ? "s" : "" )
}
}
}

sidney030235
08-26-2012, 03:58
when rank available in nvault version? thx:D

guipatinador
08-26-2012, 08:31
not a bad ideas. adds round loss. -1 points

You don't need to register a new event for that.

Just use this,

public TerroristsWin( )
{
if( get_pcvar_num( g_iWonPointsTerrorists ) > 0 )
{
new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( cs_get_user_team( i ) == CS_TEAM_T && !is_user_ignored[ i ] )
g_szPoints[ i ] += get_pcvar_num( g_iWonPointsTerrorists )

else if( cs_get_user_team( i ) == CS_TEAM_CT && !is_user_ignored[ i ] )
g_szPoints[ i ] -= points_to_loose

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Terrorists have won^3 %i^1 point%s for winning the round", PREFIX, get_pcvar_num( g_iWonPointsTerrorists ), get_pcvar_num( g_iWonPointsTerrorists ) > 1 ? "s" : "" )
}
}
}

public CounterTerroristsWin( )
{
if( get_pcvar_num( g_iWonPointsCounterTerrorists ) > 0 )
{
new players[ 32 ]
new num
new j

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
j = players[ num ]

if( cs_get_user_team( j ) == CS_TEAM_CT && !is_user_ignored[ j ] )
g_szPoints[ j ] += get_pcvar_num( g_iWonPointsCounterTerrorists )

else if( cs_get_user_team( j ) == CS_TEAM_T && !is_user_ignored[ j ] )
g_szPoints[ j ] -= points_to_loose

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( j, GREEN, "%s^1 Counter-Terrorists have won^3 %i^1 point%s for winning the round", PREFIX, get_pcvar_num( g_iWonPointsCounterTerrorists ), get_pcvar_num( g_iWonPointsCounterTerrorists ) > 1 ? "s" : "" )
}
}
}
I will add that in the next version.

when rank available in nvault version? thx:D
Rank/top15 is only available in SQL version.
I don't know how to add that in nvault (also don't know if is possible).

kwpd
08-29-2012, 04:06
old top15 http://i.imgur.com/Bcaou.jpg
New top15 http://i.imgur.com/gkRHq.jpg

old top15 ".dat" supports 1 server. and the design is pretty old
new top15 "sql" supports multiple server. can design to your liking.

guipatinador. you've tried on multiple servers?

guipatinador
08-29-2012, 10:09
guipatinador. you've tried on multiple servers?

Yes.

v1.1.4 is out :)

kwpd
08-30-2012, 04:13
as I can write. down? because in a straight line. this very long
if( SQL_NumResults( Query ) < 1 )
{
new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "INSERT INTO %s ( authid, nick, skillpoints, level, skillpointsK, skillpointsD, skillpointsBP, skillpointsBD, skillpointsHS, skillpointsKK, skillpointsKN ) VALUES( '%s', '%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i' )", SQL_TABLE, g_szAuthID[ id ], g_szName[ id ], g_szPoints[ id ], g_szLevels[ id ], g_szPointsK[ id ], g_szPointsD[ id ], g_szPointsBP[ id ], g_szPointsBD[ id ], g_szPointsHS[ id ], g_szPointsKK[ id ], g_szPointsKN[ id ] )

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )
}

kwpd
09-01-2012, 13:59
Add Give skillpoints all

register_concmd("bps_give", "CmdGivePoints", ADMIN, "<target @All> <skillpoints to give>" )
if(arg[0]=='@')

new iPlayer[32], iNum
get_players(iPlayer, iNum)
if(equali(arg[1],"All"))

for(new i; i < iNum; i++)

guipatinador
09-01-2012, 14:08
I will not add that (@all @t or @ct). I think that is unnecessary.

kwpd
09-01-2012, 16:10
can be implemented
online player minimum for the rank is activated.?

guipatinador
09-08-2012, 17:21
can be implemented
online player minimum for the rank is activated.?

I think I will implement that on next version.

Here is the code,


PlayersInTeams( )
{
new players[ 32 ]
new num
new i
new PlayersInCtAndT = 0

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

switch( cs_get_user_team( i ) )
{
case( CS_TEAM_T, CS_TEAM_CT ): PlayersInCtAndT++
}
}

return PlayersInCtAndT
}


And for example,


public bomb_explode( planter, defuser )
{
if( PlayersInTeams( ) >= 3 )
{
// code
}
}

kwpd
09-09-2012, 21:53
when you get this message. from which the error?

L 09/09/2012 - 20:41:20: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120909.log")
L 09/09/2012 - 20:41:20: [MySQL] Invalid handle: 0
L 09/09/2012 - 20:41:20: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_FreeHandle") - debug not enabled!
L 09/09/2012 - 20:41:20: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

guipatinador
09-09-2012, 21:56
add debug in that plugin and see the full error.

kwpd
09-09-2012, 22:13
L 09/09/2012 - 21:13:01: Start of error session.
L 09/09/2012 - 21:13:01: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120909.log")
L 09/09/2012 - 21:13:01: [MySQL] Invalid handle: 0
L 09/09/2012 - 21:13:01: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_FreeHandle") - debug not enabled!
L 09/09/2012 - 21:13:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 09/09/2012 - 21:13:01: Start of error session.
L 09/09/2012 - 21:13:01: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120909.log")
L 09/09/2012 - 21:13:01: [AMXX] Plugin needs newer debug version info (plugin "player_location.amxx")
L 09/09/2012 - 21:13:01: [AMXX] Displaying debug trace (plugin "pug_menu.amxx")
L 09/09/2012 - 21:13:01: [AMXX] Run time error 3: stack error
L 09/09/2012 - 21:13:01: [AMXX] [0] pug_menu.sma::load_votemap_menu (line 133)
L 09/09/2012 - 21:13:01: [AMXX] [1] pug_menu.sma::try_load_votemap_menu (line 123)
L 09/09/2012 - 21:13:01: [AMXX] [2] pug_menu.sma::plugin_cfg (line 94)
L 09/09/2012 - 21:13:02: [MySQL] Invalid handle: 0
L 09/09/2012 - 21:13:02: [AMXX] Displaying debug trace (plugin "BasicSkillPointsSQL.amxx")
L 09/09/2012 - 21:13:02: [AMXX] Run time error 10: native error (native "SQL_FreeHandle")
L 09/09/2012 - 21:13:02: [AMXX] [0] BasicSkillPointsSQL.sma::plugin_end (line 252)
L 09/09/2012 - 21:13:03: Start of error session.
L 09/09/2012 - 21:13:03: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120909.log")
L 09/09/2012 - 21:13:03: [AMXX] Plugin needs newer debug version info (plugin "player_location.amxx")
L 09/09/2012 - 21:13:03: [AMXX] Displaying debug trace (plugin "pug_menu.amxx")
L 09/09/2012 - 21:13:03: [AMXX] Run time error 3: stack error
L 09/09/2012 - 21:13:03: [AMXX] [0] pug_menu.sma::load_votemap_menu (line 133)
L 09/09/2012 - 21:13:03: [AMXX] [1] pug_menu.sma::try_load_votemap_menu (line 123)
L 09/09/2012 - 21:13:03: [AMXX] [2] pug_menu.sma::plugin_cfg (line 94)

guipatinador
09-10-2012, 06:32
L 09/09/2012 - 21:13:02: [AMXX] [0] BasicSkillPointsSQL.sma::plugin_end (line 252)

Show me that line.

kwpd
09-10-2012, 13:52
public plugin_end( )
SQL_FreeHandle( g_SqlTuple )

guipatinador
09-10-2012, 14:19
The error is caused by another thing. Atach your .sma or send me a PM.

kwpd
09-10-2012, 15:26
pug_stats influences the error?....

quark
09-19-2012, 13:04
Web files

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/rg2299/public_html/top15/index.php on line 15

Warning: Invalid argument supplied for foreach() in /home/rg2299/public_html/top15/index.php on line 34Have you tested it?

guipatinador
09-20-2012, 19:57
Web files

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/rg2299/public_html/top15/index.php on line 15

Warning: Invalid argument supplied for foreach() in /home/rg2299/public_html/top15/index.php on line 34

That happens when the sql don't return any result, so, there are no problem.

btw, try this,


if($db == true) {
while($b=mysql_fetch_array($db, MYSQL_ASSOC)) {
$players[]=$b;
}
Have you tested it?I don't release plugins without testing them.

kwpd
09-20-2012, 22:22
try this ...
set_task(0.1, "SqlInit") =====>
SqlInit()

kwpd
11-02-2012, 22:40
how to write this code down?

format(szTemp,charsmax(szTemp),"INSERT INTO %s (authid,nick,skillpoints,level,pug_k,pug_d,pu g_a,pug_3k,pug_4k,pug_5k,pug_adr,pug_fpr,pug_ hsp,pug_rws ) VALUES ('%s','%s','%i','%i','%i','%i','%i','%i','%i' ,'%i','%i','%i','%i')",SQL_TABLE,g_szAuthID[id],g_szName[id],g_szPoints[id],g_szLevels[id],g_szPoints_k[id],g_szPoints_d[id],g_szPoints_a[id],g_szPoints_bp[id],g_szPoints_bd[id],g_szPoints_3k[id],g_szPoints_4k[id],g_szPoints_5k[id],g_szPoints_adr[id],g_szPoints_fpr[id],g_szPoints_hsp[id],g_szPoints_rws[id])

guipatinador
11-03-2012, 06:24
format(szTemp,charsmax(szTemp),"INSERT INTO %s \
(authid,nick,skillpoints,level,pug_k,pug_d,pu g_a,pug_3k,pug_4k,pug_5k,pug_adr,pug_fpr,pug_ hsp,pug_rws ) \
VALUES ('%s','%s','%i','%i','%i','%i','%i','%i','%i' ,'%i','%i','%i','%i')", \
SQL_TABLE,g_szAuthID[id],g_szName[id],g_szPoints[id],g_szLevels[id],g_szPoints_k[id],g_szPoints_d[id],\
g_szPoints_a[id],g_szPoints_bp[id],g_szPoints_bd[id],g_szPoints_3k[id],g_szPoints_4k[id],g_szPoints_5k[id],\
g_szPoints_adr[id],g_szPoints_fpr[id],g_szPoints_hsp[id],g_szPoints_rws[id])

kwpd
11-03-2012, 13:52
error compiler + [MySQL] Invalid column: 2

L 11/03/2012 - 13:57:13: [MySQL] Invalid column: 2
L 11/03/2012 - 13:57:13: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 13:57:13: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 14:23:39: [MySQL] Invalid column: 2
L 11/03/2012 - 14:23:39: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 14:23:39: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 14:24:20: [MySQL] Invalid column: 2
L 11/03/2012 - 14:24:20: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 14:24:20: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:08: Start of error session.
L 11/03/2012 - 15:40:08: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20121103.log")
L 11/03/2012 - 15:40:08: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:08: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:08: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:36: Start of error session.
L 11/03/2012 - 15:40:36: Info (map "aim_map") (file "addons/amxmodx/logs/error_20121103.log")
L 11/03/2012 - 15:40:36: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:36: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:36: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:37: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:37: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:37: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:37: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:37: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:37: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:37: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:37: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:37: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:38: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:38: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:38: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:38: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:38: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:38: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:41: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:41: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:41: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:44: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:44: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:44: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:40:45: [MySQL] Invalid column: 2
L 11/03/2012 - 15:40:45: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:40:45: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:42:23: [MySQL] Invalid column: 2
L 11/03/2012 - 15:42:23: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:42:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:42:46: [MySQL] Invalid column: 2
L 11/03/2012 - 15:42:46: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:42:46: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:43:23: [MySQL] Invalid column: 2
L 11/03/2012 - 15:43:23: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:43:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:43:30: [MySQL] Invalid column: 2
L 11/03/2012 - 15:43:30: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:43:30: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/03/2012 - 15:45:32: [MySQL] Invalid column: 2
L 11/03/2012 - 15:45:32: [AMXX] Run time error 10 (plugin "BasicSkillPointsSQL.amxx") (native "SQL_ReadResult") - debug not enabled!
L 11/03/2012 - 15:45:32: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).public RegisterClient( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
if( SQL_IsFail( FailState, Errcode, Error ) )
return PLUGIN_HANDLED_MAIN

new id
id = Data[ 0 ]

if( SQL_NumResults( Query ) < 1 )
{
new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "INSERT INTO %s \
(authid, nick, skillpoints, level, pug_k, pug_d, pug_a, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_adr, pug_fpr, pug_hsp, pug_rws ) \
VALUES( '%s', '%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i' )",
SQL_TABLE, g_szAuthID[id], g_szName[id], g_szPoints[id], g_szLevels[id], g_szPoints_k[id], g_szPoints_d[id], g_szPoints_a[id],g_szPoints_bp[id],
g_szPoints_bd[id], g_szPoints_3k[id], g_szPoints_4k[id], g_szPoints_5k[id], g_szPoints_adr[id], g_szPoints_fpr[id], g_szPoints_hsp[id], g_szPoints_rws[id])

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )
}

else
{
g_szPoints[ id ] = SQL_ReadResult( Query, 0 )
g_szLevels[ id ] = SQL_ReadResult( Query, 1 )
g_szPoints_k[ id ] = SQL_ReadResult( Query, 2 )
g_szPoints_d[ id ] = SQL_ReadResult( Query, 3 )
g_szPoints_a[ id ] = SQL_ReadResult( Query, 4 )
g_szPoints_bp[ id ] = SQL_ReadResult( Query, 5 )
g_szPoints_bd[ id ] = SQL_ReadResult( Query, 6 )
g_szPoints_3k[ id ] = SQL_ReadResult( Query, 7 )
g_szPoints_4k[ id ] = SQL_ReadResult( Query, 8 )
g_szPoints_5k[ id ] = SQL_ReadResult( Query, 9 )
g_szPoints_adr[ id ] = SQL_ReadResult( Query, 10 )
g_szPoints_fpr[ id ] = SQL_ReadResult( Query, 11 )
g_szPoints_hsp[ id ] = SQL_ReadResult( Query, 12 )
g_szPoints_rws[ id ] = SQL_ReadResult( Query, 13 )
}

return PLUGIN_CONTINUE
}

kwpd
11-04-2012, 15:43
* plz update skillpoints 1.1.5 and add stats pug 3k 4k and 5k = ace
* stats enable/disable ""pug server""
* online player minimum for the rank is activated ""public server""
* plz update web.php

improve use this plugin to give "public server" or "pug server"
pugserver example https://forums.alliedmods.net/showthread.php?t=168906 or http://forums.alliedmods.net/showthread.php?p=549954
public server CSDM, GunGame, ZP or other

the truth is that if it works the modified code http://ultratek-panama.com/skillpoints.php
this modification is horrible .. if you give a touch can make it better

// sorry for my poor English. use google translator. xD \\

/* Originally made to the server of Tasca do Ze */

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < csx >
#include < hamsandwich >
#include < sqlx >

new const PLUGIN[ ] = "Basic SkillPoints SQL"
new const VERSION[ ] = "1.1.4"
new const AUTHOR[ ] = "guipatinador"

new pfrags[33]
new top
new gmsgStatusIcon

#define ADMIN ADMIN_RCON
#define MAXCLASSES 5
#define MAXLEVELS 5
#define MAXPONTUATION 1098000000 // max skillpoints per player

new const CLASSES[ MAXCLASSES ][ ] = {
"GAMER",
"GAMER",
"GAMER",
"GAMER",
"GAMER"
}

new const LEVELS[ MAXLEVELS ] = {
1090000000,
1095000000,
1096000000,
1097000000,
1098000000 /* high value (not reachable) */
}

new const SQL_TABLE[ ] = "skillpoints_v1"
new const PREFIX[ ] = "[skillpoints]"

new Trie:IgnoredAuthID // hltv, bots and non-steam users

new g_iMaxPlayers
new g_szAuthID[ 32 ][ 32 ]
new g_szName[ 32 ][ 32 ]
new g_szKillerName[ 32 ]
new g_szVictimName[ 32 ]

new Handle:g_SqlTuple
new g_iCount
new g_iRank

new g_Error[ 512 ]

new g_pcvarHost
new g_pcvaruUser
new g_pcvarPass
new g_pcvarDB

new g_szPoints[ 32 ]
new g_szLevels[ 32 ]
new g_szClasses[ 32 ]

new g_szPoints_k[ 32 ]
new g_szPoints_d[ 32 ]
new g_szPoints_a[ 32 ]
new g_szPoints_bp[ 32 ]
new g_szPoints_bd[ 32 ]
new g_szPoints_3k[ 32 ]
new g_szPoints_4k[ 32 ]
new g_szPoints_5k[ 32 ]
new g_szPoints_adr[ 32 ]
new g_szPoints_fpr[ 32 ]
new g_szPoints_hsp[ 32 ]
new g_szPoints_rws[ 32 ]

new g_TimeBetweenAds

new bool:is_user_ignored[ 33 ]

new g_iAdsOnChat
new g_iEnableAnnounceOnChat
new g_iEnableShowSkillPointsOnNick
new g_iHideChangeNickNotification
new g_iEnableSkillPointsCmd
new g_iEnableSkillPointsCmdRank
new g_iHideCmds
new g_iEnableWonPointsHour
new g_iWonPointsHour
new g_iLostPointsTK
new g_iLostPointsSuicide
new g_iWonPointsKill
new g_iLostPointsDeath
new g_iWonPointsHeadshot
new g_iLostPointsHeadshot
new g_iWonPointsKnife
new g_iLostPointsKnife
new g_iWonPointsGrenade
new g_iLostPointsGrenade
new g_iWonPointsTerrorists
new g_iWonPointsCounterTerrorists
new g_iLostPointsTerrorists
new g_iLostPointsCounterTerrorists
new g_iWonPointsPlanter
new g_iWonPointsPlanterExplode
new g_iWonPointsDefuser

new g_iPugEnd
new pcvarToggle1
new pcvarToggle2
new g_iConnectPug
new g_iDisconnectPug

new g_iszPoints_3k
new g_iszPoints_4k
new g_iszPoints_5k

/////////////////////////////////////
// ColorChat Stuff by ConnorMcLeod //
/////////////////////////////////////

#define NORMAL DontChange
#define GREEN DontChange
#define TEAM_COLOR DontChange
#define RED Red
#define BLUE Blue
#define GREY Grey
#define ColorChat client_print_color

enum _:Colors {
DontChange,
Red,
Blue,
Grey
}

stock const g_szTeamName[Colors][] = {
"UNASSIGNED",
"TERRORIST",
"CT",
"SPECTATOR"
}

/////////////////////////////////////

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR )

register_clcmd( "say .points", "GetSkillPoints" )
register_clcmd( "say_team .points", "GetSkillPoints" )

register_clcmd( "say .rank", "SkillRank" )
register_clcmd( "say_team .rank", "SkillRank" )

register_concmd("bps_give_pugend", "points_all_pugend", ADMIN, "_")
// register_concmd("bps_give", "CmdGivePoints", ADMIN, "<target> <skillpoints to give>" )
// register_concmd("bps_take", "CmdTakePoints", ADMIN, "<target> <skillpoints to take>" )

RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawnPost", 1 )

register_message( get_user_msgid( "SayText" ), "MessageSayText" )

register_event( "SendAudio", "TerroristsWin", "a", "2&%!MRAD_terwin" )
register_event( "SendAudio", "CounterTerroristsWin", "a", "2&%!MRAD_ctwin" )

register_logevent( "RoundEnd", 2, "1=Round_End" )

gmsgStatusIcon = get_user_msgid("StatusIcon")
register_event("DeathMsg","cmd_death","a")
register_event("ResetHUD","cmd_playerspawn","b")

g_iAdsOnChat = register_cvar( "bps_ads", "0" )
g_TimeBetweenAds = register_cvar( "bps_time_between_ads", "300.0" )
g_iEnableAnnounceOnChat = register_cvar( "bps_announce_on_chat", "0" )
g_iEnableShowSkillPointsOnNick = register_cvar( "bps_skillpoints_on_nick", "0" )
g_iHideChangeNickNotification = register_cvar( "bps_hide_change_nick_notification", "0" )
g_iEnableSkillPointsCmd = register_cvar( "bps_skillpoints_cmd", "1" )
g_iEnableSkillPointsCmdRank = register_cvar( "bps_skillpoints_cmd_rank", "1" )
g_iHideCmds = register_cvar( "bps_hide_cmd", "0" )
g_iEnableWonPointsHour = register_cvar( "bps_enable_win_per_hour", "0" )
g_iWonPointsHour = register_cvar( "bps_won_points_hour", "0" )
g_iLostPointsTK = register_cvar( "bps_lost_points_tk", "0" )
g_iLostPointsSuicide = register_cvar( "bps_lost_points_suicide", "1" )
g_iWonPointsKill = register_cvar( "bps_won_points_kill", "1" )
g_iLostPointsDeath = register_cvar( "bps_lost_points_kill", "1" )
g_iWonPointsHeadshot = register_cvar( "bps_won_points_headshot", "0" )
g_iLostPointsHeadshot = register_cvar( "bps_lost_points_headshot", "0" )
g_iWonPointsKnife = register_cvar( "bps_won_points_knife", "0" )
g_iLostPointsKnife = register_cvar( "bps_lost_points_knife", "0" )
g_iWonPointsGrenade = register_cvar( "bps_won_points_grenade", "0" )
g_iLostPointsGrenade = register_cvar( "bps_lost_points_grenade", "0" )
g_iWonPointsTerrorists = register_cvar( "bps_won_points_ts", "0" )
g_iWonPointsCounterTerrorists = register_cvar( "bps_won_points_cts", "0" )
g_iLostPointsTerrorists = register_cvar( "bps_lost_points_ts", "0" )
g_iLostPointsCounterTerrorists = register_cvar( "bps_lost_points_cts", "0" )
g_iWonPointsPlanter = register_cvar( "bps_won_points_planter", "0" )
g_iWonPointsPlanterExplode = register_cvar( "bps_won_points_planter_explode", "1" )
g_iWonPointsDefuser = register_cvar( "bps_won_points_defuser", "1" )
g_pcvarHost = register_cvar( "bps_sql_host", "192.168.1.69" )
g_pcvaruUser = register_cvar( "bps_sql_user", "root" )
g_pcvarPass = register_cvar( "bps_sql_pass", "password" )
g_pcvarDB = register_cvar( "bps_sql_db", "SkillPointsBeta" )

pcvarToggle1 = register_cvar("pug_leave_points", "1")
pcvarToggle2 = register_cvar("round_save_points", "1")

g_iPugEnd = register_cvar( "bps_won_points_pugend", "10" )
g_iConnectPug = register_cvar( "bps_won_points_connect", "10" )
g_iDisconnectPug = register_cvar( "bps_won_points_disconnect", "10" )

g_iszPoints_3k = register_cvar( "Pug_Live_3k", "1" )
g_iszPoints_4k = register_cvar( "Pug_Live_4k", "1" )
g_iszPoints_5k = register_cvar( "Pug_Live_5k", "1" )

g_iMaxPlayers = get_maxplayers( )

IgnoredAuthID = TrieCreate( )
TrieSetCell( IgnoredAuthID, "VALVE_ID_LAN", 1 )
TrieSetCell( IgnoredAuthID, "VALVE_ID_PENDING", 1 )
TrieSetCell( IgnoredAuthID, "STEAM_ID_LAN", 1 )
TrieSetCell( IgnoredAuthID, "STEAM_ID_PENDING", 1 )
TrieSetCell( IgnoredAuthID, "BOT", 1 )
TrieSetCell( IgnoredAuthID, "HLTV", 1 )

SqlInit()
}

public plugin_cfg( )
{
if( get_pcvar_num( g_iAdsOnChat ) > 0 )
set_task( get_pcvar_float( g_TimeBetweenAds ), "AdvertisementCmdMySkill" )
}

public SqlInit( )
{
new szHost[ 32 ]
new szUser[ 32 ]
new szPass[ 32 ]
new szDB[ 32 ]

get_pcvar_string( g_pcvarHost, szHost, charsmax( szHost ) )
get_pcvar_string( g_pcvaruUser, szUser, charsmax( szUser ) )
get_pcvar_string( g_pcvarPass, szPass, charsmax( szPass ) )
get_pcvar_string( g_pcvarDB, szDB, charsmax( szDB ) )

g_SqlTuple = SQL_MakeDbTuple( szHost, szUser, szPass, szDB )

new ErrorCode
new Handle:SqlConnection = SQL_Connect( g_SqlTuple, ErrorCode, g_Error, charsmax( g_Error ) )

if( SqlConnection == Empty_Handle )
set_fail_state( g_Error )

new Handle:Queries
Queries = SQL_PrepareQuery( SqlConnection, "CREATE TABLE IF NOT EXISTS %s ( authid VARCHAR( 32 ) \
PRIMARY KEY, nick VARCHAR( 32 ), skillpoints INT( 7 ), level INT( 2 ), pug_k INT( 7 ), pug_d INT( 7 ), pug_a INT( 7 ), pug_bp INT( 7 ), pug_bd INT( 7 ), \
pug_3k INT( 7 ), pug_4k INT( 7 ), pug_5k INT( 7 ), pug_adr INT( 7 ), pug_fpr INT( 7 ), pug_hsp INT( 7 ), pug_rws INT( 7 ) )", SQL_TABLE )

if( !SQL_Execute( Queries ) )
{
SQL_QueryError( Queries, g_Error, charsmax( g_Error ) )
set_fail_state( g_Error )
}

SQL_FreeHandle( Queries )
SQL_FreeHandle( SqlConnection )
}

public plugin_end( )
{
SQL_FreeHandle( g_SqlTuple )
}

public client_authorized( id )
{
get_user_authid( id , g_szAuthID[ id ], charsmax( g_szAuthID[ ] ) )
get_user_name( id, g_szName[ id ], charsmax( g_szName[ ] ) )

replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )

if( TrieKeyExists( IgnoredAuthID, g_szAuthID[ id ] ) )
is_user_ignored[ id ] = true

else
is_user_ignored[ id ] = false

if( is_user_ignored[ id ] )
return PLUGIN_HANDLED_MAIN

g_szPoints[ id ] = 0
g_szLevels[ id ] = 0
g_szClasses[ id ] = 0
g_szPoints_k[ id ] = 0
g_szPoints_d[ id ] = 0
g_szPoints_a[ id ] = 0
g_szPoints_bp[ id ] = 0
g_szPoints_bd[ id ] = 0
g_szPoints_3k[ id ] = 0
g_szPoints_4k[ id ] = 0
g_szPoints_5k[ id ] = 0
g_szPoints_adr[ id ] = 0
g_szPoints_fpr[ id ] = 0
g_szPoints_hsp[ id ] = 0
g_szPoints_rws[ id ] = 0

LoadPoints( id )

if( get_pcvar_num( g_iEnableWonPointsHour ) > 0 && get_pcvar_num( g_iWonPointsHour ) > 0 )
set_task( 3600.0, "GiveSkillPointsHour", id, _, _, "b" )

return PLUGIN_CONTINUE
}

public client_putinserver(id)
{
if( get_pcvar_num( pcvarToggle1 ) > 0 )
{
g_szPoints[ id ] += get_pcvar_num( g_iConnectPug )
}
CheckLevelAndSave(id)

return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
if( get_pcvar_num( pcvarToggle1 ) > 0 )
{
g_szPoints[ id ] -= get_pcvar_num( g_iDisconnectPug )
}
CheckLevelAndSave(id)

return PLUGIN_CONTINUE
}

public GiveSkillPointsHour( id )
{
g_szPoints[ id ] += get_pcvar_num( g_iWonPointsHour )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( id, GREEN, "%s^1 You earned %i point%s for playing more one hour", PREFIX, get_pcvar_num( g_iWonPointsHour ), get_pcvar_num( g_iWonPointsHour ) > 1 ? "s" : "" )
}

public client_death( killer, victim, wpnindex, hitplace, TK )
{
if( is_user_ignored[ killer ] )
return PLUGIN_HANDLED_MAIN

get_user_name( killer, g_szKillerName, charsmax( g_szKillerName ) )
get_user_name( victim, g_szVictimName, charsmax( g_szVictimName ) )

if( TK == 1 )
{
g_szPoints[ killer ] -= get_pcvar_num( g_iLostPointsTK )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsTK ) > 0 )
ColorChat( killer, GREEN, "%s^1 You have lost^3 %i^1 point%s by killing a teammate", PREFIX, get_pcvar_num( g_iLostPointsTK ), get_pcvar_num( g_iLostPointsTK ) > 1 ? "s" : "" )
}

if( killer == victim )
{
g_szPoints_d[ killer ] += get_pcvar_num( g_iLostPointsSuicide )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsSuicide ) > 0 )
ColorChat( killer, GREEN, "%s^1 You have lost^3 %i^1 point%s for committing suicide", PREFIX, get_pcvar_num( g_iLostPointsSuicide ), get_pcvar_num( g_iLostPointsSuicide ) > 1 ? "s" : "" )
}

if( killer != victim && ( 1 <= killer <= g_iMaxPlayers ) && ( 1 <= victim <= g_iMaxPlayers ) && !( hitplace == HIT_HEAD ) && !( wpnindex == CSW_KNIFE ) && !( wpnindex == CSW_HEGRENADE ) && TK == 0 )
{
g_szPoints_k[ killer ] += get_pcvar_num( g_iWonPointsKill )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iWonPointsKill ) > 0 )
ColorChat( killer, GREEN, "%s^1 You earned^3 %i^1 point%s by killing %s", PREFIX, get_pcvar_num( g_iWonPointsKill ), get_pcvar_num( g_iWonPointsKill ) > 1 ? "s" : "", g_szVictimName )

if( !is_user_ignored[ victim ] )
{
g_szPoints_d[ victim ] += get_pcvar_num( g_iLostPointsDeath )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsDeath ) > 0 )
ColorChat( victim, GREEN, "%s^1 You have lost^3 %i^1 point%s for dying", PREFIX, get_pcvar_num( g_iLostPointsDeath ), get_pcvar_num( g_iLostPointsDeath ) > 1 ? "s" : "" )
}
}

if( hitplace == HIT_HEAD && wpnindex != CSW_KNIFE && TK == 0 )
{
g_szPoints[ killer ] += get_pcvar_num( g_iWonPointsHeadshot )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iWonPointsHeadshot ) > 0 )
ColorChat( killer, GREEN, "%s^1 You earned^3 %i^1 point%s by killing %s with a headshot", PREFIX, get_pcvar_num( g_iWonPointsHeadshot ), get_pcvar_num( g_iWonPointsHeadshot ) > 1 ? "s" : "" ,g_szVictimName )

if( !is_user_ignored[ victim ] )
{
g_szPoints[ victim ] -= get_pcvar_num( g_iLostPointsHeadshot )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsHeadshot ) > 0 )
ColorChat( victim, GREEN, "%s^1 You have lost^3 %i^1 point%s for dying with a headshot", PREFIX, get_pcvar_num( g_iLostPointsHeadshot ), get_pcvar_num( g_iLostPointsHeadshot ) > 1 ? "s" : "" )
}
}

if( wpnindex == CSW_KNIFE && TK == 0 )
{
g_szPoints[ killer ] += get_pcvar_num( g_iWonPointsKnife )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iWonPointsKnife ) > 0 )
ColorChat( killer, GREEN, "%s^1 You earned^3 %i^1 point%s by killing %s with knife", PREFIX, get_pcvar_num( g_iWonPointsKnife ), get_pcvar_num( g_iWonPointsKnife ) > 1 ? "s" : "" ,g_szVictimName )

if( !is_user_ignored[ victim ] )
{
g_szPoints[ victim ] -= get_pcvar_num( g_iLostPointsKnife )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsKnife ) > 0 )
ColorChat( victim, GREEN, "%s^1 You have lost^3 %i^1 point%s for dying with knife", PREFIX, get_pcvar_num( g_iLostPointsKnife ), get_pcvar_num( g_iLostPointsKnife ) > 1 ? "s" : "" )
}
}

if( wpnindex == CSW_HEGRENADE && killer != victim && TK == 0 )
{
g_szPoints[ killer ] += get_pcvar_num( g_iWonPointsGrenade )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iWonPointsGrenade ) > 0 )
ColorChat( killer, GREEN, "%s^1 You earned^3 %i^1 point%s by killing %s with a grenade", PREFIX, get_pcvar_num( g_iWonPointsGrenade ), get_pcvar_num( g_iWonPointsGrenade ) > 1 ? "s" : "" ,g_szVictimName )

if( !is_user_ignored[ victim ] )
{
g_szPoints[ victim ] -= get_pcvar_num( g_iLostPointsGrenade )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsGrenade ) > 0 )
ColorChat( victim, GREEN, "%s^1 You have lost^3 %i^1 point%s for dying with a grenade", PREFIX, get_pcvar_num( g_iLostPointsGrenade ), get_pcvar_num( g_iLostPointsGrenade ) > 1 ? "s" : "" )
}
}

return PLUGIN_CONTINUE
}

public TerroristsWin( )
{
new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( !is_user_ignored[ i ] )
{
switch( cs_get_user_team( i ) )
{
case( CS_TEAM_T ):
{
if( get_pcvar_num( g_iWonPointsTerrorists ) > 0 )
{
g_szPoints[ i ] += get_pcvar_num( g_iWonPointsTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (T)^1 have won^3 %i^1 point%s for winning the round", PREFIX, get_pcvar_num( g_iWonPointsTerrorists ), get_pcvar_num( g_iWonPointsTerrorists ) > 1 ? "s" : "" )
}
}

case( CS_TEAM_CT ):
{
if( get_pcvar_num( g_iLostPointsCounterTerrorists ) > 0 )
{
g_szPoints[ i ] -= get_pcvar_num( g_iLostPointsCounterTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (CT)^1 have lost^3 %i^1 point%s for losing the round", PREFIX, get_pcvar_num( g_iLostPointsCounterTerrorists ), get_pcvar_num( g_iLostPointsCounterTerrorists ) > 1 ? "s" : "" )
}
}
}
}
}
}

public CounterTerroristsWin( )
{
new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( !is_user_ignored[ i ] )
{
switch( cs_get_user_team( i ) )
{
case( CS_TEAM_T ):
{
if( get_pcvar_num( g_iLostPointsTerrorists ) > 0 )
{
g_szPoints[ i ] -= get_pcvar_num( g_iLostPointsTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (T)^1 have lost^3 %i^1 point%s for losing the round", PREFIX, get_pcvar_num( g_iLostPointsTerrorists ), get_pcvar_num( g_iLostPointsTerrorists ) > 1 ? "s" : "" )
}
}

case( CS_TEAM_CT ):
{
if( get_pcvar_num( g_iWonPointsCounterTerrorists ) > 0 )
{
g_szPoints[ i ] += get_pcvar_num( g_iWonPointsCounterTerrorists )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (CT)^1 have won^3 %i^1 point%s for winning the round", PREFIX, get_pcvar_num( g_iWonPointsCounterTerrorists ), get_pcvar_num( g_iWonPointsCounterTerrorists ) > 1 ? "s" : "" )
}
}
}
}
}
}

public points_all_pugend( id, level, cid )
{
if ( !cmd_access( id, level, cid, 1 ) ) return PLUGIN_HANDLED

new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( !is_user_ignored[ i ] )
{
switch( cs_get_user_team( i ) )
{
case( CS_TEAM_T ):
{
if( get_pcvar_num( g_iPugEnd ) > 0 )
{
g_szPoints[ i ] += get_pcvar_num( g_iPugEnd )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (T)^1 have lost^3 %i^1 point%s for losing the round", PREFIX, get_pcvar_num( g_iLostPointsTerrorists ), get_pcvar_num( g_iLostPointsTerrorists ) > 1 ? "s" : "" )
}
}

case( CS_TEAM_CT ):
{
if( get_pcvar_num( g_iPugEnd ) > 0 )
{
g_szPoints[ i ] += get_pcvar_num( g_iPugEnd )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( i, GREEN, "%s^1 Your team^3 (CT)^1 have won^3 %i^1 point%s for winning the round", PREFIX, get_pcvar_num( g_iWonPointsCounterTerrorists ), get_pcvar_num( g_iWonPointsCounterTerrorists ) > 1 ? "s" : "" )
}
}
}
}
}
SavePointsAtRoundEnd()

return PLUGIN_CONTINUE
}

public bomb_planted( planter )
{
if( !is_user_ignored[ planter ] && get_pcvar_num( g_iWonPointsPlanter ) > 0 )
{
g_szPoints[ planter ] += get_pcvar_num( g_iWonPointsPlanter )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( planter, GREEN, "%s^1 You earned^3 %i^1 point%s for planting the bomb", PREFIX, get_pcvar_num( g_iWonPointsPlanter ), get_pcvar_num( g_iWonPointsPlanter ) > 1 ? "s" : "" )
}
}

public bomb_explode( planter, defuser )
{
if( !is_user_ignored[ planter ] && get_pcvar_num( g_iWonPointsPlanterExplode ) > 0 )
{
g_szPoints_bp[ planter ] += get_pcvar_num( g_iWonPointsPlanterExplode )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( planter, GREEN, "%s^1 You earned^3 %i^1 point%s with the bomb explosion", PREFIX, get_pcvar_num( g_iWonPointsPlanterExplode ), get_pcvar_num( g_iWonPointsPlanterExplode ) > 1 ? "s" : "" )
}
}

public bomb_defused( defuser )
{
if( !is_user_ignored[ defuser ] && get_pcvar_num( g_iWonPointsDefuser ) > 0 )
{
g_szPoints_bd[ defuser ] += get_pcvar_num( g_iWonPointsDefuser )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
ColorChat( defuser, GREEN, "%s^1 You earned^3 %i^1 point%s for disarming the bomb", PREFIX, get_pcvar_num( g_iWonPointsDefuser ), get_pcvar_num( g_iWonPointsDefuser ) > 1 ? "s" : "" )
}
}

public RoundEnd()
{
if( get_pcvar_num( pcvarToggle2 ) > 0 )
{
set_task( 0.5, "SavePointsAtRoundEnd" )
}
}

public SavePointsAtRoundEnd( )
{
new players[ 32 ]
new num
new i

get_players( players, num, "ch" )

for( --num; num >= 0; num-- )
{
i = players[ num ]

if( !is_user_ignored[ i ] )
CheckLevelAndSave( i )
}
}

public CheckLevelAndSave( id )
{
while( g_szPoints[id] >= LEVELS[ g_szLevels[id] ] )

g_szLevels[ id ] += 1
g_szClasses[ id ] += 1

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
{
new szName[ 32 ]
get_user_name( id, szName, charsmax( szName ) )

ColorChat( 0, GREEN, "%s^1 %s increased one level! Level:^3 %s^1 Total points:^3 %d", PREFIX, szName, CLASSES[ g_szLevels[ id ] ], g_szPoints[ id ] )
}


new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "UPDATE %s SET nick = '%s', skillpoints = '%i', level = '%i', pug_k = '%i', pug_d = '%i', pug_a = '%i', pug_bp = '%i', pug_3k = '%i', pug_4k = '%i', pug_5k = '%i', pug_adr = '%i', pug_fpr = '%i', pug_hsp = '%i', pug_rws = '%i' WHERE authid = '%s'",
SQL_TABLE, g_szName[ id ], g_szPoints[id], g_szLevels[id], g_szPoints_k[id], g_szPoints_d[id], g_szPoints_bp[id], g_szPoints_bd[id], g_szPoints_3k[id], g_szPoints_4k[id], g_szPoints_5k[id], g_szPoints_adr[id], g_szPoints_fpr[id], g_szPoints_hsp[id], g_szPoints_rws[id], g_szAuthID[id] )

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )

if( g_szPoints[ id ] >= MAXPONTUATION )
{
if( get_pcvar_num( g_iEnableAnnounceOnChat ) >= 0 )
ColorChat( id, GREEN, "%s^1 You have reached the maximum SkillPoints! Your SkillPoints and level will start again", PREFIX )

g_szPoints[ id ] = 0
g_szLevels[ id ] = 0
g_szClasses[ id ] = 0

CheckLevelAndSave( id )
}
}

public LoadPoints( id )
{
new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level, pug_k, pug_d, pug_a, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_adr, pug_fpr, pug_hsp, pug_rws FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )

SQL_ThreadQuery( g_SqlTuple, "RegisterClient", szTemp, Data, 1 )
}

public RegisterClient( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
if( SQL_IsFail( FailState, Errcode, Error ) )
return PLUGIN_HANDLED_MAIN

new id
id = Data[ 0 ]

if( SQL_NumResults( Query ) < 1 )
{
new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "INSERT INTO %s \
(authid, nick, skillpoints, level, pug_k, pug_d, pug_a, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_adr, pug_fpr, pug_hsp, pug_rws ) \
VALUES( '%s', '%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i' )",
SQL_TABLE, g_szAuthID[id], g_szName[id], g_szPoints[id], g_szLevels[id], g_szPoints_k[id], g_szPoints_d[id], g_szPoints_a[id],g_szPoints_bp[id],
g_szPoints_bd[id], g_szPoints_3k[id], g_szPoints_4k[id], g_szPoints_5k[id], g_szPoints_adr[id], g_szPoints_fpr[id], g_szPoints_hsp[id], g_szPoints_rws[id])

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )
}

else
{
g_szPoints[ id ] = SQL_ReadResult( Query, 0 )
g_szLevels[ id ] = SQL_ReadResult( Query, 1 )
g_szPoints_k[ id ] = SQL_ReadResult( Query, 2 )
g_szPoints_d[ id ] = SQL_ReadResult( Query, 3 )
g_szPoints_a[ id ] = SQL_ReadResult( Query, 4 )
g_szPoints_bp[ id ] = SQL_ReadResult( Query, 5 )
g_szPoints_bd[ id ] = SQL_ReadResult( Query, 6 )
g_szPoints_3k[ id ] = SQL_ReadResult( Query, 7 )
g_szPoints_4k[ id ] = SQL_ReadResult( Query, 8 )
g_szPoints_5k[ id ] = SQL_ReadResult( Query, 9 )
g_szPoints_adr[ id ] = SQL_ReadResult( Query, 10 )
g_szPoints_fpr[ id ] = SQL_ReadResult( Query, 11 )
g_szPoints_hsp[ id ] = SQL_ReadResult( Query, 12 )
g_szPoints_rws[ id ] = SQL_ReadResult( Query, 13 )
}

return PLUGIN_CONTINUE
}

public IgnoreHandle( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
SQL_FreeHandle( Query )
}

public SkillRank( id )
{
if( get_pcvar_num( g_iEnableSkillPointsCmdRank ) == 0 )
ColorChat( id, GREEN, "%s^1 Command disabled", PREFIX )

else if( get_pcvar_num( g_iEnableSkillPointsCmdRank ) > 0 )
{
if( is_user_ignored[ id ] )
{
ColorChat( id, GREEN, "%s^1 Only for Steam accounts ", PREFIX )
return PLUGIN_HANDLED_MAIN
}

new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT COUNT(*) FROM %s WHERE skillpoints >= %i", SQL_TABLE, g_szPoints[ id ] )

SQL_ThreadQuery( g_SqlTuple, "GetSkillRank", szTemp, Data, 1 )
}

if( get_pcvar_num( g_iHideCmds ) == 0 )
return PLUGIN_CONTINUE

else if( get_pcvar_num( g_iHideCmds ) > 0 )
return PLUGIN_HANDLED_MAIN

return PLUGIN_CONTINUE
}

public GetSkillRank( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
if( SQL_IsFail( FailState, Errcode, Error ) )
return PLUGIN_HANDLED_MAIN

new id
id = Data[ 0 ]

g_iRank = SQL_ReadResult( Query, 0 )

if( g_iRank == 0 )
g_iRank = 1

TotalRows( id )

return PLUGIN_CONTINUE
}

public TotalRows( id )
{
new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT COUNT(*) FROM %s", SQL_TABLE )

SQL_ThreadQuery( g_SqlTuple, "GetTotalRows", szTemp, Data, 1 )
}

public GetTotalRows( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
if( SQL_IsFail( FailState, Errcode, Error ) )
return PLUGIN_HANDLED_MAIN

new id
id = Data[ 0 ]

g_iCount = SQL_ReadResult( Query, 0 )

ColorChat( id, GREEN, "%s^1 Your rank is^3 %i^1 of^3 %i^1 players with^3 %i^1 points ", PREFIX, g_iRank, g_iCount, g_szPoints[ id ] )

return PLUGIN_CONTINUE
}

SQL_IsFail( const FailState, const Errcode, const Error[ ] ) {
if( FailState == TQUERY_CONNECT_FAILED )
{
log_amx( "[Error] Could not connect to SQL database: %s", Error )
return true
}

else if( FailState == TQUERY_QUERY_FAILED )
{
log_amx( "[Error] Query failed: %s", Error )
return true
}

else if( Errcode )
{
log_amx( "[Error] Error on query: %s", Error )
return true
}

return false
}

public GetSkillPoints( id )
{
if( get_pcvar_num( g_iEnableSkillPointsCmd ) == 0 )
ColorChat( id, GREEN, "%s^1 Command disabled", PREFIX )

else if( get_pcvar_num( g_iEnableSkillPointsCmd ) > 0 )
{
if( is_user_ignored[ id ] )
{
ColorChat( id, GREEN, "%s^1 Only for Steam accounts ", PREFIX )
return PLUGIN_HANDLED_MAIN
}

if( g_szLevels[ id ] < ( MAXLEVELS - 1 ) )
{
ColorChat( id, GREEN, "%s^1 Total points:^3 %d", PREFIX, g_szPoints[ id ] )
}

else
ColorChat( id, GREEN, "%s^1 Total points:^3 %d", PREFIX, g_szPoints[ id ] )
}

if( get_pcvar_num( g_iHideCmds ) == 0 )
return PLUGIN_CONTINUE

else if( get_pcvar_num( g_iHideCmds ) > 0 )
return PLUGIN_HANDLED_MAIN

return PLUGIN_CONTINUE
}

public AdvertisementCmdMySkill( )
{
for( new m = 1; m <= g_iMaxPlayers; m++ )
{
if( !is_user_ignored[ m ] )
ColorChat( m, GREEN, "%s^1 Write^3 /myskill^1 to see your SkillPoints", PREFIX )
}

set_task( get_pcvar_float( g_TimeBetweenAds ), "AdvertisementCmdRestartSkill" )
}

public AdvertisementCmdRestartSkill( )
{
for( new n = 1; n <= g_iMaxPlayers; n++ )
{
if( !is_user_ignored[ n ] )
ColorChat( n, GREEN, "%s^1 Write^3 /restartskill^1 to restart your SkillPoints and level", PREFIX )
}

set_task( get_pcvar_float( g_TimeBetweenAds ), "AdvertisementCmdRank" )
}

public AdvertisementCmdRank( )
{
for( new o = 1; o <= g_iMaxPlayers; o++ )
{
if( !is_user_ignored[ o ] )
ColorChat( o, GREEN, "%s^1 Write^3 /rankskill^1 to see your rank", PREFIX )
}

set_task( get_pcvar_float( g_TimeBetweenAds ), "AdvertisementCmdMySkill" )
}

public CmdGivePoints( id, level, cid )
{
if ( !cmd_access( id, level, cid, 3 ) )
return PLUGIN_HANDLED

new Arg1[ 32 ]
new Arg2[ 6 ]

read_argv( 1, Arg1, charsmax( Arg1 ) )
read_argv( 2, Arg2, charsmax( Arg2 ) )

new iPoints = str_to_num( Arg2 )

new iPlayer = cmd_target( id, Arg1, 1 )

if ( !iPlayer )
{
console_print( id, "Sorry, player %s could not be found or targetted!", Arg1 )
return PLUGIN_HANDLED
}

else if( iPoints > 0 )
{
g_szPoints[ iPlayer ] += iPoints
CheckLevelAndSave( iPlayer )

new szAdminName[ 32 ]
get_user_name( id, szAdminName, charsmax( szAdminName ) )

new szPlayerName[ 32 ]
get_user_name( iPlayer, szPlayerName, charsmax( szPlayerName ) )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0)
ColorChat( 0, GREEN, "%s^1 %s gave^3 %i^1 SkillPoint%s to %s", PREFIX, szAdminName, iPoints, iPoints > 1 ? "s" : "", szPlayerName )
}

return PLUGIN_HANDLED
}

public CmdTakePoints( id, level, cid )
{
if ( !cmd_access( id, level, cid, 3 ) )
return PLUGIN_HANDLED

new Arg1[ 32 ]
new Arg2[ 6 ]

read_argv( 1, Arg1, charsmax( Arg1 ) )
read_argv( 2, Arg2, charsmax( Arg2 ) )

new iPoints = str_to_num( Arg2 )

new iPlayer = cmd_target( id, Arg1, 1 )

if ( !iPlayer )
{
console_print( id, "Sorry, player %s could not be found or targetted!", Arg1 )
return PLUGIN_HANDLED
}

else if( iPoints > 0 )
{
g_szPoints[ iPlayer ] -= iPoints
CheckLevelAndSave( iPlayer )

new szAdminName[ 32 ]
get_user_name( id, szAdminName, charsmax( szAdminName ) )

new szPlayerName[ 32 ]
get_user_name( iPlayer, szPlayerName, charsmax( szPlayerName ) )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0)
ColorChat( 0, GREEN, "%s^1 %s take^3 %i^1 SkillPoint%s from %s", PREFIX, szAdminName, iPoints, iPoints > 1 ? "s" : "", szPlayerName )
}

return PLUGIN_HANDLED
}

public FwdPlayerSpawnPost( id )
{
if( is_user_ignored[ id ] || !is_user_alive( id ) )
return HAM_SUPERCEDE

if( get_pcvar_num( g_iEnableShowSkillPointsOnNick ) > 0 )
{
new szName[ 32 ]
get_user_info( id, "name", szName, charsmax( szName ) )

new iLen = strlen( szName )

new iPos = iLen - 1

if( szName[ iPos ] == '>' )
{
for( new i = 1; i < 7; i++)
{
if( szName[ iPos - i ] == '<' )
{
iLen = iPos - i
szName[ iLen ] = '^0'
break
}
}
}

format( szName[ iLen ], charsmax( szName ) - iLen, szName[ iLen-1 ] == ' ' ? "<%d>" : " <%d>", g_szPoints[ id ] )
set_user_info( id, "name", szName )
}

return HAM_IGNORED
}

public MessageSayText( iMsgID, iDest, iReceiver )
{
if( get_pcvar_num( g_iHideChangeNickNotification ) > 0 )
{
new const Cstrike_Name_Change[ ] = "#Cstrike_Name_Change"

new szMessage[ sizeof( Cstrike_Name_Change ) + 1 ]
get_msg_arg_string( 2, szMessage, charsmax( szMessage ) )

return equal( szMessage, Cstrike_Name_Change ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE
}

return PLUGIN_CONTINUE
}

/////////////////////////////////////
// ColorChat Stuff by ConnorMcLeod //
/////////////////////////////////////

stock client_print_color(id, iColor=DontChange, const szMsg[], any:...)
{
// check if id is different from 0
if( id && !is_user_connected(id) )
{
return 0;
}

if( iColor > Grey )
{
iColor = DontChange;
}

new szMessage[192];
if( iColor == DontChange )
{
szMessage[0] = 0x04;
}
else
{
szMessage[0] = 0x03;
}

new iParams = numargs();
// Specific player code
if(id)
{
if( iParams == 3 )
{
copy(szMessage[1], charsmax(szMessage)-1, szMsg);
}
else
{
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);
}

if( iColor )
{
new szTeam[11]; // store current team so we can restore it
get_user_team(id, szTeam, charsmax(szTeam));

// set id TeamInfo in consequence
// so SayText msg gonna show the right color
Send_TeamInfo(id, id, g_szTeamName[iColor]);

// Send the message
Send_SayText(id, id, szMessage);

// restore TeamInfo
Send_TeamInfo(id, id, szTeam);
}
else
{
Send_SayText(id, id, szMessage);
}
}

// Send message to all players
else
{
// Figure out if at least 1 player is connected
// so we don't send useless message if not
// and we gonna use that player as team reference (aka SayText message sender) for color change
new iPlayers[32], iNum;
get_players(iPlayers, iNum, "ch");
if( !iNum )
{
return 0;
}

new iFool = iPlayers[0];

new iMlNumber, i, j;
new Array:aStoreML = ArrayCreate();
if( iParams >= 5 ) // ML can be used
{
for(j=4; j<iParams; j++)
{
// retrieve original param value and check if it's LANG_PLAYER value
if( getarg(j) == LANG_PLAYER )
{
i=0;
// as LANG_PLAYER == -1, check if next parm string is a registered language translation
while( ( szMessage[ i ] = getarg( j + 1, i++ ) ) ) {}
if( GetLangTransKey(szMessage) != TransKey_Bad )
{
// Store that arg as LANG_PLAYER so we can alter it later
ArrayPushCell(aStoreML, j++);

// Update ML array saire so we'll know 1st if ML is used,
// 2nd how many args we have to alterate
iMlNumber++;
}
}
}
}

// If arraysize == 0, ML is not used
// we can only send 1 MSG_BROADCAST message
if( !iMlNumber )
{
if( iParams == 3 )
{
copy(szMessage[1], charsmax(szMessage)-1, szMsg);
}
else
{
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);
}

if( iColor )
{
new szTeam[11];
get_user_team(iFool, szTeam, charsmax(szTeam));
Send_TeamInfo(0, iFool, g_szTeamName[iColor]);
Send_SayText(0, iFool, szMessage);
Send_TeamInfo(0, iFool, szTeam);
}
else
{
Send_SayText(0, iFool, szMessage);
}
}

// ML is used, we need to loop through all players,
// format text and send a MSG_ONE_UNRELIABLE SayText message
else
{
new szTeam[11], szFakeTeam[10];

if( iColor )
{
get_user_team(iFool, szTeam, charsmax(szTeam));
copy(szFakeTeam, charsmax(szFakeTeam), g_szTeamName[iColor]);
}

for( i = 0; i < iNum; i++ )
{
id = iPlayers[i];

for(j=0; j<iMlNumber; j++)
{
// Set all LANG_PLAYER args to player index ( = id )
// so we can format the text for that specific player
setarg(ArrayGetCell(aStoreML, j), _, id);
}

// format string for specific player
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);

if( iColor )
{
Send_TeamInfo(id, iFool, szFakeTeam);
Send_SayText(id, iFool, szMessage);
Send_TeamInfo(id, iFool, szTeam);
}
else
{
Send_SayText(id, iFool, szMessage);
}
}
ArrayDestroy(aStoreML);
}
}
return 1;
}

stock Send_TeamInfo(iReceiver, iPlayerId, szTeam[])
{
static iTeamInfo = 0;
if( !iTeamInfo )
{
iTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player=iReceiver);
write_byte(iPlayerId);
write_string(szTeam);
message_end();
}

stock Send_SayText(iReceiver, iPlayerId, szMessage[])
{
static iSayText = 0;
if( !iSayText )
{
iSayText = get_user_msgid("SayText");
}
message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player=iReceiver);
write_byte(iPlayerId);
write_string(szMessage);
message_end();
}

public showtimer(id,number[10],onoff)
{
if (is_user_connected(id))
{
if (id == top && onoff == 1)
onoff = 2
message_begin( MSG_ONE, gmsgStatusIcon, {0,0,0}, id )
write_byte( onoff ) // status
write_string( number ) // sprite name
write_byte( 0 ) // red
write_byte( 0 ) // green
write_byte( 0 ) // blue
message_end()
}
}

public cmd_playerspawn(id)
{
pfrags[id]=0
top = 0
calculate_time(id,pfrags[id])
}

public cmd_death()
{
new killer = read_data(1)
pfrags[killer]=pfrags[killer]+1

topplayer()
new players[32]
new player_num
get_players(players, player_num)
for (new i = 0; i < player_num; i++)
calculate_time(players[i],pfrags[players[i]])
return PLUGIN_CONTINUE
}

public topplayer()
{
new score
new players[32]
new player_num
get_players(players, player_num)
for (new i = 0; i < player_num; i++)
{
if (pfrags[players[i]]>score)
{
score=pfrags[players[i]]
top=players[i]
}
else if (pfrags[players[i]]==score)
top = 0
}
}

public calculate_time(id,num)
{
switch(num)
{
case 0:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 1:
{
showtimer(id,"number_1",1)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 2:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",1)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 3:
{
g_szPoints_3k[ id ] += get_pcvar_num( g_iszPoints_3k )
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",1)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 4:
{
g_szPoints_3k[ id ] -= get_pcvar_num( g_iszPoints_3k )
g_szPoints_4k[ id ] += get_pcvar_num( g_iszPoints_4k )
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",1)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 5:
{
g_szPoints_4k[ id ] -= get_pcvar_num( g_iszPoints_4k )
g_szPoints_5k[ id ] += get_pcvar_num( g_iszPoints_5k )
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",1)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 6:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",1)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 7:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",1)
showtimer(id,"number_8",0)
showtimer(id,"number_9",0)
}
case 8:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",1)
showtimer(id,"number_9",0)
}
case 9:
{
showtimer(id,"number_1",0)
showtimer(id,"number_2",0)
showtimer(id,"number_3",0)
showtimer(id,"number_4",0)
showtimer(id,"number_5",0)
showtimer(id,"number_6",0)
showtimer(id,"number_7",0)
showtimer(id,"number_8",0)
showtimer(id,"number_9",1)
}
}
}

/////////////////////////////////////

xakintosh
11-05-2012, 03:49
Very good plugin.
One question is it goona to be released full version: http://i.imgur.com/WBbui.jpg

guipatinador
11-05-2012, 06:04
Very good plugin.
One question is it goona to be released full version: http://i.imgur.com/WBbui.jpg

That version have one strange bug. Sometimes, the skillpoints of some players are reseted to zero. I don't know if the problem come frome the plugin or from the connection between my server and my web host.
I will try to fix that.
Next version comes in December (I don't have time now)
I will implement minimum players and the colorchat code will be replaced with this -> https://forums.alliedmods.net/showpost.php?p=1638412&postcount=6

@ kwpd
add the debug and show the error

kwpd
11-05-2012, 06:21
That version have one strange bug. Sometimes, the skillpoints of some players are reseted to zero. I don't know if the problem come frome the plugin or from the connection between my server and my web host.
I will try to fix that.
Next version comes in December (I don't have time now)
I will implement minimum players and the colorchat code will be replaced with this -> https://forums.alliedmods.net/showpost.php?p=1638412&postcount=6

@ kwpd
add the debug and show the error

core causing the reset 0. This is because code

set_task(0.1, "SqlInit")public LoadPoints( id )
{
new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )

SQL_ThreadQuery( g_SqlTuple, "RegisterClient", szTemp, Data, 1 )
}if you write in this manner

SqlInit()public LoadPoints( id )
{
new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level, pug_k, pug_d, pug_a, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_adr, pug_fpr, pug_hsp, pug_rws FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )

SQL_ThreadQuery( g_SqlTuple, "RegisterClient", szTemp, Data, 1 )
}error and was corrected. amx_debug 2

kwpd
11-16-2012, 17:06
which would be better?

if( killer == victim )
{
g_szPoints_d[ killer ] += get_pcvar_num( g_iLostPointsSuicide )
g_szPoints_rws[ killer ] -= get_pcvar_num( g_iLostPointsSuicide_Rws )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsSuicide ) > 0 )
ColorChat( killer, GREEN, "%s^1 You have lost^3 %i^1 point%s for committing suicide", PREFIX, get_pcvar_num( g_iLostPointsSuicide ), get_pcvar_num( g_iLostPointsSuicide ) > 1 ? "s" : "" )
}OR
if( killer == victim )
{
g_szPoints_d[ killer ] += get_pcvar_num( g_iLostPointsSuicide )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsSuicide ) > 0 )
ColorChat( killer, GREEN, "%s^1 You have lost^3 %i^1 point%s for committing suicide", PREFIX, get_pcvar_num( g_iLostPointsSuicide ), get_pcvar_num( g_iLostPointsSuicide ) > 1 ? "s" : "" )
}

if( killer == victim )
{
g_szPoints_rws[ killer ] -= get_pcvar_num( g_iLostPointsSuicide_Rws )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 && get_pcvar_num( g_iLostPointsSuicide ) > 0 )
ColorChat( killer, GREEN, "%s^1 You have lost^3 %i^1 point%s for committing suicide", PREFIX, get_pcvar_num( g_iLostPointsSuicide ), get_pcvar_num( g_iLostPointsSuicide ) > 1 ? "s" : "" )
}

guipatinador
11-17-2012, 06:33
The first one seems better.



g_szPoints_d[ killer ] += get_pcvar_num( g_iLostPointsSuicide )



This makes no sense.

dieeho
11-22-2012, 14:15
hello @guipatinador can you help me? that gives me this error log? any help?


L 11/22/2012 - 13:29:50: [BasicSkillPointsSQL.amxx] [Error] Query failed: Unknown column 'p_kill' in 'field list'
Can't use keys or values with a "

kwpd
11-23-2012, 14:48
how we can help if your modification does not show ...
I guess we're not.

My amendment is almost finished.
[#] [Players] [KILL] [DEATHS] [HS] [KNIFE] [GRENADE] [BP] [BD] [3K] [4K] [5K] [WON ROUND][RWS][POINTS] [KARMA][ADR] [FPR]

READY
MODIFICATION & BUG
UNDER CONSTRUCTION

dieeho
11-23-2012, 15:36
how we can help if your modification does not show ...
I guess we're not.

mi modificacion esta casi terminado.

[#] [Players] [KILL] [DEATHS] [HS] [KNIFE] [GRENADE] [BP] [BD] [3K] [4K] [5K] [WON ROUND] [RWS] [POINTS] [KARMA] [ADR] [FPR]

This is the error log gives me:
este es el error de log que me da:

L 11/22/2012 - 13:29:50: [BasicSkillPointsSQL.amxx] [Error] Query failed: Unknown column 'p_kill' in 'field list'
Can't use keys or values with a "


ok here I show my modification can help me about the problem?

@kwpd aqui te muestro el code de mi modificacion, que tengo mal? me puedes ayudar??

public SqlInit( )
{
new szHost[ 32 ]
new szUser[ 32 ]
new szPass[ 32 ]
new szDB[ 32 ]

get_pcvar_string( g_pcvarHost, szHost, charsmax( szHost ) )
get_pcvar_string( g_pcvaruUser, szUser, charsmax( szUser ) )
get_pcvar_string( g_pcvarPass, szPass, charsmax( szPass ) )
get_pcvar_string( g_pcvarDB, szDB, charsmax( szDB ) )

g_SqlTuple = SQL_MakeDbTuple( szHost, szUser, szPass, szDB )

new ErrorCode
new Handle:SqlConnection = SQL_Connect( g_SqlTuple, ErrorCode, g_Error, charsmax( g_Error ) )

if( SqlConnection == Empty_Handle )
set_fail_state( g_Error )

new Handle:Queries
Queries = SQL_PrepareQuery( SqlConnection, "CREATE TABLE IF NOT EXISTS %s ( authid VARCHAR( 32 ) \
PRIMARY KEY, nick VARCHAR( 32 ), skillpoints INT( 7 ), level INT( 2 ), p_kill INT( 7 ), pug_a INT( 7 ), pug_d INT( 7 ), pug_bp INT( 7 ), pug_bd INT( 7 ), pug_3k INT( 7 ), \
pug_4k INT( 7 ), pug_5k INT( 7 ), pug_hsp INT( 7 ), pug_w INT( 7 ), pug_dw INT( 7 ), pug_l INT( 7 ), pug_leaves INT( 7 ), round_w INT( 7 ), round_l INT( 7 ), round_p INT( 7 ), damage INT( 7 ) )", SQL_TABLE )

if( !SQL_Execute( Queries ) )
{
SQL_QueryError( Queries, g_Error, charsmax( g_Error ) )
set_fail_state( g_Error )
}

SQL_FreeHandle( Queries )
SQL_FreeHandle( SqlConnection )
}


public client_authorized( id )
{
get_user_authid( id , g_szAuthID[ id ], charsmax( g_szAuthID[ ] ) )
get_user_name( id, g_szName[ id ], charsmax( g_szName[ ] ) )

replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )

if( TrieKeyExists( IgnoredAuthID, g_szAuthID[ id ] ) )
is_user_ignored[ id ] = true

else
is_user_ignored[ id ] = false

if( is_user_ignored[ id ] )
return PLUGIN_HANDLED_MAIN

g_szPoints[ id ] = 0
g_szLevels[ id ] = 0
g_szClasses[ id ] = 0
g_szPkill[ id ] = 0
g_szPassist[ id ] = 0
g_szPdeath[ id ] = 0
g_szBp[ id ] = 0
g_szBd[ id ] = 0
g_szP3k[ id ] = 0
g_szP4k[ id ] = 0
g_szP5k[ id ] = 0
g_szPhsp[ id ] = 0
g_szPwins[ id ] = 0
g_szPdraw[ id ] = 0
g_szPloses[ id ] = 0
g_szPleaves[ id ] = 0
g_szRw[ id ] = 0
g_szRl[ id ] = 0
g_szRp[ id ] = 0
g_szDamage[ id ] = 0

LoadPoints( id )

if( get_pcvar_num( g_iEnableWonPointsHour ) > 0 && get_pcvar_num( g_iWonPointsHour ) > 0 )
set_task( 3600.0, "GiveSkillPointsHour", id, _, _, "b" )

return PLUGIN_CONTINUE
}

public CheckLevelAndSave( id )
{
while( g_szPoints[ id ] >= LEVELS[ g_szLevels[ id ] ] )
{
g_szLevels[ id ] += 1
g_szClasses[ id ] += 1

if( get_pcvar_num( g_iEnableAnnounceOnChat ) > 0 )
{
new szName[ 32 ]
get_user_name( id, szName, charsmax( szName ) )

ColorChat( 0, GREEN, "%s^1 %s increased one level! Level:^3 %s^1 Total points:^3 %d", PREFIX, szName, CLASSES[ g_szLevels[ id ] ], g_szPoints[ id ] )
}
}

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "UPDATE %s SET nick = '%s', skillpoints = '%i', level = '%i', p_kill = '%i', pug_a = '%i', pug_d = '%i', pug_bp = '%i', pug_bd = '%i', pug_3k = '%i', pug_4k = '%i', pug_5k = '%i', pug_hsp = '%i', pug_w = '%i', \
pug_dw = '%i', pug_l = '%i', pug_leaves = '%i', round_w = '%i', round_l = '%i', round_p = '%i', damage = '%i' WHERE authid = '%s'",
SQL_TABLE, g_szName[ id ], g_szPoints[ id ], g_szLevels[ id ], g_szPkill[ id ], g_szPassist[ id ], g_szPdeath[ id ], g_szBp[ id ], g_szBd[ id ], g_szP3k[ id ], g_szP4k[ id ], g_szP5k[ id ], g_szPhsp[ id ], g_szPwins[ id ], g_szPdraw[ id ], g_szPloses[ id ],
g_szPleaves[ id ], g_szRw[ id ], g_szRl[ id ], g_szRp[ id ], g_szDamage[ id ], g_szAuthID[ id ] )

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )

if( g_szPoints[ id ] >= MAXPONTUATION )
{
if( get_pcvar_num( g_iEnableAnnounceOnChat ) >= 0 )
ColorChat( id, GREEN, "%s^1 You have reached the maximum SkillPoints! Your SkillPoints and level will start again", PREFIX )

g_szPoints[ id ] = 0
g_szLevels[ id ] = 0
g_szClasses[ id ] = 0

CheckLevelAndSave( id )
}
}

public LoadPoints( id )
{
new Data[ 1 ]
Data[ 0 ] = id

new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level, p_kill, pug_a, pug_d, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_hsp, pug_w, pug_dw, pug_l, pug_leaves, round_w, round_l, round_p, damage FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )

SQL_ThreadQuery( g_SqlTuple, "RegisterClient", szTemp, Data, 1 )
}

public RegisterClient( FailState, Handle:Query, Error[ ], Errcode, Data[ ], DataSize )
{
if( SQL_IsFail( FailState, Errcode, Error ) )
return PLUGIN_HANDLED_MAIN

new id
id = Data[ 0 ]

if( SQL_NumResults( Query ) < 1 )
{
new szTemp[ 512 ]
format( szTemp, charsmax( szTemp ), "INSERT INTO %s ( authid, nick, skillpoints, level, p_kill, pug_a, pug_d, pug_bp, pug_bd, pug_3k, pug_4k, pug_5k, pug_hsp, pug_w, pug_dw, pug_l, pug_leaves, round_w, round_l, round_p, damage ) VALUES \
( '%s', '%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i' )",
SQL_TABLE, g_szAuthID[ id ], g_szName[ id ], g_szPoints[ id ], g_szLevels[ id ], g_szPkill[ id ], g_szPassist[ id ], g_szPdeath[ id ], g_szBp[ id ], g_szBd[ id ], g_szP3k[ id ], g_szP4k[ id ], g_szP5k[ id ],
g_szPhsp[ id ], g_szPwins[ id ], g_szPdraw[ id ], g_szPloses[ id ], g_szPleaves[ id ], g_szRw[ id ], g_szRl[ id ], g_szRp[ id ], g_szDamage[ id ] )

SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )
}

else
{
g_szPoints[ id ] = SQL_ReadResult( Query, 0 )
g_szLevels[ id ] = SQL_ReadResult( Query, 1 )
g_szPkill[ id ] = SQL_ReadResult( Query, 2 )
g_szPassist[ id ] = SQL_ReadResult( Query, 3 )
g_szPdeath[ id ] = SQL_ReadResult( Query, 4 )
g_szBp[ id ] = SQL_ReadResult( Query, 5 )
g_szBd[ id ] = SQL_ReadResult( Query, 6 )
g_szP3k[ id ] = SQL_ReadResult( Query, 7 )
g_szP4k[ id ] = SQL_ReadResult( Query, 8 )
g_szP5k[ id ] = SQL_ReadResult( Query, 9 )
g_szPhsp[ id ] = SQL_ReadResult( Query, 10 )
g_szPwins[ id ] = SQL_ReadResult( Query, 11 )
g_szPdraw[ id ] = SQL_ReadResult( Query, 12 )
g_szPloses[ id ] = SQL_ReadResult( Query, 13 )
g_szPleaves[ id ] = SQL_ReadResult( Query, 14 )
g_szRw[ id ] = SQL_ReadResult( Query, 15 )
g_szRl[ id ] = SQL_ReadResult( Query, 16 )
g_szRp[ id ] = SQL_ReadResult( Query, 17 )
g_szDamage[ id ] = SQL_ReadResult( Query, 18 )
}

return PLUGIN_CONTINUE
}

kwpd
11-23-2012, 15:41
ok here I show my modification can help me about the problem?

@kwpd aqui te muestro el code me puedes ayudar?

I just remembered there is a small error in writing. of "" pug_k ""
give me a couple of hours to upload the file almost full .. . sma and. php

ahora que me acuerdo hay un pequeño error en la escritura. de ""pug_k""
dame un par de hora para subir el archivo casi full.. .sma y .php
My amendment is almost finished.
[#] [Players] [KILL] [DEATHS] [HS] [KNIFE] [GRENADE] [BP] [BD] [3K] [4K] [5K] [WON ROUND][RWS][POINTS] [KARMA][ADR] [FPR]

READY
MODIFICATION & BUG
UNDER CONSTRUCTION

YamiKaitou
11-23-2012, 15:42
English Only

dieeho
11-23-2012, 15:50
I just remembered there is a small error in writing. of "" pug_k ""
give me a couple of hours to upload the file almost full .. . sma and. php

ahora que me acuerdo hay un pequeño error en la escritura. de ""pug_k""
dame un par de hora para subir el archivo casi full.. .sma y .php
My amendment is almost finished.
[#] [Players] [KILL] [DEATHS] [HS] [KNIFE] [GRENADE] [BP] [BD] [3K] [4K] [5K] [WON ROUND][RWS][POINTS] [KARMA][ADR] [FPR]

READY
MODIFICATION & BUG
UNDER CONSTRUCTION

ok I hope I'll watch! but if I can go through PM is better!

ok yo espero estaré pendiente! pero si me lo puedes pasar por PM es mejor!,

guipatinador
11-24-2012, 09:47
That is not my plugin so I will not support it.

kwpd
11-24-2012, 20:30
not support it. T-T

dieeho
11-24-2012, 20:42
not support it. T-T

can you help me? @ kwpd

rak
12-30-2012, 19:04
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )
Is this ok?
yes but no; you can do this

example:

your code
format( szTemp, charsmax( szTemp ), "SELECT skillpoints, level FROM %s WHERE authid = '%s'", SQL_TABLE, g_szAuthID[ id ] )
fix code
formatex( szTemp, charsmax( szTemp ), "SELECT skillpoints, level FROM %s WHERE authid = ^"%s^"", SQL_TABLE, g_szAuthID[ id ] )
and this way you don't need replace nothing

hdM
02-19-2013, 04:54
Hi Gui.

Tell me one thing, the plugin is saving data to BD in kills and deads? add on steam helder_17 we speak there;)
How do I point limited to 0, no negative values

Abraço
hdM

guipatinador
02-19-2013, 05:48
All right, I have sent you an invite.

guipatinador
02-23-2013, 07:28
v1.1.9 is out.

I did a lot of modifications in both versions, but I want to highlight this,
- FVault instead of nVault
- Top15 (both versions) http://i.imgur.com/gdKbvoG.png
- rank (also to both versions)
- ace (5 kills) and almost (4 kills)

12114
03-10-2013, 10:19
ty for plugin, but this plugin would be awesome if u could view the top players on a website, if you use the sql version. something reallllyy basic, like a chart or something. not asking for hlstatsX style or anything lol.

Also, can you add a cvar so it can save by name?

guipatinador
03-27-2013, 20:47
I have released a Special Edition (v2.0.0).
http://i.imgur.com/Q5P4PPa.jpg

Changelog:

v2.0.0 (28/03/2013) FVault & SQL SPECIAL EDITION
- Inclusion of Kills, Deaths, HeadShots, Knife Kills / Deaths, Grenade Kills / Deaths, Bomb Explosions, Defused Bombs and Won Rounds
- Top15 restructured (JumpStats style)
I will not support old versions.
If you want the old version (v1.2.0), PM me.

kwpd
03-28-2013, 03:46
+karma :up:

Jamesas007
05-30-2013, 03:56
hi all :) i have error in this plugin, i try change map but skill plugint dont work ....
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Plugin ("BasicSkillPointsSQL_SE.amxx") is setting itself as failed.
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Plugin says: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL_SE.amxx") - forced exit

and in web error
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/mixstats/index.php on line 35 Warning: Invalid argument supplied for foreach() in /var/www/mixstats/index.php on line 72

YamiKaitou
05-30-2013, 04:31
hi all :) i have error in this plugin, i try change map but skill plugint dont work ....
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Plugin ("BasicSkillPointsSQL_SE.amxx") is setting itself as failed.
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Plugin says: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
10:38:16 L 05/30/2013 - 10:38:18: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL_SE.amxx") - forced exit

Use the IP address for your SQL Database instead of the DNS name.

piepie
05-30-2013, 06:05
Can you tell me how it works with headshot and normal kill? When you kill and hit in head you'll get killpoints + headshot points?

Jamesas007
05-30-2013, 06:15
http://oi44.tinypic.com/111p6c2.jpg
web is loading but with error, and with plugin something bad

guipatinador
05-30-2013, 06:40
That error is normal because you don't have players in the database.
Plugin works fine here. Try to restart server and change your map.

Can you tell me how it works with headshot and normal kill? When you kill and hit in head you'll get killpoints + headshot points?

No. It will count headshot points.

Jamesas007
05-30-2013, 06:55
That error is normal because you don't have players in the database.
Plugin works fine here. Try to restart server and change your map.

2min ago i tested again with players, and plugin not working, Nvault work perfect but with mysql php something wrong here ..

pepe_thugs
06-01-2013, 08:25
2min ago i tested again with players, and plugin not working, Nvault work perfect but with mysql php something wrong here ..

The plugin works perfectly. You have this cvars correct ??


bps_sql_host "" // Host (SQL ONLY)
bps_sql_user "" / Username of the database (SQL ONLY)
bps_sql_pass "" // Password of the database (SQL ONLY)
bps_sql_db "" // Name of the database (SQL ONLY)and in index.php


$sql_ip = "localhost";
$sql_user = "mysql_user";
$sql_password = "mysql_password";
$sql_database = "database_name";

And you have the module mysql activate in the server ??

piepie
06-06-2013, 16:23
Can you make like if you are level 5 you'll only get 0.6 of the total skillpoints earned. So when you level up , is more difficult to level up again , only for leet players.

gamestar110
06-11-2013, 02:57
nice plugin

quark
06-11-2013, 06:38
nice plugin
nice comment

kwpd
06-24-2013, 17:10
:shock: Bug.!

http://i.imgur.com/ZXvFX6F.png

FIX plz

public RestartSkillPoints( id )
{
if( !get_pcvar_num( g_iEnableSkillPointsRestart ) )
{
ClientPrintColor( id, "!g%s!n Command disabled", PREFIX )
}

else
{
if( CheckUserIgnored( id ) )
{
ClientPrintColor( id, "!g%s!n Only for Steam accounts", PREFIX )
return PLUGIN_HANDLED_MAIN
}

g_iPoints[ id ] = 0
g_iLevels[ id ] = 0
g_iClasses[ id ] = 0

g_iKills[ id ] = 0
g_iDeaths[ id ] = 0
g_iHeadShots[ id ] = 0
g_iKnifeKills[ id ] = 0
g_iKnifeDeaths[ id ] = 0
g_iGrenadeKills[ id ] = 0
g_iGrenadeDeaths[ id ] = 0
g_iBombExplosions[ id ] = 0
g_iDefusedBombs[ id ] = 0
g_iWonRounds[ id ] = 0

CheckLevelAndSave( id )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) )
{
ClientPrintColor( id, "!g%s!n Your SkillPoints and level will start again", PREFIX )
}
}

return ( get_pcvar_num( g_iHideCmds ) == 0 ) ? PLUGIN_CONTINUE : PLUGIN_HANDLED_MAIN
}----->

public RestartSkillPoints( id )
{
if( !get_pcvar_num( g_iEnableSkillPointsRestart ) )
{
ClientPrintColor( id, "!g%s!n Command disabled", PREFIX )
}

else
{
if( CheckUserIgnored( id ) )
{
ClientPrintColor( id, "!g%s!n Only for Steam accounts", PREFIX )
return PLUGIN_HANDLED_MAIN
}

get_user_authid( id , g_szAuthID[ id ], charsmax( g_szAuthID[ ] ) )
get_user_info( id, "name", g_szName[ id ], charsmax( g_szName[ ] ) )

replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )

g_iPoints[ id ] = 0
g_iLevels[ id ] = 0
g_iClasses[ id ] = 0

g_iKills[ id ] = 0
g_iDeaths[ id ] = 0
g_iHeadShots[ id ] = 0
g_iKnifeKills[ id ] = 0
g_iKnifeDeaths[ id ] = 0
g_iGrenadeKills[ id ] = 0
g_iGrenadeDeaths[ id ] = 0
g_iBombExplosions[ id ] = 0
g_iDefusedBombs[ id ] = 0
g_iWonRounds[ id ] = 0

CheckLevelAndSave( id )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) )
{
ClientPrintColor( id, "!g%s!n Your SkillPoints and level will start again", PREFIX )
}
}

return ( get_pcvar_num( g_iHideCmds ) == 0 ) ? PLUGIN_CONTINUE : PLUGIN_HANDLED_MAIN
}

guipatinador
06-25-2013, 05:57
Thanks for the report. I don't know if that will solve the problem. Did you test it?

kwpd
06-25-2013, 13:30
Thanks for the report. I don't know if that will solve the problem. Did you test it?

yeah .. and tested already.
FIX Bug
round end <----- "name" AP' #jejejeje

replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "'", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "^"", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "`", "*" )
replace_all( g_szName[ id ], charsmax( g_szName[ ] ), "´", "*" )en la linea ----------> public CheckLevelAndSave( id )hasta hora funciona bastante bien....

jonnzus
07-01-2013, 09:00
Suggest: add lastseen column which is updated to unix timestamp when player connects.

kwpd
07-02-2013, 14:07
Fijate la version 1.2.8.... asi se guarda todo informacion del usuario...

look at the version 1.2.8 .... so you save all user information ...
http://forums.alliedmods.net/showthread.php?t=201742
version 1.2.8
* Cambios set_task( 1.0, "SavePointsAtRoundEnd") -> SavePointsAtRoundEnd()
* Cambios CheckLevelAndSave1(i) -> set_task( 0.7, "CheckLevelAndSave1" )
* Cambios CheckLevelAndSave2(i) -> set_task( 0.8, "CheckLevelAndSave2" )
* Cambios CheckLevelAndSave3(i) -> set_task( 0.9, "CheckLevelAndSave3" )
* Cambios CheckLevelAndSave4(i) -> set_task( 1.0, "CheckLevelAndSave4" )

jonnzus
07-02-2013, 14:12
English version please :3

kwpd
07-02-2013, 15:00
English version please :3
look at the version 1.2.8 .... so you save all user information ...
http://forums.alliedmods.net/showthread.php?t=201742
version 1.2.8
* Cambios set_task( 1.0, "SavePointsAtRoundEnd") -> SavePointsAtRoundEnd()
* Cambios CheckLevelAndSave1(i) -> set_task( 0.7, "CheckLevelAndSave1" )
* Cambios CheckLevelAndSave2(i) -> set_task( 0.8, "CheckLevelAndSave2" )
* Cambios CheckLevelAndSave3(i) -> set_task( 0.9, "CheckLevelAndSave3" )
* Cambios CheckLevelAndSave4(i) -> set_task( 1.0, "CheckLevelAndSave4" )

YamiKaitou
07-02-2013, 15:20
https://translate.google.com/?hl=es&tab=TT#es/en/

https://forums.alliedmods.net/misc.php?do=showrules
This is an English forum (other than a few specific, labeled subforums). If you're going to post in another language, also add the text in English, even if from online translator.

jonnzus
07-03-2013, 11:42
I guess this logs kills with headshot, not every headshot (even if not killed by it)?

joliveira
07-03-2013, 17:03
Hello, Guipatinador, how are u?
I think this plugin is very cool and after update amx mod and having scripting problems, I solve them, but I still having a problem...
The plugin is not working on BOT/PodBot.
My AMXMODX is 1.8.2, so it's fine... Nobody saids that on replies so I think nobody have the same problem than me :|
I don't have a server, is that the problem?

P.S. Im NON-Steam... the plugin is working, just is not compatible w/ bots...

P.S.2 : Sim, sou portugues... :| CRIEI UMA CONTA SO PARA PERGUNTAR ISTO POR FAVOR RESPONDE;

Add:

Twitter/Skype: @djjotaremix

guipatinador
07-03-2013, 17:13
The plugin is not working on BOT/PodBot.

Remove this line,


TrieSetCell( g_tIgnoredAuthID, "BOT", 1 )

joliveira
07-04-2013, 03:57
Remove this line,


TrieSetCell( g_tIgnoredAuthID, "BOT", 1 )


Thank you!!! It realy works :)
F.C.P. RULEZZZ :P

jonnzus
07-05-2013, 12:00
There is bug, sometimes user's rank restarts without any reason (in sql version). Two player said that their all static were gone.

sandro
07-10-2013, 20:13
nice

ramioca
02-19-2014, 15:08
i will give you a few sugestions that i remember :)
-for sql version why you dont add the time that a player spend in the sv to won the skilpoints?
-creat a cvar to decide when you save the points and for changing in name, for exemple change name just in -player connect and save the points just in the map end
-add a racio kill/death in table.
-add hs %

like i said, its just a few ideias :)
sory for my english too :b

Cumpz

skype321
04-06-2014, 11:33
Serious bug
PF_MessageEnd_I: Refusing to send user message SayText of 231 bytes to client, user message size limit is 192 bytes fix this it shuts down the server

guipatinador
04-06-2014, 13:07
i will give you a few sugestions that i remember :)
-for sql version why you dont add the time that a player spend in the sv to won the skilpoints?
-creat a cvar to decide when you save the points and for changing in name, for exemple change name just in -player connect and save the points just in the map end
-add a racio kill/death in table.
-add hs %

like i said, its just a few ideias :)
sory for my english too :b

Cumpz

That's not in my plans. I'm not working anymore in this plugin. My work is done here :)

Serious bug
PF_MessageEnd_I: Refusing to send user message SayText of 231 bytes to client, user message size limit is 192 bytes fix this it shuts down the server

Are you sure the problem is from this plugin? Anyway, I have updated the plugin from v2.0.0 to 2.0.1 to prevent this.

I have changed the array size from 192 to 190.

Lokogaditano
04-06-2014, 15:33
when round start, all players kicked, and in console appear


Error: server failed to transmit file 'AY&SYAՈ'
Host_Error: UserMsg: Not Present on Client 255

guipatinador
04-06-2014, 16:20
In round start all the nicknames are updated. Maybe the problem comes from there...
Try to disable this CVAR bps_skillpoints_on_nick

Lokogaditano
04-07-2014, 08:39
but, I like the points in the nick....otherwise I dont want the plugin, can fix?

hornet
04-09-2014, 00:24
-ZIP archive removed-

Before you re-upload it, remove all support for non Steam users, or your thread will be trashed and you run the risk of being banned.

alfanero
04-18-2014, 04:50
Where can I download it?

guipatinador
04-18-2014, 05:27
Where can I download it?

I uploaded the new version. You can download the plugin in the first post.

I did not test the new version, be aware.

alfanero
04-18-2014, 05:29
link?

guipatinador
04-18-2014, 05:30
link?

https://forums.alliedmods.net/showthread.php?t=191708
Search the attached files.

alfanero
04-18-2014, 05:32
Thank you very much

diesel31
04-19-2014, 18:33
Maybe can help me? I wanna make one function. Now plugin show Player nick <skill points>
How i can make that plugin show Player nick <skill points(500)> <position in top(2)>

Please tell me :)

ViBE
05-22-2014, 10:59
could you add multi-language support?

guipatinador
05-22-2014, 16:44
No.

dedict
07-04-2014, 10:12
How to edit the plugin, for look like this:

Player1 (1,117) [32/50] got 2 points for killing Player2 (1,001) [1/50]

(1,117) - the points of Player1
[32/50] - the stats of Player1

(1,001) - the points of Player2
[1/50] - the stats of Player2

Lokogaditano
08-23-2014, 10:10
A cvar for, pause or start the plugin depending of the players inside the server?

I have a automix pug, for 5on5 , but plugin works when for ex are 4-6 players in server, and I want only work when there are 10 players, thx

Awesome_man
09-26-2014, 01:33
How to remove point after player nick, I mean player 32 john 33

guipatinador
09-26-2014, 03:57
Read the first post.


bps_skillpoints_on_nick 1 // Turn on/off SkillPoints in nickname ex: (nick <1337>) (updates when player spawn)

Awesome_man
09-26-2014, 06:39
why points not saving ? i checked my points and dey were 0 and btw how point saved by nick ip or steamid where is d cvar ?

Also can you please create a script which show welcome message along with points for eg :-

Player (points 567) (Rank %s) Joined The Server

guipatinador
09-26-2014, 07:09
why points not saving ? i checked my points and dey were 0
What version do you use? SQL or FVault ?

and btw how point saved by nick ip or steamid where is d cvar ?
Save points by nick/ip is not supported.

Also can you please create a script which show welcome message along with points for eg :-

Player (points 567) (Rank %s) Joined The Server

Add this to client_authorized,


new szStats[ 8 ]
new szBHits[ 8 ]

new iPos = get_user_stats( id, szStats, szBHits )
new iSkillPoints = skillpoints( id )

new szName[ 32 ]
get_user_name( id, szName, charsmax( szName ) )

client_print( 0, print_chat, "%s (%i SkillPoints) (Rank %i) joined the server", szName, iSkillPoints, iPos )


If this don't work, is because client_authorized is too early to call get_user_stats.

Awesome_man
09-26-2014, 07:34
What version do you use? SQL or FVault ?


Save points by nick/ip is not supported.



Add this to client_authorized,


new szStats[ 8 ]
new szBHits[ 8 ]

new iPos = get_user_stats( id, szStats, szBHits )
new iSkillPoints = skillpoints( id )

new szName[ 32 ]
get_user_name( id, szName, charsmax( szName ) )

client_print( 0, print_chat, "%s (%i SkillPoints) (Rank %i) joined the server", szName, iSkillPoints, iPos )
If this don't work, is because client_authorized is too early to call get_user_stats.

Thanks for you help and nice plugin though..

Can you please post full script for welcome message ?

Awesome_man
10-03-2014, 07:34
How to show Points And Rank in hud upper left green color .. thnx in advance

Awesome_man
10-04-2014, 11:46
Someone plz add My Points : %s In hud in this code

#include < amxmodx >
#include < csx >

#define PLUGIN ""
#define VERSION "1"
#define AUTHOR ""

const Float:REFRESH_RATE = 1.0;
new maxplayers

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
maxplayers = get_maxplayers()
set_task(1.0,"ShowHud",0,"",0,"b")
set_task(1.0,"Showpoints",0,"",0,"b")
set_task( REFRESH_RATE, "TaskShowRank", .flags = "b" );
}

public ShowHud()
{
for(new i = 1 ; i <= maxplayers ; i++)
{
new Frags = get_user_frags(i)
new Deaths = get_user_deaths(i)
set_hudmessage(0,255,0,0.02,0.3,0, 1.0, 1.0, 0.1, 0.2, 1)
show_hudmessage(i,"Frags : %d ^nDeaths : %d",Frags,Deaths)
}
}

public TaskShowRank( )
{
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );

new iPlayer, iStats[ 8 ];
new iTotalStats = get_statsnum( );

for( new i = 0; i < iNum; i++ )
{
iPlayer = iPlayers[ i ];

set_hudmessage( 0,255,0,0.02,0.37, .holdtime = ( REFRESH_RATE + 0.2 ), .fadeintime = 0.0, .fadeouttime = 0.0, .channel = 3 );
show_hudmessage( iPlayer, "Rank: %d / %d", get_user_stats( iPlayer, iStats, iStats ), iTotalStats );
}
}

Dr Zayd
10-05-2014, 07:49
You Can Add it in Hud_message ??
You're Points %d/%d | Level %s

Awesome_man
10-05-2014, 13:06
You Can Add it in Hud_message ??
You're Points %d/%d | Level %s

Can you please do it ?

feifei
10-06-2014, 12:11
when I changed Classes and Levels that time showing error in compile time

new const CLASSES[ MAX_CLASSES ][ ] = {
"NEW",
"NOOB",
"GAMER",
"GOOD",
"TOP",
"BEST"
}

new const LEVELS[ MAX_LEVELS ] = {
500,
1200,
1800,
2500,
3500,
5000,
100000 /* high value (not reachable) */
}

HamletEagle
10-06-2014, 12:34
You have so many cvars, you can make an enum, loop through all of them and cache the values on Hltv event and in a forward like plugin_cfg. In client_death forward you should cache g_iEnableAnnounceOnChat to avoid useless native calls, also check if the attacker is connected.

guipatinador
10-07-2014, 09:28
You Can Add it in Hud_message ??
You're Points %d/%d | Level %s

Just read a tutorial about hud messages. I will not teach you how to make hud messages.

when I changed Classes and Levels that time showing error in compile time
(...)


You are doing it wrong. If you have 5 elements in "CLASSES" array, you need to have 5 elements in "LEVELS" array.


You have so many cvars, you can make an enum, loop through all of them and cache the values on Hltv event and in a forward like plugin_cfg. In client_death forward you should cache g_iEnableAnnounceOnChat to avoid useless native calls, also check if the attacker is connected.

This plugin is old. In fact, it was one of the first plugins that I did so don't worry if it is not optimized.

HamletEagle
10-07-2014, 11:55
Then optimize it or request to be send to unnaproved.

guipatinador
10-07-2014, 15:18
I am not obliged to ask for disapproving just because you think it is not optimized.

feifei
10-13-2014, 09:27
can any one tell me how to give XP ???

I joined my server
then typed
bps_give STEAM_0:0:4987XXX 400

but it showing ---->>>>
Client with that name or userid not found
Sorry, player STEAM_0 could not be found or targetted!

HamletEagle
10-13-2014, 10:43
Try to put "" around the steamid :P
@guipatinador, you said that it's not optimized.

feifei
10-13-2014, 10:52
Try to put "" arounc the steamid :P
@guipatinador, you said that it's not optimized.

I did bro still not working :(

guipatinador
10-13-2014, 14:19
Try to put "" around the steamid :P
@guipatinador, you said that it's not optimized.

I didn't say that. I said "(...) so don't worry if it is not optimized (...)".

feifei
10-13-2014, 14:34
I didn't say that. I said "(...) so don't worry if it is not optimized (...)".

I don't understood... please tell me clearly...

suppose I want to give a points to my self///
my steam ID:- STEAM_0:0:4987XXX
and I want to give 400 points.. so, now what command I will type in console ?

tested but not working :-

1. bps_give "STEAM_0:0:4987XXX" "400" //>>> it's showing player have immunity or not targeted.

2. bps_give STEAM_0:0:4987XXX 400 //>>>>> not targeted.

guipatinador
10-14-2014, 06:21
1. bps_give "STEAM_0:0:4987XXX" "400" //>>> it's showing player have immunity or not targeted.

This is the right way.
Unfortunately the code has a bug and does not allow add/remove skillpoints for server admins.

If you want to solve this for yourself edit the code in line 814 if you are using FVault version or 1086 for SQL version.

Replace


new iPlayer = cmd_target( id, Arg1, 1 )
With


new iPlayer = cmd_target( id, Arg1, CMDTARGET_ALLOW_SELF )
Do the same thing in line 850 for FVault version or 1122 for SQL version.

Or you could just wait for my next update with some bug fixes.

feifei
10-14-2014, 16:35
This is the right way.
Unfortunately the code has a bug and does not allow add/remove skillpoints for server admins.

If you want to solve this for yourself edit the code in line 814 if you are using FVault version or 1086 for SQL version.

Replace


new iPlayer = cmd_target( id, Arg1, 1 )
With


new iPlayer = cmd_target( id, Arg1, CMDTARGET_ALLOW_SELF )
Do the same thing in line 850 for FVault version or 1122 for SQL version.

Or you could just wait for my next update with some bug fixes.

Ok bro I'm waiting for your next update.. And plz don't forget to pm me for your next update.

xxxperts
10-20-2014, 10:45
Nice Plugin.. :)

Suggestion:
1] Add a command to reset all your entries ( vault & sql ) which can be done only by Admin.
2] Give points to best player of round.
3] How about spectator can see the points of spectating player.
4] Save the points of all player on map change ( may be required because you are not saving points when you are giving points).
5] Use switch instead of if else in your 'ClCmd_Say' function.
6] Why are you declaring every function as a public.?

guipatinador
10-20-2014, 15:01
1] Add a command to reset all your entries ( vault & sql ) which can be done only by Admin.
Maybe in the next version.

2] Give points to best player of round.How do you track the best player of the round? The player with more kills? Or the player with more damage? Anyway, it's not in my plans.

3] How about spectator can see the points of spectating player.How ? By Hud Message ? Anyway, you can see the points of a player in TAB if you have bps_skillpoints_on_nick set to 1.

4] Save the points of all player on map change ( may be required because you are not saving points when you are giving points).CheckLevelAndSave( id ) is called in client_disconnect( id ), so its called when the map is changed.

5] Use switch instead of if else in your 'ClCmd_Say' function.Seriously ? How can I do a switch when I have strings?

6] Why are you declaring every function as a public.?
Because I want.

HamletEagle
10-20-2014, 15:04
You can still use switch.

switch( szCmd[ 0 ] )
{
case 'm':
{
}
case 'r':
{
}
}

guipatinador
10-20-2014, 15:10
I know but that switch will not work for restartskill and rankskill because in both cases szCmd[ 0 ] == 'r' :)

HamletEagle
10-20-2014, 15:27
And you can add another filter in the 'r' case, but I don't think that's an optimization that worth to be done.

guipatinador
10-21-2014, 09:37
but I don't think that's an optimization that worth to be done.

Obviously not :)
if / else if with equal( ) is fine.

A new version is coming, with fvault / sql merged into one plugin.

kruger
10-21-2014, 12:05
On some maps I receive the following error:

L 10/21/2014 - 17:57:33: [AMXX] Displaying debug trace (plugin "BasicSkillPointsSQL_SE.amxx")
L 10/21/2014 - 17:57:33: [AMXX] Run time error 4: index out of bounds
L 10/21/2014 - 17:57:33: [AMXX] [0] BasicSkillPointsSQL_SE.sma::client_infochange d (line 331)

xxxperts
10-22-2014, 05:12
Because I want.


Why are you wasting memory, by declaring every functions as public.?

pupil0888
10-22-2014, 05:24
L 10/22/2014 - 09:09:10: -------- Mapchange to de_dust2 --------
[AMXX] Loaded 1 admin from file
L 10/22/2014 - 09:09:10: [AMXX] Plugin ("BasicSkillPointsSQL_SE.amxx") is setting itself as failed.
L 10/22/2014 - 09:09:10: [AMXX] Plugin says: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 10/22/2014 - 09:09:10: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL_SE.amxx") - forced exit

guipatinador
10-22-2014, 05:38
Read the first post! Change your map and it will be fine.

kruger
10-22-2014, 05:58
why are "new g_iWonPoints4k, new g_iWonPoints5k" not sent to the database - what's the point in declaring and not using them???

pupil0888
10-22-2014, 06:22
Read the first post! Change your map and it will be fine.

that's me?

guipatinador
10-22-2014, 07:32
that's me?

Yes, it's for you. Change the map and check if the error persists.

why are "new g_iWonPoints4k, new g_iWonPoints5k" not sent to the database - what's the point in declaring and not using them???

Currently, I'm using g_iWonPoints4k as a pointer for this CVAR - bps_won_points_4k.

I will consider your sugestion for my next version :)

feifei
10-22-2014, 09:38
I need it from past 1month.

like:-

it will always show in left side

[Server Name] <<-- only server name will show with different color.
[Current Time]
[XP]
[class]
[current position] <<-- means position his rank out of total players
[current weapons]

And I'ill never mind about this skills point plugin, if you want then you can create new,
I will tell you about style.

and when anyone will join the server it will show
http://i.imgur.com/3PjQRzE.png

And also don't forget to add spec info.
when you will spec to any1 in first person view
then it will show: with this style:---------

------------------------------------
|Rank:- XX XP:- XXX |
|Class:- XX Position:- XXX |
------------------------------------

give/take XP to/from others (bug founded) command not working. fix that in new version.

skz
11-28-2014, 10:38
It's a great plugin, congratulations from another portuguese!

Bleeding Warrior
12-29-2014, 12:19
I only know this... http://forums.alliedmods.net/showthread.php?t=74175
And this http://forums.alliedmods.net/showthread.php?t=131720 don't work properly.

I get these error on webhosting side !!
Error = Warning: set_time_limit() has been disabled for security reasons in /home/a1597190/public_html/index.php on line 6
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a1597190/public_html/index.php on line 35
Warning: Invalid argument supplied for foreach() in /home/a1597190/public_html/index.php on line 72

Any solution?

guipatinador
12-29-2014, 18:08
Check if your database is empty.

The first error is because your host does not support set_time_limit(). Thats not a problem.

Shockyboy
01-02-2015, 06:07
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Invalid character constant on line 315
Error: Invalid character constant on line 315
Error: Invalid character constant on line 332
Error: Invalid character constant on line 332
Error: Invalid character constant on line 344
Error: Invalid character constant on line 344
Error: Invalid character constant on line 364
Error: Invalid character constant on line 364
Error: Invalid character constant on line 372
Error: Invalid character constant on line 372
Error: Invalid character constant on line 385
Error: Invalid character constant on line 385
Error: Invalid character constant on line 393
Error: Invalid character constant on line 393
Error: Invalid character constant on line 406
Error: Invalid character constant on line 406
Error: Invalid character constant on line 413
Error: Invalid character constant on line 413
Error: Invalid character constant on line 423
Error: Invalid character constant on line 423
Error: Invalid character constant on line 430
Error: Invalid character constant on line 430
Error: Invalid character constant on line 464
Error: Invalid character constant on line 464
Error: Invalid character constant on line 477
Error: Invalid character constant on line 477

Compilation aborted.
26 Errors.
Could not locate output file C:\Documents and Settings\RADHAKRISHNA\Desktop\AMX Mod X\files\cstrike\plugins\BasicSkillPointsFVaul t_SE.amxx (compile failed).

guipatinador
01-02-2015, 07:47
Compiles fine here.

FVault version

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 2552 bytes
Code size: 41228 bytes
Data size: 37672 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 97836 bytes
Done.
SQL version

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 2668 bytes
Code size: 36140 bytes
Data size: 42916 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 98108 bytes
Done.

Shockyboy
01-02-2015, 10:26
https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-xap1/v/t1.0-0/1620990_612759445535898_7665026270387091922_n .jpg?efg=eyJpIjoiYiJ9&oh=e36b664169f770e45d2879ae7f93448b&oe=5527A62E&__gda__=1429953895_933fa81324419fdfd32e20e66d 5c4f43

guipatinador
01-02-2015, 12:07
You are not using my version because I don't use client_print_color.


if( iTK )
{
g_iPoints[ iKiller ] -= get_pcvar_num( g_iLostPointsTK )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) && get_pcvar_num( g_iLostPointsTK ) )
{
ClientPrintColor( iKiller, "!g%s!n You have lost!t %i!n point%s by killing a teammate", PREFIX, get_pcvar_num( g_iLostPointsTK ), get_pcvar_num( g_iLostPointsTK ) > 1 ? "s" : "" )
}

return PLUGIN_CONTINUE
}
If you don't use my version I can't support. You have to solve the problems.

Shockyboy
01-02-2015, 13:07
You are not using my version because I don't use client_print_color.


if( iTK )
{
g_iPoints[ iKiller ] -= get_pcvar_num( g_iLostPointsTK )

if( get_pcvar_num( g_iEnableAnnounceOnChat ) && get_pcvar_num( g_iLostPointsTK ) )
{
ClientPrintColor( iKiller, "!g%s!n You have lost!t %i!n point%s by killing a teammate", PREFIX, get_pcvar_num( g_iLostPointsTK ), get_pcvar_num( g_iLostPointsTK ) > 1 ? "s" : "" )
}

return PLUGIN_CONTINUE
}
If you don't use my version I can't support. You have to solve the problems.


Actually Someone Told Me Make Changes, I've Did "Actually I Didn't Noticed My [PREFIX][ Contains "^" did '^^' Done Worked

Bleeding Warrior
01-03-2015, 12:44
Check if your database is empty.

The first error is because your host does not support set_time_limit(). Thats not a problem.

And how should I check that ?
And bps_sql_host "" cvar is not working ,I tried hardcoding from sma also but it still picks up "localhost" as value.I have server and website on different locations.Even when I am testing on local HLDS ,it sets host as my external IP.

Clouder16
01-12-2015, 21:18
Hello ! I need little support.

How to make this skill system work correct ?
I mean, system is good, and everything is runing okey, but only 1 problem, that skill points what showing in TAB, they are changing nickname, so, if admin playing on server, he will not able to change map, ban someone or whatever...

How to edit this ? Thanks

Vivo
01-13-2015, 07:34
Can you mirage it with Auto-Mix !?

guipatinador
01-13-2015, 15:47
And how should I check that ?
And bps_sql_host "" cvar is not working ,I tried hardcoding from sma also but it still picks up "localhost" as value.I have server and website on different locations.Even when I am testing on local HLDS ,it sets host as my external IP.

Thats not a problem of my plugin. I can't help you with that.

Hello ! I need little support.

How to make this skill system work correct ?
I mean, system is good, and everything is runing okey, but only 1 problem, that skill points what showing in TAB, they are changing nickname, so, if admin playing on server, he will not able to change map, ban someone or whatever...

How to edit this ? Thanks

Non-Steam clients are not supported. Add your admins by STEAM ID.

Can you mirage it with Auto-Mix !?

No.

dkn
01-15-2015, 10:02
Hi! I need some help please.
The plugin works like a charm, I just want to ask you IF THERE IS A WAY TO SET THE FVAULT to register BY NAME and NOT by STEAM-ID.
I have NON STEAM players on my server so this is a bit of a problem for me.
Thank you in advance!

guipatinador
01-17-2015, 05:04
No.

dkn
01-17-2015, 10:27
Well, thanks for your help. Faggot -_-

guipatinador
01-17-2015, 10:46
lol?

NON STEAM CLIENTS ARE NOT SUPPORTED.

Now get the fuck out of here.

dkn
01-17-2015, 12:42
Well that means you are bad at scripting, and you should STOP trying, bitch.

guipatinador
01-17-2015, 13:57
ahahah.

Bleeding Warrior
01-30-2015, 09:15
ahahah.

It only shows 30 players on webfront and only 10 players in /top list.Can you modify it to log each and every player on webfront with search option ?

guipatinador
01-30-2015, 17:15
That is not in my plans, however, you can change the number of players that appear in webfront and /top command.

Bleeding Warrior
01-31-2015, 06:59
That is not in my plans, however, you can change the number of players that appear in webfront and /top command.
But what should I set to display each and every player ?

4ever16
04-14-2015, 17:22
One sad thing about this plugin. Name doesnt change back if i turn off plugin.
For example.

Server.cfg loaded, plugin off. (Player)
Match.cfg loaded, plugin on. (Player <1337>)
Match end, server.cfg loaded, plugin off. (Player <1337>)

The name doesnt change back to default when the plugin is turned off or when map changes.

Do you think you could do something about this problem?

4ever16
06-08-2015, 01:13
Cant get SQL version to work.

I did everything right.

Could i get live help via TeamViewer or Steam Friends?

The error i get is.
amx_plugins Basic SkillPoints v2.0.2 SE error

Plugin cant be activated.

4ever16
06-21-2015, 02:33
L 06/21/2015 - 08:24:12: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20150621.log")
L 06/21/2015 - 08:24:12: [AMXX] Plugin ("BasicSkillPointsSQL_SE.amxx") is setting itself as failed.
L 06/21/2015 - 08:24:12: [AMXX] Plugin says: Access denied for user 'ODBC'@'localhost' (using password: NO)
L 06/21/2015 - 08:24:12: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL_SE.amxx") - forced exit
L 06/21/2015 - 08:28:09: Start of error session.
L 06/21/2015 - 08:28:09: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20150621.log")
L 06/21/2015 - 08:28:09: [AMXX] Plugin ("BasicSkillPointsSQL_SE.amxx") is setting itself as failed.
L 06/21/2015 - 08:28:09: [AMXX] Plugin says: Can't connect to MySQL server on 'XXXXXXXXXXXXXXXX.com' (10060)
L 06/21/2015 - 08:28:09: [AMXX] Run time error 1 (plugin "BasicSkillPointsSQL_SE.amxx") - forced exit

Wtf is the problem?!

No1.Pervade
06-22-2015, 08:46
This wont be resolved it cant communicate with mysql socket2 and it disables its self.
I hop ethe author see this.

L 06/22/2015 - 14:51:57: Info (map "de_westwood_snow") (file "addons/amxmodx/logs/error_20150622.log")
L 06/22/2015 - 14:51:57: [AMXX] Plugin (" BasicSkillPointsv2.0.2SE") is setting itself as failed.
L 06/22/2015 - 14:51:57: [AMXX] Plugin says: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 06/22/2015 - 14:51:57: [AMXX] Run time error 1 (plugin " BasicSkillPointsv2.0.2SE.amxx") - forced exit

Artizy
09-19-2016, 14:19
Someone who can help me to edit php script for mysql ?

Artizy
09-21-2016, 10:42
Nobody?

Hectik17
01-30-2017, 18:15
is it possible to award players on a team a skill point after they have won a scrim/pug for example once they mach has reached 15 and a team has won. award the player son that team 1 skill point. instead of awarding them a point after wining just 1 round?

EFFx
01-30-2017, 18:20
You can make it with a native. Just create one and use it on your pug source code.

Pawangond
05-06-2017, 16:06
HELP i am getting some errors , also stats not showing on website.
looks both plugin working properly

ERRORS:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in ......./......../stats/index.php on line 35

Warning: Invalid argument supplied for foreach() in ......../........./stats/index.php on line 72

Pawangond
05-06-2017, 16:45
wait i just saw everything but there is nothing from where this web can receive server data ! then how its possible ?

nullatonce
04-06-2018, 10:22
Hello, i'm having a bug that skillpoints in mysql version for kills/deaths etc. isn't counting.
The only thing that's counting T&CT WIN's/LOSS'es. Logs doesn't provide no errors, mysql table is creating when not existing, i tried disabling some other plugins - have no effect.
any one have a clue how to fix this ?
-----
Edit:
fixed my bugs. Plugin not compatible with PodBot's

Apb hq
05-03-2018, 12:14
Can someone add a cvar basic_points_reset 1 (like in statsx csstats_reset ) in order to remove all data from the SQL databse

karimoo97
05-08-2018, 21:10
One of the best Ranking plugins in amxx,I've been using it for almost two years now,but still,a adding a hud to both the player and his spectator would be great and maybe a menu with all the gardes and the points needed to reach them /Grades

Grades :

1-Noobest [0]
2-Noob [150]
3-Newbie [500]
4-Easy [1000]
5-Normal [1700]
6-Hard [2500]
7-Expert [3800]
8-Back
9-More
0-Exit

Nutu_
10-14-2018, 10:43
Can someone add a cvar basic_points_reset 1 (like in statsx csstats_reset ) in order to remove all data from the SQL databse
+1, how to reset the points???

EdmondN1
10-26-2019, 22:21
Hey there,

Is there anyone who can help me with this plugin? I want to implement it to a mix server, but I want to register the frags only during the match (from the start to the end), and do not register the frags during warmup. How can I do that?

Sanjay Singh
11-28-2019, 00:16
can someone create api for this plugin.
for setting player xp by api .