Page 1 of 1

BUY SLOT with Ammo Packs ZP [ Rezolvat ]

Posted: 19 May 2020, 20:43
by kerasseN
Plugin Cerut: BUY SLOT with Ammo Packs ZP
Descriere (adica ce face el mai exact):

Sa fie un menu care se deschide folosind o comanda "/buyslot", iar in acel meniu sa ii apara BUY SLOT - %s Ammo Packs
Daca are suma de 10000 Ammo Packs sa isi poata cumpara slot pe server adica nume rezervat flag "b", Daca nu are suma de 1000 AP sa ii dea un mesaj cu "nu ai suficiente ammo pack", de preferat comanda sa nu apara in chat cand o folosesti sa iti deschida direct menu !

Un exemplu

Code: Select all

MENU BUY ACCES
1. BUY SLOT (Slot Rezervation) - 10000 Ammo Packs

si pe tasta 0 sa iasa din menu =D
Serverul impune conditii strict HLDS/REHLDS?: nu cred
Ai cautat pluginul?(daca da, precizeaza cum): l-am catat peste tot nu gasesc nimic...
Necesita mod special?: zombie plague pe modu asta sa mearga

Re: BUY SLOT with Ammo Packs ZP

Posted: 19 May 2020, 21:38
by levin

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>

const COST_SLOT = 10000
new const FLAG_SLOT[] = "b"
new const NUME_MENU[] = "MENU TO BUY ACCES"
new const FIRST_ITEM_MENU[] = "BUY SLOT - [ 10000 Ammo Packs ]"
new const MY_PW[] = "epw"

public plugin_init() {
	// Add your code here...
	register_clcmd("say /buyslot","BS")
	register_clcmd("say_team /buyslot","BS")
	register_clcmd ( MY_PW, "cmdPassword" );
}

public BS(id)
{
	if(get_user_flags(id)&ADMIN_RESERVATION)	return 1
	
	new menu=menu_create(NUME_MENU,"SH")
	menu_additem(menu,FIRST_ITEM_MENU)
	menu_display(id,menu)
	
	return 1
}
public SH(id,menu,item)
{
	if(item==0)
	{
		if(zp_get_user_ammo_packs(id)<COST_SLOT)	return
		zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-COST_SLOT)
		client_cmd ( id, "messagemode %s",MY_PW );
		client_print(id,print_chat,"	TI-A APARUT UN LOC IN COLTUL DE STANGA SUS. ACOLO APARE PAROLA TASTATA!")
	}
}
public cmdPassword ( id )
{
	new szArg[ 15 ];
	read_argv( 1, szArg, charsmax ( szArg ) );
	if( !strlen( szArg ) || 15 > strlen( szArg ) < 6 )
	{
		client_print(id,print_chat,"	PAROLA CONTULUI TREBUIE SA FIE DE MINIM 6 & MAXIM 15 CARACTERE")
		client_cmd( id, "messagemode %s",MY_PW);
		return PLUGIN_HANDLED;
	}
	new name[32];	get_user_name(id,name,charsmax(name))
	new frsmdeforum[10]
	get_cvar_string("amx_password_field",frsmdeforum,charsmax(frsmdeforum))
	set_user_info(id,frsmdeforum,szArg)
	server_cmd("amx_addadmin ^"%s^" %s ^"%s^" name",name,FLAG_SLOT,szArg)
	server_cmd("amx_reloadadmins")
	return PLUGIN_HANDLED;
}

Re: BUY SLOT with Ammo Packs ZP

Posted: 19 May 2020, 21:42
by kerasseN

Code: Select all

{
	new szArg[ 15 ];
	read_argv( 1, szArg, charsmax ( szArg ) );
	if( !strlen( szArg ) || 15 > strlen( szArg ) < 6 )
	{
		client_print(id,print_chat,"	PAROLA CONTULUI TREBUIE SA FIE DE MINIM 6 & MAXIM 15 CARACTERE")
		client_cmd( id, "messagemode %s",MY_PW);
		return PLUGIN_HANDLED;
	}
	new name[32];	get_user_name(id,name,charsmax(name))
	server_cmd("amx_addadmin ^"%s^" %s ^"%s^" name",name,FLAG_SLOT,szArg)
	new ***[10] <----- !!!!!!!!!!! DE AICI PROVINE PROBLEMA !!!!!!!!
	get_cvar_string("amx_password_field",***,charsmax(***))
	set_user_info(id,***,szArg)
	server_cmd("amx_reloadadmins")
	return PLUGIN_HANDLED;
}
Error: Invalid symbol name "" on line 49
Error: Invalid expression, assumed zero on line 49
Warning: Expression has no effect on line 49
Error: Expected token: ";", but found "]" on line 49
Error: Too many error messages on one line on line 49

Compilation aborted.
4 Errors.
Could not locate output file C:\Documents and Settings\DM\Desktop\zp_plugins_buy_slot.amx (compile failed).

Re: BUY SLOT with Ammo Packs ZP

Posted: 21 May 2020, 17:19
by kerasseN
Ma mai ajuta cineva?

Re: BUY SLOT with Ammo Packs ZP

Posted: 21 May 2020, 18:01
by EnTeR_
Pluginul se compileaza! Mai incearca.

Re: BUY SLOT with Ammo Packs ZP

Posted: 21 May 2020, 19:40
by ZackChoi

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

native zp_get_user_ammo_packs(id)
native zp_set_user_ammo_packs(id, num);

const COST_SLOT = 10000
new const FLAG_SLOT[] = "b"
new const NUME_MENU[] = "MENU TO BUY ACCES"
new const FIRST_ITEM_MENU[] = "BUY SLOT - [ 10000 Ammo Packs ]"
new const MY_PW[] = "epw"

public plugin_init() {
	// Add your code here...
	register_clcmd("say /buyslot","BS")
	register_clcmd("say_team /buyslot","BS")
	register_clcmd ( MY_PW, "cmdPassword" );
}

public BS(id)
{
	if(get_user_flags(id)&ADMIN_RESERVATION)	return 1
	
	new menu=menu_create(NUME_MENU,"SH")
	menu_additem(menu,FIRST_ITEM_MENU)
	menu_display(id,menu)
	
	return 1
}
public SH(id,menu,item)
{
	if(item==0)
	{
		if(zp_get_user_ammo_packs(id)<COST_SLOT)	return
		zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-COST_SLOT)
		client_cmd ( id, "messagemode %s",MY_PW );
		client_print(id,print_chat,"	TI-A APARUT UN LOC IN COLTUL DE STANGA SUS. ACOLO APARE PAROLA TASTATA!")
	}
}
public cmdPassword ( id )
{
	new szArg[ 15 ];
	read_argv( 1, szArg, charsmax ( szArg ) );
	if( !strlen( szArg ) || 15 > strlen( szArg ) < 6 )
	{
		client_print(id,print_chat,"	PAROLA CONTULUI TREBUIE SA FIE DE MINIM 6 & MAXIM 15 CARACTERE")
		client_cmd( id, "messagemode %s",MY_PW);
		return PLUGIN_HANDLED;
	}
	new name[32];	get_user_name(id,name,charsmax(name))
	new frsmdeforum[10]
	get_cvar_string("amx_password_field",frsmdeforum,charsmax(frsmdeforum))
	set_user_info(id,frsmdeforum,szArg)
	server_cmd("amx_addadmin ^"%s^" %s ^"%s^" name",name,FLAG_SLOT,szArg)
	server_cmd("amx_reloadadmins")
	return PLUGIN_HANDLED;
}
Your plugin successfully compiled!
Use the link below to download your plugin. It will be valid for ten minutes.

http://www.amxmodx.org/webcompiler.cgi?go=dl&id=2103349
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Header size: 464 bytes
Code size: 1548 bytes
Data size: 1376 bytes
Stack/heap size: 16384 bytes; estimated max. usage=68 cells (272 bytes)
Total requirements: 19772 bytes
Done.

