Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

vipmod


  • Zamknięty Temat jest zamknięty
7 odpowiedzi w tym temacie

#1 patryk006

    Zaawansowany

  • Użytkownik

Reputacja: 6
Nowy

  • Postów:126
  • Lokalizacja:Warszawa
Offline

Napisano 11.10.2009 14:08

witam mam takie problemy :

L 10/11/2009 - 15:07:31: [FUN] Invalid player 1
L 10/11/2009 - 15:07:31: [AMXX] Displaying debug trace (plugin vipmod.amxx)
L 10/11/2009 - 15:07:31: [AMXX] Run time error 10: native error (native give_item)
L 10/11/2009 - 15:07:31: [AMXX] [0] vipmod.sma::player_spawn (line 72)

plugin w załączniku ;)

Załączone pliki


  • +
  • -
  • 0

#2 naven

    Hero

  • Power User

Reputacja: 200
Profesjonalista

  • Postów:1088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 11.10.2009 14:42

Zobacz
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define DAMAGE_RECIEVED

new g_CfgLoc[128];
new g_FileLoc[512];

new bool:isVip[33];

new vipType[15][33];

new part1[240];

new g_MsgSync;

#if defined DAMAGE_RECIEVED 
new g_MsgSync2;
#endif 

public plugin_init()
{
	register_plugin("plugin", "1.0", "darkman");
	RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
	register_event("DeathMsg", "eventDeathMsg", "a");
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0");
	register_concmd("say", "sayHook");
	register_concmd("say vips", "onVip");
	g_MsgSync = CreateHudSyncObj();
	
	#if defined DAMAGE_RECIEVED 
	g_MsgSync2 = CreateHudSyncObj();
	#endif 
}

public client_connect(id)
{
	new nick[35]
	get_user_name(id,nick,34)
	get_configsdir(g_CfgLoc, 127);
	formatex(g_FileLoc, 511, "%s/vip_list.ini", g_CfgLoc);
	if(file_exists(g_FileLoc))
	{
		new Line[256], Len;
		for(new i = 0; read_file(g_FileLoc, i, Line, 511, Len); i++)
		{
			if(Line[0] == ';')
				continue;
			parse(Line, part1, 239, vipType[id], 14);
			if(equal(part1, nick))
			{
				isVip[id] = true;
				parse(Line, part1, 239, vipType[id], 14);
				break;
			}
			
		}
		
	}
}

public player_spawn(id)
{
	if(is_user_connected(id)){
	if(isVip[id])
	{
		//set_user_flags(id, ADMIN_CHAT);
		if(equal(vipType[id], "gold"))
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_mp5navy");
			return HAM_IGNORED;
		}
		if(equal(vipType[id], "silver"))
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			return HAM_IGNORED;
		}
		if(equal(vipType[id], "brown"))
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "item_assaultsuit");
			return HAM_IGNORED;
		}
		return HAM_IGNORED;
	}
}
	return HAM_IGNORED;
}

public eventDeathMsg()
{
	new id = read_data(1);
	new hs = read_data(3);
	if(isVip[id])
	{
		if(equal(vipType[id], "gold"))
		{
			hs ? cs_set_user_money(id, cs_get_user_money(id) + 500, 1) : cs_set_user_money(id, cs_get_user_money(id) + 350, 1);
			return PLUGIN_CONTINUE;
		}
		if(equal(vipType[id], "silver"))
		{
			hs ? cs_set_user_money(id, cs_get_user_money(id) + 300, 1) : cs_set_user_money(id, cs_get_user_money(id) + 200, 1);
			return PLUGIN_CONTINUE;
		}
		if(equal(vipType[id], "brown"))
		{
			hs ? cs_set_user_money(id, cs_get_user_money(id) + 150, 1) : cs_set_user_money(id, cs_get_user_money(id) + 100, 1);
			return PLUGIN_CONTINUE;
		}
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_CONTINUE;
}


public on_damage(id) 
{
	if(isVip[id])
	{
		
		new attacker = get_user_attacker(id) 
		
		#if defined DAMAGE_RECIEVED 
		// id should be connected if this message is sent, but lets check anyway 
		if ( is_user_connected(id) && is_user_connected(attacker) ) 
		{ 
			new damage = read_data(2) 
			
			set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) 
			ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage) 
			#else 
			if ( is_user_connected(attacker) ) 
			{ 
				new damage = read_data(2) 
				#endif 
				set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) 
				ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage) 
			} 
		}
	}
	
	
	public client_disconnect(id)
	{
		isVip[id] = false;
		vipType[id] = "";
	}
	
	public sayHook(id)
	{
		new arg[256];
		read_argv(1, arg, 255);
		if(isVip[id] && contain(arg, "@") != -1)
		{
			return PLUGIN_HANDLED;
		}
		return PLUGIN_CONTINUE;
	}
	
	public print_viplist(user) 
	{
		new vipnames[33][32]
		new message[256]
		new id, count, x, len
		
		for(id = 1 ; id <= get_maxplayers() ; id++)
			if(is_user_connected(id))
				if(isVip[id])
					get_user_name(id, vipnames[count++], 31)
				
		len = format(message, 255, "^x04 VIPOWIE ONLINE: ")
		if(count > 0) {
			for(x = 0 ; x < count ; x++) {
				len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")
				if(len > 96 ) {
					print_message(user, message)
					len = format(message, 255, "^x04")
				}
			}
			print_message(user, message)
		}
		else {
			len += format(message[len], 255-len, "No admins online.")
			print_message(user, message)
		}
		
	}
	
	
	print_message(id, msg[]) {
		message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
		write_byte(id)
		write_string(msg)
		message_end()
	}
	
