←  Problemy z pluginami

AMXX.pl: Support AMX Mod X i SourceMod

»

Kompilacja pliku

  • +
  • -
DJTSUBA - zdjęcie DJTSUBA 23.09.2011

Witam chciałbym was prosić o pomoc przy próbie kompilacji pliku sma na amxx przy okazji powiedzenie jak to powinno wyglądać gdyż mam 19 sma identycznych do kompilacji a chciałbym wiedzieć jak to poprawnie wgrać aby następne samemu móc kompilować ale wracając pokaże wam zawartość pliku sma który chcę skompilować:


/*================================================================================
Human Test
================================================================================*/

#include <amxmodx>
#include <fakemeta>


// Human Attributes
new const hclass_name[] = { "Barry" } // name
new const hclass_info[] = { "AK-47 and low gravity" } // description
new const hclass_model[] = { "Barry" } // model
new const hclass_weapon[] = { weapon_glock18 } // weapon
const hclass_health = 100 // health
const hclass_speed = 170 // speed
const Float:hclass_gravity = 0.85 // gravity
const hclass_level = 1 // level required to use

// Class IDs
new g_hclassid

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
new registerText[32]
formatex( registerText, sizeof registerText - 1, "[ZPXP] %s human", hclass_name)

register_plugin(registerText, "1.0", "Example")

// Register the new class and store ID for reference
g_hclassid = zpxp_register_human_class(hclass_name, hclass_info, hclass_model, hclass_weapons, hclass_health, hclass_speed, hclass_gravity, hclass_level)

if(g_hclassid == -1)
{
server_print("[ZPXP] You have not properly setup your Zombie XP Mod.");
}
}

// User Infected forward
public zp_user_infected_post(id, infector)
{
// Check if the infected player is using our custom zombie class
if (zp_get_user_human_class(id) != g_hclassid) return;

// Undo any settings we have saved here

}

public zp_user_humanized_post(id)
{
// Check if the infected player is using our custom zombie class
if (zp_get_user_human_class(id) != g_hclassid) return;

// User turned human
if (zp_get_user_survivor(id) == 1)
{
// He's survivor, remove any changes made in the plugin
zp_user_infected_post(id, 0)
} else {
zp_round_started_human(id)
}
}

//This is a forward from zpxp, as opposed to ZPs round_start (which is when infection begins) this is the true beginning of the round
public zp_round_started_human(id)
{
if (zp_get_user_human_class(id) != g_hclassid) return;

// Set our human's powers!

}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/



Lecz gdy chcę skompilować na amxx pojawiają się następujące błędy :(:

/tmp/textgRBtqQ.sma(31) : error 017: undefined symbol "zpxp_register_human_class"
/tmp/textgRBtqQ.sma(43) : error 017: undefined symbol "zp_get_user_human_class"
/tmp/textgRBtqQ.sma(52) : error 017: undefined symbol "zp_get_user_human_class"
/tmp/textgRBtqQ.sma(55) : error 017: undefined symbol "zp_get_user_survivor"
/tmp/textgRBtqQ.sma(67) : error 017: undefined symbol "zp_get_user_human_class"
/tmp/textgRBtqQ.sma(74) : warning 203: symbol is never used: "hclass_weapon"

Mógłby ktoś pomóc mi tą kompilacją :(? Będę bardzo wdzięczny za pomoc i z góry dziękuję
Odpowiedz

  • +
  • -
SeeK - zdjęcie SeeK 23.09.2011

Dosyć dużo problemów tutaj jest. Po pierwsze nie ma załadowanych dwóch bibliotek:
zombieplague.inc
zombiexp.inc
Po drugie w bodajże 12 linijce
new const hclass_weapon[] = { weapon_glock18 } // weapon
Broń musi być albo zadeklarowana w cudzysłowu
"weapon_glock18"
albo w innej formie tj.
CSW_GLOCK18
Nie wiem, która jest poprawna, więc przetestuj dwie.

Po trzecie w linijce 55
zp_user_infected_post(id, 0)
Jest podane za mało argumentów. Chociaż według tego co podpowiada kompilator dwa powinny wystarczyć
zp_user_infected_post( id , infector )
Ale wtedy nie wyjdzie prawidłowo, więc trzeba podać 3 argumenty, jako ten ostatni podałem 0, sprawdz czy będzie działać.

Dodaje w załącznikach kod sma, skompilowana wersje amxx, oraz 2 biblioteki

Załączone pliki

Odpowiedz

  • +
  • -
DJTSUBA - zdjęcie DJTSUBA 24.09.2011

Ok dziękuję działa wszystko tak jak trzeba :) tylko teraz mam problem z modelem postaci mianowicie mam wpisany w sma

new const hclass_model[] = { "Barry" } // model

Lecz na serwerze ciągle jest model standardowy nie wiem może to wina pluginu ;/
Odpowiedz

  • +
  • -
SeeK - zdjęcie SeeK 24.09.2011

A masz ten model wrzucony na ftp serwera w folderze "cstrike/models/player/barry/" i nazwa pliku barry.mdl?
Odpowiedz

  • +
  • -
DJTSUBA - zdjęcie DJTSUBA 24.09.2011

Tak mam i to jest na takiej zasadzie że mogę na przykład podmienić zamiast arctic aby był barry ale gdy chcę zrobić aby dla danej klasy był ten model to nie da rady :( np ktoś gra postacią terror i wygląda jak Leon weźmie klasę Barry i zamiast mieć model Barry to będzie ciągle Leonem :(.Trochę chaotycznie napisałem ale może zrozumiesz o co mi chodzi w skrócie podmienić modele CT/TT mogę ale aby dla danej klasy był dany model to nie mogę :(
Odpowiedz