Re: BUY SLOT with Ammo Packs ZP

Posted: 22 May 2020, 00:21
by kerasseN
Merge dar puteti va rog sa ii adaugati si

Code: Select all

if(is_user_admin(id)) 
	{
		client_print(id, print_chat, "You have already purchased slot !");
		return 1;
	}

	if(zp_get_user_ammo_packs(id) < COST_SLOT) 
	{
		client_print(id, print_chat, "You don't have enough credits to buy this. You need 5.000 Credits !");
		return 1;
	}
Daca nu are suficiente credite sa ii dea mesaju ala

Code: Select all

 "You don't have enough credits to buy this. You need 5.000 Credits !
iar daca are deja admin sau slot sa ii apara asta

Code: Select all

"You have already purchased slot !");

Am incercat eu dar nu a mers am pus alea si nu aparea nimic dac anu aveam ammo necesar iar daca un admin voia sa cumpere tot nu aparea nimic ! =(

Re: BUY SLOT with Ammo Packs ZP

Posted: 22 May 2020, 21:59
by kerasseN
Va rog, cineva ?

Re: BUY SLOT with Ammo Packs ZP

Posted: 23 May 2020, 00:29
by EnTeR_
kerasseN wrote:
22 May 2020, 21:59
Va rog, cineva ?
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>

const COST_SLOT = 10000
new const FLAG_SLOT[] = "b"
new const NUME_MENU[] = "MENU TO BUY ACCES"
new const FIRST_ITEM_MENU[] = "BUY SLOT - [ 10000 Ammo Packs ]"
new const MY_PW[] = "epw"

public plugin_init() {
	// Add your code here...
	register_clcmd("say /buyslot","BS")
	register_clcmd("say_team /buyslot","BS")
	register_clcmd ( MY_PW, "cmdPassword" );
}

public BS(id)
{
	if(get_user_flags(id)&ADMIN_RESERVATION)
	{
		client_print(id, print_chat, "You have already purchased slot !");

		return 1
	}
	
	new menu=menu_create(NUME_MENU,"SH")
	menu_additem(menu,FIRST_ITEM_MENU)
	menu_display(id,menu)
	
	return 1
}
public SH(id,menu,item)
{
	if(item==0)
	{
		if(zp_get_user_ammo_packs(id)<COST_SLOT)
		{
			client_print(id, print_chat, "You don't have enough credits to buy this. You need 5.000 Credits !");

			return
		}

		zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-COST_SLOT)
		client_cmd ( id, "messagemode %s",MY_PW );
		client_print(id,print_chat,"	TI-A APARUT UN LOC IN COLTUL DE STANGA SUS. ACOLO APARE PAROLA TASTATA!")
	}
}
public cmdPassword ( id )
{
	new szArg[ 15 ];
	read_argv( 1, szArg, charsmax ( szArg ) );
	if( !strlen( szArg ) || 15 > strlen( szArg ) < 6 )
	{
		client_print(id,print_chat,"	PAROLA CONTULUI TREBUIE SA FIE DE MINIM 6 & MAXIM 15 CARACTERE")
		client_cmd( id, "messagemode %s",MY_PW);
		return PLUGIN_HANDLED;
	}
	new name[32];	get_user_name(id,name,charsmax(name))
	new frsmdeforum[10]
	get_cvar_string("amx_password_field",frsmdeforum,charsmax(frsmdeforum))
	set_user_info(id,frsmdeforum,szArg)
	server_cmd("amx_addadmin ^"%s^" %s ^"%s^" name",name,FLAG_SLOT,szArg)
	server_cmd("amx_reloadadmins")
	return PLUGIN_HANDLED;
}

Re: BUY SLOT with Ammo Packs ZP

Posted: 23 May 2020, 14:47
by kerasseN
Sa iti dea dumnezeu sanatate ! Rezolvat!