Cerere Plugin shop grade

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
N3v3rM1nd
Membru, skill +1
Membru, skill +1
Posts: 165
Joined: 06 Oct 2018, 13:41
Detinator Steam: Da
CS Status: Just a simple guy :P
Detinator server CS: As vrea eu xD
SteamID: Da
Fond eXtream: 0
Location: Constanta
Has thanked: 30 times
Contact:

30 Dec 2019, 20:41

Plugin Cerut: Un system de puncte cu shop !
Descriere (adica ce face el mai exact): Un system de puncte si un shop ! Shop-ul as vrea sa fie cu grade
Ex:

Code: Select all

 Manager - 25000 Points
 God - 23000
 Super-Mod 5000
 etc
As dori la system sa pot modifica eu gradele cu accesele din sma sau dintr-un alt fisier ! Se fie un fisier shop.ini sau shop.cfg in care sa existe cvaruri pentru

Code: Select all

puncte primite pe kill
puncte primite pe hs
puncte primite pentru kill cu grenada
puncte primite pentru plant
puncte primite pentru def
puncte primite pentru kill cu knife-ul
si vipii cu flagul "t" sa aiba puncte duble
Si as vrea ca punctlee sa fie salvate pe ip
Serverul impune conditii strict HLDS/REHLDS?: HLDS
Ai cautat pluginul?(daca da, precizeaza cum): Am cautat ,am incercat sa mi-l fac eu sau sa modific alte pluginuri dar imi dau erori
Necesita mod special?: Nu ,e pentru classic
Last edited by N3v3rM1nd on 30 Dec 2019, 21:37, edited 2 times in total.
User avatar
The Kalu
eXtream Mod
eXtream Mod
Posts: 12627
Joined: 09 Oct 2010, 11:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 203 times
Been thanked: 405 times
Contact:

30 Dec 2019, 22:51

Foloseste EDIT, nu mai face dublu post.Mersi de intelegere!
User avatar
N3v3rM1nd
Membru, skill +1
Membru, skill +1
Posts: 165
Joined: 06 Oct 2018, 13:41
Detinator Steam: Da
CS Status: Just a simple guy :P
Detinator server CS: As vrea eu xD
SteamID: Da
Fond eXtream: 0
Location: Constanta
Has thanked: 30 times
Contact:

08 Jan 2020, 00:04

Bump?
User avatar
robbencsgo
Membru, skill 0
Membru, skill 0
Posts: 69
Joined: 31 Aug 2019, 18:14
Detinator Steam: Da
CS Status: aimer
SteamID: an prevat
Fond eXtream: 0
Has thanked: 5 times
Been thanked: 9 times
Contact:

12 Jan 2020, 14:53

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <csx>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

// PUNCTE
new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
////////////

// Preturi Grade
new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
/////////////////

///////////////
#define TAG	"[server]"
///////////////

// FLAG
#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
///////////////////////////

new Points [ 33 ];
new SaveDataFile [ 128 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event ( "DeathMsg", "eDeath", "a" );
	
	register_clcmd( "say /shop","Meniu" );
	register_clcmd( "say_team /shop", "Meniu");
	
	new DataDir [ 64 ];
	get_configsdir ( DataDir, charsmax ( DataDir ) );
	format ( SaveDataFile, 127, "%s/Points.dat", DataDir );
}

public plugin_natives ( )
{
	register_native ( "pl_get_user_points", "get_user_points", 1 );
	register_native ( "pl_set_user_points", "set_user_points", 1 );
}

public get_user_points ( id )
{
	return Points [ id ];
}

public set_user_points ( id, PointsNum )
{
	Points [ id ] = PointsNum;
}

