←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Natywy - prośba o zrobienie, oraz XP blo0ck

Zablokowany

ogury - zdjęcie ogury 15.09.2011

W załączniku expmod, prosiłbym o zrobienie natywów i pliku expmod.inc (są już zrobione w expmodzie, trzeba tylko stworzyć ExpMod.inc)

Proszę także o dopasowanie XPBlocka.

ActionXPBlock(id, ent)
{
		if ( !g_xpblock_used[id] )
		{
			new property[5];
			GetProperty(ent, 1, property);
			set_hudmessage(0, 255, 0, 0.01, 0.18, 0, 0.0, 1.0, 0.25, 0.25, 2);
			show_hudmessage(0, "Gracz zdobyl %i XP na blocku!", str_to_num(property));
	   exp_set_user_xp(id, exp_get_user_xp(id) + exp_set_user_xp(id, property));
			g_xpblock_used[id] = true;
		}
}

public plugin_natives()
{
	register_library("ExpMod");
	register_native("exp_get_user_exp", "_get_exp");
	register_native("exp_set_user_exp", "_set_exp");
}
Załączony plik  expmod.sma   143,72 KB   38 Ilość pobrań
Użytkownik AX!S edytował ten post 15.09.2011 15:02
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

Nie musisz dodawać do pliku .inc
Wystarczy że dasz natywy do BlockMakera na początek takie:

Powinno działać (bo z bollnasa):

native exp_get_user_exp(client);
 
native exp_set_user_exp(client, xp);
 
stock exp_add_user_exp(client, xp)
{
	return exp_set_user_exp(client, exp_get_user_exp(client) + xp);
}
 
stock exp_set_user_exp(client, xp)
{
	return exp_set_user_exp(client, exp_get_user_expclient) - xp);
}

@@Gdyż widzę że masz w expmodzie.
Jeśli nie o to chodzi to napisz to zrobię.

Plik inc.

#if defined _expmod_included
#endinput
#endif
#define _expmod_included
#include <amxmodx>
native exp_get_user_exp(client);
native exp_set_user_exp(client, xp);
stock exp_add_user_exp(client, xp)
{
return exp_set_user_exp(client, exp_get_user_exp(client) + xp);
}
stock exp_set_user_exp(client, xp)
{
return exp_set_user_exp(client, exp_get_user_expclient) - xp);
}

Pierwszy raz pisałem moduł inc
Użytkownik Skull3D edytował ten post 15.09.2011 15:38
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

Próbowałem tak, a co dać w Actionie?
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

To pierwsze co podałem dodaj do blockmakera a reszta jest chyba dobrze

Na początek pluginu:
native exp_get_user_exp(client);
 
native exp_set_user_exp(client, xp);
 
stock exp_add_user_exp(client, xp)
{
        return exp_set_user_exp(client, exp_get_user_exp(client) + xp);
}
 
stock exp_set_user_exp(client, xp)
{
        return exp_set_user_exp(client, exp_get_user_expclient) - xp);
}
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

Zamiast client nie powinno być id?
W tej postaci nie chce się skompilować.
Użytkownik AX!S edytował ten post 15.09.2011 17:04
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

Nie, ja tak miałem w swoim a w actionie id
Więc zostaw tak.
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

ActionXPBlock(id, ent)
{
			    if ( !g_xpblock_used[id] )
			    {
					    new property[5];
					    GetProperty(ent, 1, property);
					    set_hudmessage(0, 255, 0, 0.01, 0.18, 0, 0.0, 1.0, 0.25, 0.25, 2);
					    show_hudmessage(0, "Gracz zdobyl %i XP na blocku!", str_to_num(property));
                        exp_add_user_xp(id, property));
					    g_xpblock_used[id] = true;
Imo bedzie dzialac?
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

z bcm'a

ActionXPBlock(id, ent)
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
  if ( !g_xpblock_used[id] )
  {
   new property[5];
   GetProperty(ent, 1, property);
   hnsxp_add_user_xp(id, str_to_num(property));
   g_xpblock_used[id] = true;
  
   set_hudmessage(0, 255, 0, 0.01, 0.18, 0, 0.0, 1.0, 0.25, 0.25, 2);
   show_hudmessage(id, "You got %i more XP!", str_to_num(property));
  }
}
  else
  {
   set_hudmessage(0, 255, 0, 0.01, 0.18, 0, 0.0, 1.0, 0.25, 0.25, 2);
   show_hudmessage(id, "Only Terrorists can take XP Block!");
}
}
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

Ale hnsxp_add_user_xp jest do ExpModa by exolent. Ja chce do ExpModa by funfel, gdzie są komendy:
exp_get_user_exp
exp_set_user_exp
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

To możesz sobie w expmodzie funfla zmienić

exp_get_user_exp

na:

hnsxp_add_user_xp

i reszte.
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

Raczej to nie jest sposób.
Odpowiedz

Skull3D - zdjęcie Skull3D 15.09.2011

Jest bo ja mialem tak i zmienilem aby nazwy natywow z expmoda funfla .f
Odpowiedz

ogury - zdjęcie ogury 15.09.2011

Działa, do zamknięcia.
Odpowiedz
Zablokowany