public onVip(id)
{
	print_viplist(id);
	return PLUGIN_HANDLED;
}

  • +
  • -
  • 0

#3 patryk006

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:126
  • Lokalizacja:Warszawa
Offline

Napisano 11.10.2009 18:05

ok dzięki , na razie nic nie ma , a jeszcze jedno bo jak dostaję to mp5 lub d.eagle to mam 2 bronie , np. 1 runda w terro mam mp5 , eagle i glocka
  • +
  • -
  • 0

#4 naven

    Hero

  • Power User

Reputacja: 200
Profesjonalista

  • Postów:1088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 11.10.2009 18:22

#include <amxmodx>

#include <amxmisc>

#include <hamsandwich>

#include <fun>

#include <cstrike>



#define DAMAGE_RECIEVED



new g_CfgLoc[128];

new g_FileLoc[512];



new bool:isVip[33];



new vipType[15][33];



new part1[240];



new g_MsgSync;



#if defined DAMAGE_RECIEVED

new g_MsgSync2;

#endif



public plugin_init()

{

	register_plugin("plugin", "1.0", "darkman");

	RegisterHam(Ham_Spawn, "player", "player_spawn", 1);

	register_event("DeathMsg", "eventDeathMsg", "a");

	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0");

	register_concmd("say", "sayHook");

	register_concmd("say vips", "onVip");

	g_MsgSync = CreateHudSyncObj();

	

	#if defined DAMAGE_RECIEVED

	g_MsgSync2 = CreateHudSyncObj();

	#endif

}



public client_connect(id)

{

	new nick[35]

	get_user_name(id,nick,34)

	get_configsdir(g_CfgLoc, 127);

	formatex(g_FileLoc, 511, "%s/vip_list.ini", g_CfgLoc);

	if(file_exists(g_FileLoc))

	{

		new Line[256], Len;

		for(new i = 0; read_file(g_FileLoc, i, Line, 511, Len); i++)

		{

			if(Line[0] == ';')

				continue;

			parse(Line, part1, 239, vipType[id], 14);

			if(equal(part1, nick))

			{

				isVip[id] = true;

				parse(Line, part1, 239, vipType[id], 14);

				break;

			}

			

		}

		

	}

}



public player_spawn(id)

{

	if(is_user_connected(id)){

		if(isVip[id])

		{

			//set_user_flags(id, ADMIN_CHAT);

			if(equal(vipType[id], "gold"))

			{

				strip_user_weapons(id)

				give_item(id, "weapon_hegrenade");

				give_item(id, "weapon_flashbang");

				give_item(id, "weapon_flashbang");

				give_item(id, "weapon_smokegrenade");

				give_item(id, "item_assaultsuit");

				give_item(id, "weapon_deagle");

				give_item(id, "weapon_mp5navy");

				return HAM_IGNORED;

			}

			if(equal(vipType[id], "silver"))

			{

				give_item(id, "weapon_hegrenade");

				give_item(id, "weapon_flashbang");

				give_item(id, "weapon_flashbang");

				give_item(id, "weapon_smokegrenade");

				give_item(id, "item_assaultsuit");

				return HAM_IGNORED;

			}

			if(equal(vipType[id], "brown"))

			{

				give_item(id, "weapon_hegrenade");

				give_item(id, "weapon_flashbang");

				give_item(id, "item_assaultsuit");

				return HAM_IGNORED;

			}

			return HAM_IGNORED;

		}

	}

	return HAM_IGNORED;

}



public eventDeathMsg()

{

	new id = read_data(1);

	new hs = read_data(3);

	if(isVip[id])

	{

		if(equal(vipType[id], "gold"))

		{

			hs ? cs_set_user_money(id, cs_get_user_money(id) + 500, 1) : cs_set_user_money(id, cs_get_user_money(id) + 350, 1);

			return PLUGIN_CONTINUE;

		}

		if(equal(vipType[id], "silver"))

		{

			hs ? cs_set_user_money(id, cs_get_user_money(id) + 300, 1) : cs_set_user_money(id, cs_get_user_money(id) + 200, 1);

			return PLUGIN_CONTINUE;

		}

		if(equal(vipType[id], "brown"))

		{

			hs ? cs_set_user_money(id, cs_get_user_money(id) + 150, 1) : cs_set_user_money(id, cs_get_user_money(id) + 100, 1);

			return PLUGIN_CONTINUE;

		}

		return PLUGIN_CONTINUE;

	}

	return PLUGIN_CONTINUE;

}





public on_damage(id)

{

	if(isVip[id])

	{

		

		new attacker = get_user_attacker(id)

		

		#if defined DAMAGE_RECIEVED

		// id should be connected if this message is sent, but lets check anyway

		if ( is_user_connected(id) && is_user_connected(attacker) )

		{

			new damage = read_data(2)

			

			set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)

			ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)

			#else

			if ( is_user_connected(attacker) )

			{

				new damage = read_data(2)

				#endif

				set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)

				ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)

			}

		}

	}

	

	

	public client_disconnect(id)

	{

		isVip[id] = false;

		vipType[id] = "";

	}

	

	public sayHook(id)

	{

		new arg[256];

		read_argv(1, arg, 255);

		if(isVip[id] && contain(arg, "@") != -1)

		{

			return PLUGIN_HANDLED;

		}

		return PLUGIN_CONTINUE;

	}

	

	public print_viplist(user)

	{

		new vipnames[33][32]

		new message[256]

		new id, count, x, len

		

		for(id = 1 ; id <= get_maxplayers() ; id++)

			if(is_user_connected(id))

			if(isVip[id])

			get_user_name(id, vipnames[count++], 31)

		

		len = format(message, 255, "^x04 VIPOWIE ONLINE: ")

		if(count > 0) {

			for(x = 0 ; x < count ; x++) {

				len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")

				if(len > 96 ) {

					print_message(user, message)

					len = format(message, 255, "^x04")

				}

			}

			print_message(user, message)

		}

		else {

			len += format(message[len], 255-len, "No admins online.")

			print_message(user, message)

		}

		

	}

	

	

	print_message(id, msg[]) {

		message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)

		write_byte(id)

		write_string(msg)

		message_end()

	}

	

	public onVip(id)

	{

		print_viplist(id);

		return PLUGIN_HANDLED;

	}

  • +
  • -
  • 0

#5 patryk006

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:126
  • Lokalizacja:Warszawa
Offline

Napisano 12.10.2009 16:30

a czemu jeszcze ten plugin dodał mi raz vipa którego nie ma O.o , nick Juras KLYRPLYRSZTYN , sprawdzałem 2 razy i nie mam w pliku
  • +
  • -
  • 0

#6 ...

    Wszechmogący

  • Zbanowany

Reputacja: 166
Profesjonalista

  • Postów:612
  • Lokalizacja:Jasło
Offline

Napisano 12.10.2009 17:51

dodaj na samym poczatku public client_connect(id)
isVip[id] = false;


#7 patryk006

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:126
  • Lokalizacja:Warszawa
Offline

Napisano 13.10.2009 16:12

teraz mam takie błędy :

L 10/13/2009 - 17:08:15: [AMXX] Displaying debug trace (plugin vipmod.amxx)
L 10/13/2009 - 17:08:15: [AMXX] Run time error 4: index out of bounds
L 10/13/2009 - 17:08:15: [AMXX] [0] vipmod.sma::client_connect (line 52)



i

L 10/13/2009 - 17:18:45: [AMXX] Displaying debug trace (plugin vipmod.amxx)
L 10/13/2009 - 17:18:45: [AMXX] Run time error 4: index out of bounds
L 10/13/2009 - 17:18:45: [AMXX] [0] vipmod.sma::client_disconnect (line 161)

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define DAMAGE_RECIEVED

new g_CfgLoc[128];
new g_FileLoc[512];

new bool:isVip[33];

new vipType[15][33];

new part1[240];

new g_MsgSync;

#if defined DAMAGE_RECIEVED
new g_MsgSync2;
#endif

public plugin_init()
{
    register_plugin("plugin", "1.0", "darkman");
    RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
    register_event("DeathMsg", "eventDeathMsg", "a");
    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0");
    register_concmd("say", "sayHook");
    register_concmd("say vips", "onVip");
    g_MsgSync = CreateHudSyncObj();
   
    #if defined DAMAGE_RECIEVED
    g_MsgSync2 = CreateHudSyncObj();
    #endif
}