public eDeath (id, level, cid)
{
	new Killer = read_data (1);
	new Victim = read_data (2);
	new headshot = read_data (3);
	
	new arma = get_user_weapon(Killer);
	
	if ( Killer == Victim )                           return PLUGIN_HANDLED;
	
	if (headshot)
	{	
		Points[Killer] += g_HeadShot;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_HeadShot;
		}
	}
	else if(arma == CSW_KNIFE)
	{
		Points[Killer] += g_Knife;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_Knife;
		}
	}
	else if(arma == CSW_HEGRENADE)
	{
		Points[Killer] += g_KillGrenada;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillGrenada;
		}
	}
	else
	{
		Points[Killer] += g_KillNormal;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillNormal;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public bomb_planted(planter)
{
	Points[planter] += g_Plant;
	
	if(get_user_flags(planter) & ADMIN_LEVEL_H)
	{
		Points[planter] += g_Plant;
	}
}
public bomb_defused(defuser)
{
	if(get_user_flags(defuser) & ADMIN_LEVEL_H)
	{
		Points[defuser] += g_Defuse;
	}
	Points[defuser] += g_Defuse;
}

 public Meniu( id )
 {

    new menu = menu_create( "\rMeniu Grade:", "menu_handler" );

    menu_additem( menu, "\rManager \w- \y%s", "", g_pretManager );
    menu_additem( menu, "\rGod \w- \y%s", "", 0, g_pretGod );
    menu_additem( menu, "\rSuper-Mod \w- \y%s", "", 0, g_pretSMod);

    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

    menu_display( id, menu, 0 );

 }

 public menu_handler( id, level, menu, item )
 {
	new ip[32]
	get_user_ip(id, ip, 31)
	
	switch( item )
	{
		case 0:
		{
			if(Points[id] >= g_pretManager)
			{
				Points[id] -= g_pretManager;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagManager)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Manager", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
           
		}
		case 1:
		{
			if(Points[id] >= g_pretGod )
			{
				Points[id] -= g_pretGod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagGod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04God", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
		case 2:
		{
			if(Points[id] >= g_pretSMod)
			{
				Points[id] -= g_pretSMod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagSmod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Super-Moderator", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
	}
	menu_destroy( menu );
	return PLUGIN_HANDLED;
 }

public client_connect ( id )
{
	LoadPoints ( id );
}

public client_disconnect ( id )
{
	SavePoints ( id );
}

public LoadPoints ( id )
{
	new ip [ 32 ];
	get_user_ip ( id, ip, 31 );
	
	new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ];
	new File = fopen ( SaveDataFile, "rt" )
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		trim ( Line );
		
		parse ( Line, Arg1, 31, Arg2, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			Points [ id ] = str_to_num ( Arg2 );
			IsPlayer = true;
			break;
		}
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		Points [ id ] = 0;
}


public SavePoints ( id )
{
	new ip[32];
	get_user_ip(id, ip, 31)
	new nume[32]
	get_user_name(id, nume, 31)
	
	new Save [ 1024 ];
	format ( Save, sizeof ( Save ) -1, "^"%s^" Puncte: %d Nume: %s", ip, Points [id], nume );
	
	new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
	
	new File = fopen ( SaveDataFile, "rt" );
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		
		parse ( Line, Arg1, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			write_file ( SaveDataFile, Save, Linie );
			IsPlayer = true;
			break;
		}
		
		Linie++
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		write_file ( SaveDataFile, Save, -1 );
}



pentru puncte pentru fiecare chestie modifici aici

Code: Select all

new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
pentru preturi modifici aici

Code: Select all

new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
pentru flag-uri modifici aici

Code: Select all

#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
admin-ul il da pe ip fara parola
si punctele se salveaza in configs/Points.dat cu urmatorul format -> IP Puncte: nr.pct Nume: ultimul nume pe care l-a folosit
Last edited by robbencsgo on 12 Jan 2020, 16:55, edited 1 time in total.
Daca te-am ajutat, lasa si tu un +1
User avatar
Astaroth
Membru, skill +1
Membru, skill +1
Posts: 160
Joined: 24 Aug 2017, 15:38
Detinator Steam: Da
CS Status: .....
Detinator server CS: FURIEN.FREAKZ.RO
SteamID: AstarothRTH
Fond eXtream: 0
Been thanked: 1 time
Contact:

12 Jan 2020, 15:56

robbencsgo wrote:
12 Jan 2020, 14:53

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <csx>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

// PUNCTE
new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
////////////

// Preturi Grade
new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
/////////////////

///////////////
#define TAG	"[server]"
///////////////

// FLAG
#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
///////////////////////////

new Points [ 33 ];
new SaveDataFile [ 128 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event ( "DeathMsg", "eDeath", "a" );
	
	register_clcmd( "say /shop","Meniu" );
	register_clcmd( "say_team /shop", "Meniu");
	
	new DataDir [ 64 ];
	get_configsdir ( DataDir, charsmax ( DataDir ) );
	format ( SaveDataFile, 127, "%s/Points.dat", DataDir );
}

public plugin_natives ( )
{
	register_native ( "pl_get_user_points", "get_user_points", 1 );
	register_native ( "pl_set_user_points", "set_user_points", 1 );
}

public get_user_points ( id )
{
	return Points [ id ];
}

public set_user_points ( id, PointsNum )
{
	Points [ id ] = PointsNum;
}

public eDeath (id, level, cid)
{
	new Killer = read_data (1);
	new Victim = read_data (2);
	new headshot = read_data (3);
	
	new arma = get_user_weapon(Killer);
	
	if ( Killer == Victim )                           return PLUGIN_HANDLED;
	
	if (headshot)
	{	
		Points[Killer] += g_HeadShot;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_HeadShot;
		}
	}
	else if(arma == CSW_KNIFE)
	{
		Points[Killer] += g_Knife;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_Knife;
		}
	}
	else if(arma == CSW_HEGRENADE)
	{
		Points[Killer] += g_KillGrenada;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillGrenada;
		}
	}
	else
	{
		Points[Killer] += g_KillNormal;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillNormal;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public bomb_planted(planter)
{
	Points[planter] += g_Plant;
	
	if(get_user_flags(planter) & ADMIN_LEVEL_H)
	{
		Points[planter] += g_Plant;
	}
}
public bomb_defused(defuser)
{
	if(get_user_flags(defuser) & ADMIN_LEVEL_H)
	{
		Points[defuser] += g_Defuse;
	}
	Points[defuser] += g_Defuse;
}

 public Meniu( id )
 {

    new menu = menu_create( "\rMeniu Grade:", "menu_handler" );

    menu_additem( menu, "\rManager \w- \y%s", "", g_pretManager );
    menu_additem( menu, "\rGod \w- \y%s", "", 0, g_pretGod );
    menu_additem( menu, "\rSuper-Mod \w- \y%s", "", 0, g_pretSMod);

    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

    menu_display( id, menu, 0 );

 }

 public menu_handler( id, level, menu, item )
 {
	new ip[32]
	get_user_ip(id, ip, 31)
	
	switch( item )
	{
		case 0:
		{
			if(Points[id] >= g_pretManager)
			{
				Points[id] -= g_pretManager;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagManager)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Manager", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
           
		}
		case 1:
		{
			if(Points[id] >= g_pretGod )
			{
				Points[id] -= g_pretGod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagGod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04God", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
		case 2:
		{
			if(Points[id] >= g_pretSMod)
			{
				Points[id] -= g_pretSMod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagSmod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Super-Moderator", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
	}
	menu_destroy( menu );
	return PLUGIN_HANDLED;
 }

public client_connect ( id )
{
	LoadPoints ( id );
}

public client_disconnect ( id )
{
	SavePoints ( id );
}

public LoadPoints ( id )
{
	new ip [ 32 ];
	get_user_ip ( id, ip, 31 );
	
	new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ];
	new File = fopen ( SaveDataFile, "rt" )
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		trim ( Line );
		
		parse ( Line, Arg1, 31, Arg2, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			Points [ id ] = str_to_num ( Arg2 );
			IsPlayer = true;
			break;
		}
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		Points [ id ] = 0;
}


public SavePoints ( id )
{
	new ip[32];
	get_user_ip(id, ip, 31)
	new nume[32]
	get_user_name(id, nume, 31)
	
	new Save [ 1024 ];
	format ( Save, sizeof ( Save ) -1, "^"%s^" Puncte: %d Nume: %s", ip, Points [id], nume );
	
	new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
	
	new File = fopen ( SaveDataFile, "rt" );
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		
		parse ( Line, Arg1, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			write_file ( SaveDataFile, Save, Linie );
			IsPlayer = true;
			break;
		}
		
		Linie++
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		write_file ( SaveDataFile, Save, -1 );
}



pentru puncte pentru fiecare chestie modifici aici

Code: Select all

new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
pentru preturi modifici aici

Code: Select all

new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
pentru flag-uri modifici aici

Code: Select all

#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
E compatibil si cu Rehlds?
ImageImage
<< Tranzactii efectuate cu succes >>

Code: Select all

1. https://www.extreamcs.com/forum/security-zone/astaroth-tepar-t347242.html 

Code: Select all

2.https://www.extreamcs.com/forum/anunturi/dau-paysafecard-paypal-t355179.html
Vand frustrat la 10 euro. Pret negociabil
cs_all wrote: Atunci o sa-mi pun si eu admini sa vina sa iti faca reclama si nu doar 1 :middle_finger:
| Afiseaza codul
furien.kniferz.ro server intretinut din tepe, good job cs_all aka "bani de boost"
http://www.extreamcs.com/forum/security ... 55999.html
http://www.extreamcs.com/forum/security ... 55873.html
http://www.extreamcs.com/forum/security ... 55993.html
User avatar
robbencsgo
Membru, skill 0
Membru, skill 0
Posts: 69
Joined: 31 Aug 2019, 18:14
Detinator Steam: Da
CS Status: aimer
SteamID: an prevat
Fond eXtream: 0
Has thanked: 5 times
Been thanked: 9 times
Contact:

12 Jan 2020, 16:51

Astaroth wrote:
12 Jan 2020, 15:56
robbencsgo wrote:
12 Jan 2020, 14:53

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <csx>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

// PUNCTE
new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
////////////

// Preturi Grade
new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
/////////////////

///////////////
#define TAG	"[server]"
///////////////

// FLAG
#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
///////////////////////////

new Points [ 33 ];
new SaveDataFile [ 128 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event ( "DeathMsg", "eDeath", "a" );
	
	register_clcmd( "say /shop","Meniu" );
	register_clcmd( "say_team /shop", "Meniu");
	
	new DataDir [ 64 ];
	get_configsdir ( DataDir, charsmax ( DataDir ) );
	format ( SaveDataFile, 127, "%s/Points.dat", DataDir );
}

public plugin_natives ( )
{
	register_native ( "pl_get_user_points", "get_user_points", 1 );
	register_native ( "pl_set_user_points", "set_user_points", 1 );
}

public get_user_points ( id )
{
	return Points [ id ];
}

public set_user_points ( id, PointsNum )
{
	Points [ id ] = PointsNum;
}

public eDeath (id, level, cid)
{
	new Killer = read_data (1);
	new Victim = read_data (2);
	new headshot = read_data (3);
	
	new arma = get_user_weapon(Killer);
	
	if ( Killer == Victim )                           return PLUGIN_HANDLED;
	
	if (headshot)
	{	
		Points[Killer] += g_HeadShot;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_HeadShot;
		}
	}
	else if(arma == CSW_KNIFE)
	{
		Points[Killer] += g_Knife;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_Knife;
		}
	}
	else if(arma == CSW_HEGRENADE)
	{
		Points[Killer] += g_KillGrenada;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillGrenada;
		}
	}
	else
	{
		Points[Killer] += g_KillNormal;
		
		if(get_user_flags(id) & ADMIN_LEVEL_H)
		{
			Points[Killer] += g_KillNormal;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public bomb_planted(planter)
{
	Points[planter] += g_Plant;
	
	if(get_user_flags(planter) & ADMIN_LEVEL_H)
	{
		Points[planter] += g_Plant;
	}
}
public bomb_defused(defuser)
{
	if(get_user_flags(defuser) & ADMIN_LEVEL_H)
	{
		Points[defuser] += g_Defuse;
	}
	Points[defuser] += g_Defuse;
}

 public Meniu( id )
 {

    new menu = menu_create( "\rMeniu Grade:", "menu_handler" );

    menu_additem( menu, "\rManager \w- \y%s", "", g_pretManager );
    menu_additem( menu, "\rGod \w- \y%s", "", 0, g_pretGod );
    menu_additem( menu, "\rSuper-Mod \w- \y%s", "", 0, g_pretSMod);

    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );

    menu_display( id, menu, 0 );

 }

 public menu_handler( id, level, menu, item )
 {
	new ip[32]
	get_user_ip(id, ip, 31)
	
	switch( item )
	{
		case 0:
		{
			if(Points[id] >= g_pretManager)
			{
				Points[id] -= g_pretManager;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagManager)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Manager", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
           
		}
		case 1:
		{
			if(Points[id] >= g_pretGod )
			{
				Points[id] -= g_pretGod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagGod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04God", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else 
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
		case 2:
		{
			if(Points[id] >= g_pretSMod)
			{
				Points[id] -= g_pretSMod;
				server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"^" ^"ip^"", ip, flagSmod)
				ColorChat(id, GREEN, "%s ^01Ai achizitionat grad-ul de ^04Super-Moderator", TAG)
			}
			else if(get_user_flags(id) & ADMIN_RESERVATION)
			{
				ColorChat(id, GREEN, "%s ^01Ai deja un grad administrativ", TAG)
			}
			else
			{
				ColorChat(id, GREEN, "%s ^01Nu ai punctele necesare pentru a achizitiona grad-ul", TAG)
			}
		}
	}
	menu_destroy( menu );
	return PLUGIN_HANDLED;
 }

public client_connect ( id )
{
	LoadPoints ( id );
}

public client_disconnect ( id )
{
	SavePoints ( id );
}

public LoadPoints ( id )
{
	new ip [ 32 ];
	get_user_ip ( id, ip, 31 );
	
	new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ];
	new File = fopen ( SaveDataFile, "rt" )
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		trim ( Line );
		
		parse ( Line, Arg1, 31, Arg2, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			Points [ id ] = str_to_num ( Arg2 );
			IsPlayer = true;
			break;
		}
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		Points [ id ] = 0;
}


public SavePoints ( id )
{
	new ip[32];
	get_user_ip(id, ip, 31)
	new nume[32]
	get_user_name(id, nume, 31)
	
	new Save [ 1024 ];
	format ( Save, sizeof ( Save ) -1, "^"%s^" Puncte: %d Nume: %s", ip, Points [id], nume );
	
	new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]
	
	new File = fopen ( SaveDataFile, "rt" );
	while ( !feof ( File ) ) {
		fgets ( File, Line, 127 );
		
		parse ( Line, Arg1, 31 );
		
		if ( equali ( Arg1, ip ) ) {
			write_file ( SaveDataFile, Save, Linie );
			IsPlayer = true;
			break;
		}
		
		Linie++
	}
	
	fclose ( File );
	
	if ( !IsPlayer )
		write_file ( SaveDataFile, Save, -1 );
}



pentru puncte pentru fiecare chestie modifici aici

Code: Select all

new g_Plant = 1;
new g_Defuse = 1;
new g_KillNormal = 1;
new g_HeadShot = 1;
new g_Knife = 1;
new g_KillGrenada = 1;
pentru preturi modifici aici

Code: Select all

new g_pretManager = 25000
new g_pretGod = 23000
new g_pretSMod = 5000
pentru flag-uri modifici aici

Code: Select all

#define flagManager	"abcd"
#define flagGod		"abc"
#define flagSmod	"ab"
E compatibil si cu Rehlds?
nu stiu, dar ai putea sa incerci sa testezi tu, din ce ma gandesc eu ar trebui sa fie
Daca te-am ajutat, lasa si tu un +1
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3019
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 458 times
Contact:

21 Jan 2020, 18:59

dacă e HLDS e clar compatibil cu re, dar nu tot ce e re e comaptibil și cu hlds, unele funcții gen reapi având modificări la nume, ca să fie re=))
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz!
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent.
* Cumpăr orice tip de cont steam cu level 333 sau 666(nu contează vac status, sau jocurile)
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests