Modificare gloante arma.

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

03 Dec 2013, 20:47

Salut ! cum fac sa modific si gloantele din incarcatorul unei arme ? de exemplu eu vreau sa adaug la deagle 3 gloante si sa numai aiba in incarcator gloante,pur si simplu sa aiba 3 gloante acel deagle.Am incercat cateva metode si nu merge niciuna,la unele imi da erori in consola .Cine nu se pricepe sa nu faca +1 !
Rapidserver
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

03 Dec 2013, 21:34

Folosind functia asta :-? .. Cred :-??

Code: Select all

cs_set_weapon_ammo
Contact: Activitate scazuta.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

03 Dec 2013, 21:56

stiu de ea,dar nu stiu bine cum se aplica,am incercat eu si imi dadeau erori in consola ...
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

03 Dec 2013, 22:23

asa ai incercat?
| Afiseaza codul
new dg_arma= give_item(id, "weapon_deagle");
cs_set_weapon_ammo(dg_arma, 3);
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

04 Dec 2013, 16:16

Fatzzule esti un geniu,mersi :)

Cine imi spune si mie de ce apar erorile astea..sunt de la set_user_health,de ce dq imi apar ca la unele pluginuri merge perfect :|

Code: Select all

L 12/04/2013 - 16:14:47: [FUN] Invalid player 1
L 12/04/2013 - 16:14:47: [AMXX] Displaying debug trace (plugin "VipHnsUltimate.amxx")
L 12/04/2013 - 16:14:47: [AMXX] Run time error 10: native error (native "set_user_health")
L 12/04/2013 - 16:14:47: [AMXX]    [0] VipHnsUltimate.sma::fwHamPlayerSpawnPost (line 145)
EDIT1: Am rezolvat, rog T/C
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

05 Dec 2013, 17:43

Am alta problema,cea de mai sus era una minora uitasem ceva,acum au intrevenit aceste erori,de la ce sa fie ?

Code: Select all

L 12/05/2013 - 17:39:56: [CSTRIKE] Non-player entity -1 out of range
L 12/05/2013 - 17:39:56: [AMXX] Displaying debug trace (plugin "test.amxx")
L 12/05/2013 - 17:39:56: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 12/05/2013 - 17:39:56: [AMXX]    [0] test.sma::meniu_vip (line 95)
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

05 Dec 2013, 20:18

Verifica daca playerul este viu si conectat
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

05 Dec 2013, 20:21

Nu e vorba de asta,dar fi atent: deci eu am pus sa am acces de 3 ori pe runda la meniu,deci iau prima data deagle imi da cate gloante vreau daca aleg si a 2-a oara tot deagle imi da eroarea aia si nu imi da tot 2 gloante imi da 7 :| si apar si erorile alea..
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

05 Dec 2013, 20:22

Posteaza pluginu ... ca altfel nu am cum sa te ajut
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

05 Dec 2013, 20:24

| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>

#define PLUGIN "Vip Hns"
#define VERSION "1.1"
#define AUTHOR "C0sm1N"
#define nr_maxim 3 // de aici modifici de cate ori sa poata folosii /vipmenu pe runda !

new g_iRunda[ 33 ];
new gmsgSayText
new iTask = 112112
static const COLOR[] = "^x04"