public client_connect(id)
{
    isVip[id] = false
    new nick[40]
    get_user_name(id,nick,39)
    get_configsdir(g_CfgLoc, 127);
    formatex(g_FileLoc, 511, "%s/vip_list.ini", g_CfgLoc);
    if(file_exists(g_FileLoc))
    {
        new Line[256], Len;
        for(new i = 0; read_file(g_FileLoc, i, Line, 511, Len); i++)
        {
            if(Line[0] == ';')
                continue;
            parse(Line, part1, 239, vipType[id], 14);
            if(equal(part1, nick))
            {
                isVip[id] = true;
                parse(Line, part1, 239, vipType[id], 14);
                break;
            }
           
        }
       
    }
}

public player_spawn(id)
{
    if(is_user_connected(id)){
    if(isVip[id])
    {
        //set_user_flags(id, ADMIN_CHAT);
        if(equal(vipType[id], "gold"))
        {
            give_item(id, "weapon_hegrenade");
            give_item(id, "weapon_flashbang");
            give_item(id, "weapon_flashbang");
            give_item(id, "weapon_smokegrenade");
            give_item(id, "item_assaultsuit");
            give_item(id, "weapon_deagle");
            give_item(id, "weapon_mp5navy");
            return HAM_IGNORED;
        }
        if(equal(vipType[id], "silver"))
        {
            give_item(id, "weapon_hegrenade");
            give_item(id, "weapon_flashbang");
            give_item(id, "weapon_flashbang");
            give_item(id, "weapon_smokegrenade");
            give_item(id, "item_assaultsuit");
            return HAM_IGNORED;
        }
        if(equal(vipType[id], "brown"))
        {
            give_item(id, "weapon_hegrenade");
            give_item(id, "weapon_flashbang");
            give_item(id, "item_assaultsuit");
            return HAM_IGNORED;
        }
        return HAM_IGNORED;
    }
}
    return HAM_IGNORED;
}

public eventDeathMsg()
{
    new id = read_data(1);
    new hs = read_data(3);
    if(isVip[id])
    {
        if(equal(vipType[id], "gold"))
        {
            hs ? cs_set_user_money(id, cs_get_user_money(id) + 500, 1) : cs_set_user_money(id, cs_get_user_money(id) + 350, 1);
            return PLUGIN_CONTINUE;
        }
        if(equal(vipType[id], "silver"))
        {
            hs ? cs_set_user_money(id, cs_get_user_money(id) + 300, 1) : cs_set_user_money(id, cs_get_user_money(id) + 200, 1);
            return PLUGIN_CONTINUE;
        }
        if(equal(vipType[id], "brown"))
        {
            hs ? cs_set_user_money(id, cs_get_user_money(id) + 150, 1) : cs_set_user_money(id, cs_get_user_money(id) + 100, 1);
            return PLUGIN_CONTINUE;
        }
        return PLUGIN_CONTINUE;
    }
    return PLUGIN_CONTINUE;
}


public on_damage(id)
{
    if(isVip[id])
    {
       
        new attacker = get_user_attacker(id)
       
        #if defined DAMAGE_RECIEVED
        // id should be connected if this message is sent, but lets check anyway
        if ( is_user_connected(id) && is_user_connected(attacker) )
        {
            new damage = read_data(2)
           
            set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
            ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
            #else
            if ( is_user_connected(attacker) )
            {
                new damage = read_data(2)
                #endif
                set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
            }
        }
    }
   
   
    public client_disconnect(id)
    {
        isVip[id] = false;
        vipType[id] = "";
    }
   
    public sayHook(id)
    {
        new arg[256];
        read_argv(1, arg, 255);
        if(isVip[id] && contain(arg, "@") != -1)
        {
            return PLUGIN_HANDLED;
        }
        return PLUGIN_CONTINUE;
    }
   
    public print_viplist(user)
    {
        new vipnames[33][32]
        new message[256]
        new id, count, x, len
       
        for(id = 1 ; id <= get_maxplayers() ; id++)
            if(is_user_connected(id))
                if(isVip[id])
                    get_user_name(id, vipnames[count++], 31)
               
        len = format(message, 255, "^x04 VIPOWIE ONLINE: ")
        if(count > 0) {
            for(x = 0 ; x < count ; x++) {
                len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")
                if(len > 96 ) {
                    print_message(user, message)
                    len = format(message, 255, "^x04")
                }
            }
            print_message(user, message)
        }
        else {
            len += format(message[len], 255-len, "No admins online.")
            print_message(user, message)
        }
       
    }
   
   
    print_message(id, msg[]) {
        message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
        write_byte(id)
        write_string(msg)
        message_end()
    }
   
public onVip(id)
{
    print_viplist(id);
    return PLUGIN_HANDLED;
} 

  • +
  • -
  • 0

#8 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 13.10.2009 19:02

TO:
new vipType[15][33];
Zamien na:
new vipType[33][15];
Jak darkman mogl zrobic taki blad O.o
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych