[AmxModX][CS 1.6] Sistem Puncte ~ MySQL

Anunturi legate de vanzari/cumparari.
*Nu suntem responsabili de tranzactiile efectuate intre membri. Utilizatorii sunt sfatuiti sa-si ia maximul de precautii inainte de finalizarea unei tranzactii pentru a preveni posibilitatea unei inselaciuni.

Moderators: Moderatori ajutatori, Moderatori

Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

06 Jul 2020, 15:37

Filiq_ wrote:
06 Jul 2020, 14:59
3 poti sa le pui cum vrea **** ta, eu daca vreau sa fac

data[0] = id
data[1] = name
data[2] = puncte

o fac
Notatia poti sa o pui cum vrei, dar o pui ca sa intelegi doar tu, nu si altii, de aia sunt notatii globale.
RoyalServer 2
User avatar
robbencsgo
Membru, skill 0
Membru, skill 0
Posts: 96
Joined: 31 Aug 2019, 19:14
Detinator Steam: Da
CS Status: aimer
SteamID: an prevat
Fond eXtream: 0
Has thanked: 9 times
Been thanked: 11 times
Contact:

06 Jul 2020, 18:35

Shadows Adi wrote:
06 Jul 2020, 11:23
Shadows Adi wrote:
06 Jul 2020, 01:02

La fiecare ucidere normala / headshot atacatorul primeste / victimei i se scade un anumit numar de puncte.
La fiecare ucidere cu cutitul prin headshot sau normala, atacatorul primeste / victimei i se scade un anumit numar de puncte.
La fiecare ucidere a unui coechipier, atacatorului i se scade un anumit numar de puncte.
La fiecare sinucidere, jucatorului i se scade un anumit numar de puncte.

Plugin-ul suporta mai multe limbi, implicit fiind tradus in Romana si Engleza.
Da, robben, exista, dar nu îl poți seta cate puncte sa primești pe headshot, cu cuțitul, etc.
Bro, wtf, normal ca poti seta, iti trebuie niste cunostinte minime ca sa faci o linie de cod asa simpla.

Code: Select all

new weapon;
weapon = get_user_weapon(id)

if(weapon = CSW_KNIFE)
{
Points[id] += 1
}
Eu nu am zis nimic de pluginul tau, poate este bun si nu contest asta dar ziceam ca sunt si alte variante.
Daca te-am ajutat, lasa si tu un +1
User avatar
Xeno985
Membru, skill +1
Membru, skill +1
Posts: 206
Joined: 05 Jul 2017, 22:07
Detinator Steam: Da
CS Status: Disponibil, doar cand sunt acasa.
Detinator server CS: Nu
SteamID: 512916512916
Reputatie: Membru Club eXtreamCS (28 Jan - 28 Feb)
Fond eXtream: 0
Location: 127.0.0.1
Discord: nvF4B8A
Has thanked: 12 times
Been thanked: 4 times
Contact:

07 Jul 2020, 23:04

Filiq_ wrote:
06 Jul 2020, 14:59
Shadows Adi wrote:
06 Jul 2020, 14:23
Filiq_ wrote:
06 Jul 2020, 13:58

:)))) ce e asa de hardcoded la el?
1. Puteai sa folosesti in tot codul charsmax().
2. Ai redefinit MAX_PLAYERS. In AmxModX 1.8.3+ nu ai nevoie de asa ceva, puteai sa folosesti preprocesorul '#if' ca sa verifici daca versiunea de AmxModX este mai mica decat 1.8.3 si dupa defineai MAX_PLAYERS. Acelasi lucru si la client_disconect ( aici ma refer strict la preprocesor '#if' )
3. m_Error[ 512 ] -->> g_hError[ 512 ] aici ma refer strict la numele variabilelor. Le puteai face sa fie mult mai proeminente prin simplul fapt sa le redenumesti in asa fel in cat sa stii unde se afla ( g_i* este o variabila globala intreaga, etc ) stii la ce ma refer.
1 in momentul cand a fost facut pluginul, lucram fara charsmax/sizeof, treceam valoarea directa si acum fac uneori la fel, daca stiu ca queryul ala are x randuri de ce sa stau sa ii pun charsmax cand pot sa ii dau direct valoarea lui si sa ramana asa?
2 pluginurile postate de mine sunt doar pentru 1.8.2 nu mi pasa de celelalte versiuni
3 poti sa le pui cum vrea **** ta, eu daca vreau sa fac

data[0] = id
data[1] = name
data[2] = puncte

o fac
Din perspectiva asta este mult mai simplu de utilizat astfel variabilele de tip array :funny_cat: nu ma pricep la amxx, dar aveti o cearta destul de funny :boundlessly_laughing:
👉 Panel Counter-Strike: Click. 👈
👉💎 Shop: Click. 💎👈
👉💻 Filme: Click. 💻👈
👉📧 Contact: Steam 📧👈
Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

12 Jul 2020, 21:12

Update Versiunea 1.2 :

- Am adaugat posibilitatea unui jucator de a primi puncte pentru Bomba Plantata, Bomba Explodata, Bomba Dezamorsata.

- Am implementat doua tipuri de salvare ( se poate schimba prin cvar ): prin Nume si prin SteamID

- Am adaugat suport si pentru versiuni de AmxModX mai mici decat 1.8.3 ( testat pe 1.8.2, urmeaza sa testez si pe 1.8.1 )

- Am regandit sistemul de punctaj: nu se mai primesc puncte pe ucidere + HS ( daca faci ucidere prin headshot ), acum se pun doar punctele de pe HS ( daca faci o ucidere prin HS, primesti doar punctele pentru headshot ), la fel si pentru uciderea cu cutitul / cu cutitul prin HS.
User avatar
sancez
Membru, skill +4
Membru, skill +4
Posts: 1502
Joined: 13 Nov 2009, 15:51
Detinator Steam: Da
Detinator server CS: cs.cs2.ro
SteamID: sancez_2014
Reputatie: Membru COMERCIAL
Discord: sancez#2828
Has thanked: 3 times
Been thanked: 7 times

14 Jul 2020, 19:30

bft la vanzare adi
User avatar
1TAP GOD
Membru, skill +1
Membru, skill +1
Posts: 152
Joined: 03 Sep 2018, 00:20
Detinator Steam: Da
SteamID: /id/assasinssmdfk
Fond eXtream: 0
Has thanked: 16 times
Been thanked: 16 times

16 Jul 2020, 15:03

#UP4ADI
----------------Steam----------------
-----------------------------------------------------------
Image
And she be actin' funny, probably think a nigga need her
I thought I was faithful, she say I'm a cheater
They thought I was taken, I'm ready to mingle
Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

19 Jul 2020, 22:26

Bump
ZackChoi
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 28 Dec 2019, 01:39
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time
Been thanked: 7 times

20 Jul 2020, 23:27

SQL_v3.sma | Afiseaza codul
/* SQL Points v3.0 by LondoN eXtream
   Release Date: 04.01.2020	*/

#include <amxmodx>
#include <amxmisc>
#include <sqlx>
#include <print>

// Special Include
#include <amx_settings_api>

// Main Plugin Information
#define PLUGIN	"SQL Points for MIX"
#define VERSION	"3.0"
#define AUTHOR	"-"

// Main Settings File
#define POINTS_SETTINGS_FILE	"SQL_Points.ini"

// Main Variables
new PlayerName[33][32];	// Used for getting player name
new PlayerSteamID[45][32];	// Used for getting player SteamID
new Points[33];	// Used for count user points
new SQLHost[32], SQLUser[32], SQLPass[32], SQLDatabase[32];	// Used for SQL connection 
new KillPoints = 1, HSPoints = 2, KnifePoints = 3, GrenadePoints = 4, TKPoints = 5;	// Used to give points to the players
new MinPlayers;	// Used to start only with minimum players
new SaveMode;	// Used for setting save mod
new Handle:SQLTuple;	// Used for SQL Connection

/* _________________________________
	Plugin Precache
__________________________________*/
public plugin_precache()
{
	// Register plugin information
	register_plugin(PLUGIN, VERSION, AUTHOR);

	// Load main configuration
	SQL_LoadFile(POINTS_SETTINGS_FILE);

	// Connecting to SQL DB
	SQLTuple = SQL_MakeDbTuple(SQLHost, SQLUser, SQLPass, SQLDatabase, 5);

	server_print("--------------------------------------------");
	server_print("Host: %s", SQLHost);
	server_print("User: %s", SQLUser);
	server_print("Pass: %s", SQLPass);
	server_print("DB: %s", SQLDatabase);

	server_print("Save Mode: %d", SaveMode);
	server_print("Save by %s", SaveMode == 0 ? "Name" : "SteamID");
	server_print("Min Players for Start: %d", MinPlayers);

	server_print("Normal Kill: %d", KillPoints);
	server_print("HS: %d", HSPoints);
	server_print("Knife: %d", KnifePoints);
	server_print("Grenade: %d", GrenadePoints);
	server_print("TK: %d", TKPoints);
	server_print("--------------------------------------------");
}

// Load main configuration
public SQL_LoadFile(const a[])
{
	// Main Vars
	if(!amx_load_setting_int(a, "MAIN VARS", "NORMAL KILL", KillPoints))
		amx_save_setting_int(a, "MAIN VARS", "NORMAL KILL", KillPoints);
	if(!amx_load_setting_int(a, "MAIN VARS", "HEADSHOT KILL", HSPoints))
		amx_save_setting_int(a, "MAIN VARS", "HEADSHOT KILL", HSPoints);
	if(!amx_load_setting_int(a, "MAIN VARS", "KNIFE KILL", KnifePoints))
		amx_save_setting_int(a, "MAIN VARS", "KNIFE KILL", KnifePoints);
	if(!amx_load_setting_int(a, "MAIN VARS", "GRENADE KILL", GrenadePoints))
		amx_save_setting_int(a, "MAIN VARS", "GRENADE KILL", GrenadePoints);
	if(!amx_save_setting_int(a, "MAIN VARS", "TK POINTS", TKPoints))
		amx_save_setting_int(a, "MAIN VARS", "TK POINTS", TKPoints);

	// Plugin Settings
	if(!amx_load_setting_int(a, "MAIN SETTINGS", "MIN PLAYERS", MinPlayers))
		amx_save_setting_int(a, "MAIN SETTINGS", "MIN PLAYERS", MinPlayers);
	if(!amx_load_setting_int(a, "MAIN SETTINGS", "SAVE MODE", SaveMode))
		amx_save_setting_int(a, "MAIN SETTINGS", "SAVE MODE", SaveMode);

	// SQL Information
	if(!amx_load_setting_string(a, "SQL Information", "HOST", SQLHost, charsmax(SQLHost)))
		amx_save_setting_string(a, "SQL Information", "HOST", SQLHost);
	if(!amx_load_setting_string(a, "SQL Information", "USER", SQLUser, charsmax(SQLUser)))
		amx_save_setting_string(a, "SQL Information", "USER", SQLUser);
	if(!amx_load_setting_string(a, "SQL Information", "PASS", SQLPass, charsmax(SQLPass)))
		amx_save_setting_string(a, "SQL Information", "PASS", SQLPass);
	if(!amx_load_setting_string(a, "SQL Information", "DB", SQLDatabase, charsmax(SQLDatabase)))
		amx_save_setting_string(a, "SQL Information", "DB", SQLDatabase);
}

public client_putinserver(id) {
	if(is_user_bot(id) || is_user_hltv(id))
		return;

	new GlobalQuery[256], Data[1];	Data[0] = id;
	get_user_name(id, PlayerName[id], charsmax(PlayerName));
	get_user_authid(id, PlayerSteamID[id], charsmax(PlayerSteamID));

	switch(SaveMode)
	{
		case 0:	formatex(GlobalQuery, charsmax(GlobalQuery), "SELECT * FROM SQL_Points WHERE PlayerName = '%s' LIMIT 1", PlayerName[id]);
		case 1:	formatex(GlobalQuery, charsmax(GlobalQuery), "SELECT * FROM SQL_Points WHERE PlayerSteamID = '%s' LIMIT 1", PlayerSteamID[id]);
	}

	SQL_ThreadQuery(SQLTuple, "SQL_Load", GlobalQuery, Data, 1);
}

public SQL_Load(FailState, Handle:Query, Error[], Errcode, Data[], DataSize) {
	if(FailState == TQUERY_CONNECT_FAILED)	log_amx("Load - Could not connect to SQL DB [%d] %s", Errcode, Error);
	else if(FailState == TQUERY_QUERY_FAILED)	log_amx("Load Query Failed [%d] %s", Errcode, Error);
	else if(Errcode)	server_print("Error on query: %s", Error);

	new id = Data[0];

	if(SQL_NumResults(Query) < 1) {
		new a[256];
		formatex(a, charsmax(a), "INSERT INTO `SQL_Points` (`PlayerName`, `PlayerSteamID`, `PlayerPoints`) VALUES ('%s', '%s', '0')", PlayerName[id], PlayerSteamID[id]);
		SQL_ThreadQuery(SQLTuple, "SQL_Ignore", a);
	}
	else
	{
		Points[id] = SQL_ReadResult(Query, 2);
	}
}

public client_disconnect(id) {
	if(is_user_bot(id) || is_user_hltv(id))
		return;

	new GlobalQuery[256];
	
	switch(SaveMode)
	{
		case 0:	formatex(GlobalQuery, charsmax(GlobalQuery), "UPDATE SQL_Points SET PlayerPoints = '%d' WHERE PlayerName = '%s'", Points[id], PlayerName[id]);
		case 1:	formatex(GlobalQuery, charsmax(GlobalQuery), "UPDATE SQL_Points SET PlayerPoints = '%d' WHERE PlayerSteamID = '%s'", Points[id], PlayerSteamID[id]);
	}

	SQL_ThreadQuery(SQLTuple, "SQL_Ignore", GlobalQuery);
}

// SQL Ignore
public SQL_Ignore(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
	if(FailState == TQUERY_CONNECT_FAILED)	log_amx("Load - Could not connect to SQL DB [%d] %s", Errcode, Error);
	else if(FailState == TQUERY_QUERY_FAILED)	log_amx("Load Query Failed [%d] %s", Errcode, Error);
	else if(Errcode)	server_print("Error on query: %s", Error);

	SQL_FreeHandle(SQLTuple);
}

/* ______________________________________
	Plugin Init
_______________________________________*/
public plugin_init()
{
	// Main Event
	register_event("DeathMsg", "ev_Death", "a");

	// Show Points CLcmd
	register_clcmd("say /points", "SayPoints");
}

public SayPoints(id)
{
	if(!Points[id])
	{
		print_message(id, "You have no one point right now.");
		return;
	}

	print_message(id, "You have^x04 %d^x01 points in your account.", Points[id]);
}

public ev_Death()
{
	if(get_playersnum() < MinPlayers)
		return;

	new attacker = read_data(1);
	new victim = read_data(2);
	new hs = read_data(3);

	if(!attacker || attacker == victim)
		return;

	if(hs)
	{
		Points[attacker] += HSPoints;
		print_message(attacker, "You recived^x04 +%d^x01 points for killing by HeadShot", HSPoints);
		return;
	}

	if(get_user_weapon(attacker) == CSW_KNIFE)
	{
		Points[attacker] += KnifePoints;
		print_message(attacker, "You recived^x04 +%d^x01 points for killing by Knife.", KnifePoints);
		return;
	}

	if(get_user_weapon(attacker) == CSW_HEGRENADE)
	{
		Points[attacker] += GrenadePoints;
		print_message(attacker, "You recived^x04 +%d^x01 points for killing by Grenade.", GrenadePoints);
		return;
	}

	if(get_user_team(attacker) == get_user_team(victim))
	{
		Points[attacker] -= TKPoints;
		print_message(attacker, "You recived^x04 -%d^x01 points for killing a teammate.", TKPoints);
		return;
	}

	Points[attacker] += KillPoints;
	return;
}
print.inc -> https://pastebin.com/iyTWE2Qb
baza_de_date.sql-pentru import | Afiseaza codul
CREATE TABLE SQL_Points (
	PlayerName varchar(255),
	PlayerSteamID varchar(255),
	PlayerPoints varchar(255)
);
SQL_Points.ini | Afiseaza codul
[MAIN VARS]
NORMAL KILL = 1
HEADSHOT KILL = 3
KNIFE KILL = 4
GRENADE KILL = 5
TK POINTS = 5

[MAIN SETTINGS]
MIN PLAYERS = 4
SAVE MODE = 1

[SQL Information]
HOST = localhost
USER = user
PASS = pass
DB = database
https://forums.alliedmods.net/showthread.php?t=243202

10 euro pe o nimica toata...plus de asta ca e si mult mai avansat fata de orice ai avea tu.
The Kalu
Fost administrator
Fost administrator
Posts: 13707
Joined: 09 Oct 2010, 12:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost Administrator
Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 328 times
Been thanked: 646 times
Contact:

21 Jul 2020, 00:18

ZackChoi wrote:
20 Jul 2020, 23:27
10 euro pe o nimica toata...plus de asta ca e si mult mai avansat fata de orice ai avea tu.
Citeste ce face pluginul lui si vezi ce face pluginul asta facut de londonicstrim, e mult mai simplu cel pus de tine.
La fiecare ucidere normala / headshot atacatorul primeste / victimei i se scade un anumit numar de puncte.
La fiecare ucidere cu cutitul prin headshot sau normala, atacatorul primeste / victimei i se scade un anumit numar de puncte.
La fiecare ucidere a unui coechipier, atacatorului i se scade un anumit numar de puncte.
La fiecare sinucidere, jucatorului i se scade un anumit numar de puncte.
Se gasesc pe internet plugin -uri cu codul sursa gratis sau cumparate si apoi puse la descarcat de plangaciosi sau stiu eu ce s-a intamplat, omul ofera un pic ceva mai mult decat unul gratuit pentru ca l-a dus capul si a zis sa faca ceva simplu si bun.Aia care vand ceva gratis nu stiti sa comentati, lasati omu` in pace.
Image
Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

23 Jul 2020, 10:31

1. Plugin-ul lui london foloseste amx_settings_api, ceea ce poate cauza (uneori) lag, poate si crash.
2. Poate o sa-i mai adaug cate ceva, pe viitor, acum sunt ocupat cu alte proiecte.

Bump.
User avatar
sancez
Membru, skill +4
Membru, skill +4
Posts: 1502
Joined: 13 Nov 2009, 15:51
Detinator Steam: Da
Detinator server CS: cs.cs2.ro
SteamID: sancez_2014
Reputatie: Membru COMERCIAL
Discord: sancez#2828
Has thanked: 3 times
Been thanked: 7 times

26 Jul 2020, 12:14

Shadows Adi wrote:
23 Jul 2020, 10:31
1. Plugin-ul lui london foloseste amx_settings_api, ceea ce poate cauza (uneori) lag, poate si crash.
2. Poate o sa-i mai adaug cate ceva, pe viitor, acum sunt ocupat cu alte proiecte.

Bump.
Ba ce plugin sa faca butu ala de London ca ala nu a fost in stare sa imi faca un plugin vip , degeaba scriptezi alandala , cand pica server-ul sau face lag , ala ce a facut , a facut ori cu ajutorul lu xyz , ori luate de pe diferite site-uri !

UP pentru ADI
The Kalu
Fost administrator
Fost administrator
Posts: 13707
Joined: 09 Oct 2010, 12:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost Administrator
Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 328 times
Been thanked: 646 times
Contact:

26 Jul 2020, 14:35

up up
Image
Post Reply

Return to “Anunturi”

  • Information