public plugin_init () {
	register_plugin ("PLUGIN", "VERSION", "AUTHOR");
	register_clcmd ("say /vipmenu","HnsVip");
	register_event("HLTV", "roundstart", "a", "1=0", "2=0")
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
	register_clcmd("say /vips","showvips")
	gmsgSayText = get_user_msgid("SayText");
	register_event("ResetHUD", "ev_resethud", "be")
}
public HnsVip ( id )
{
	if (Vip(id))
	{
		ShowMenu(id);
	}
	else
	{
		chat_color(id, "!g[VIP] !yNu ai acces la /vipmenu,cumpara vip !")
	}
}
public roundstart( )
{
	new iPlayers[ 32 ], iNum;
	
	get_players( iPlayers, iNum, "c" );
	
	for( new i = 0; i < iNum; i++ )
	{
		g_iRunda[ iPlayers[ i ] ] = 0;
	}
}
public ShowMenu ( id )
{
	if(g_iRunda[id] >= nr_maxim)
	{
		chat_color(id,"!g[VIP] !yAi folosit de %i ori aceasta comanda, !teamasteapta pana runda urmatoare.",nr_maxim);
		return 1;
	}
	
	if (!is_user_alive ( id ) || is_user_bot ( id ))
		return 1;
	
	static menu;
	menu = menu_create ("\ Meniu vip","meniu_vip");
	
	menu_additem ( menu,"\g Deagle \r[2Gloante]","1", 0 );
	menu_additem ( menu,"\g Invizibilitate \r[15 Secunde]","2", 0 );
	menu_additem ( menu,"\g Gravitatie \r[10 Secunde]","3", 0 );
	menu_additem ( menu,"\g GodMode \r[10 Secunde]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	g_iRunda[id]++
	
	menu_display ( id, menu, 0 );
	return 0;
}
public meniu_vip ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			chat_color(id,"!g[MeniuVip] !yTi-ai ales !teamdeagle cu !y2 gloante.")
			
			give_item( id, "weapon_deagle" );
			
			new ent = find_ent_by_owner( -1, "weapon_deagle", id );
			
			if( ent ) 
			{
				cs_set_weapon_ammo( ent, 2 );
			}
		}
		case 2:
		{
			chat_color(id,"!g[MeniuVip] !yTi-ai ales !teaminvizibilitate !y10 secunde.")
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0);  
			set_task(15.0, "remove_invizibility",id);  
		} 
		case 3:
		{
			chat_color(id,"!g[MeniuVip] !yTi-ai ales !teamgravitatie !y10 secunde.")
			set_user_gravity( id, 0.6 );
			set_task(10.0, "remove_gravity",id);
		}
		case 4:
		{
			chat_color(id,"!g[MeniuVip] !yTi-ai ales !teamGodMode !y10 secunde.")
			set_user_godmode ( id, 1 );
			set_task ( 10.0,"remove_godmode", id );
		}
	}
	menu_destroy ( menu );
	return 1;
}
public remove_invizibility(id){
	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);  
	chat_color(id, "!g[MeniuVip] !yTi-a expirat !teaminvizibilitatea.")
} 
public remove_gravity(id){
	set_user_gravity( id, 1.0 );
	chat_color(id, "!g[MeniuVip] !yTi-a expirat !teamgravitatia.")
}
public remove_godmode(id){
	set_user_godmode ( id, 0 );
	chat_color(id, "!g[MeniuVip] !yTi-a expirat !teamgodmode-ul.")
}
public fwHamPlayerSpawnPost(id) {
	if (Vip(id) && is_user_alive(id))
	{
		set_user_health(id, get_user_health(id) + 25)
		give_item ( id,"weapon_hegrenade" );
		give_item ( id,"weapon_flashbang" );
		give_item ( id,"weapon_flashbang" );
		give_item ( id,"weapon_smokegrenade" );
		g_iRunda[ id ] = false
	}                     
}
stock bool:Vip(id)
{
	if(get_user_flags(id) & read_flags("t"))
		return true
	
	return false;
}
public client_putinserver( id )
{
	if(Vip(id))
	{
		new name[32]
		get_user_name(id,name,31)
		chat_color(0, "!team[VIP]!g%s !yse conecteaza !",name)
	}
}
public client_disconnect(id)
{
	if(Vip(id))
	{
		new name[32]
		get_user_name(id,name,31)
		chat_color(0,"!team[VIP]!g%s a iesit dupa server",name)
	}
}
public ev_resethud(id)
{
	set_task(1.0,"tabscore1",id + iTask)
}
public tabscore1( taskid )
{
	new id = taskid - iTask
	
	if(Vip(id) && is_user_connected(id))
	{
		message_begin( MSG_ALL, get_user_msgid("ScoreAttrib") )
		
		write_byte( id )
		write_byte( 4 )
		message_end( )
	}
}
public showvips(user) 
{
	new adminnames[33][32]
	new message[256]
	new id, count, x, len
	new maxplayers = get_maxplayers()
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
		if(Vip(id))
		get_user_name(id, adminnames[count++], 31)
	
	len = format(message, 255, "%s VIP ONLINE: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No VIP online.")
		print_message(user, message)
	}
}

print_message(id, msg[]) {
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}

stock chat_color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!team", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
			write_byte(players);
			write_string(msg);
			message_end();
		}
	}
}
}

Aici m-a ajutat cruyff si numai da erori dar daca imi aleg din meniu prima oara imi da 2 gloante daca le trag pe alea 2 gloante si imi aleg iar imi da tot 2 gloante, iar daca nu trag gloantele si imi aleg iar din meniu imi da 7 gloante =]] pff nu stiu daca ai inteles bine..
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

06 Dec 2013, 18:09

Sus cu acest topic,am nevoie..
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

07 Dec 2013, 13:20

Solutia :

Code: Select all

                        cs_set_weapon_ammo(give_item(id, "weapon_deagle"), 3)
                        cs_set_user_bpammo(id, CSW_DEAGLE, 0);

EDIT

draga cosmyn cand vezi errorile cu "debug" in consola incearca sa le citesti si sa le rezolvi dupa tutorialul asta
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests