←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Co zle zrobilem ?

Zablokowany

  • +
  • -
ZBAGI - zdjęcie ZBAGI 04.01.2009

Witam, przerobiłem trochę plugin, z logicznego punktu widzenia powinno być ok, ale nie chce sie przerobić na .amxx :/
/* Plugin generated by AMXX-Studio
*/

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "hp"
#define VERSION "1.0"
#define AUTHOR "Edit By ZBAGI"

#define TASK 666

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_connect(id)
{
    if(is_user_bot(id))
        return
   
    new param[1]
    param[0] = id
   
    set_task(1.0,"rank",TASK+id,param,1,"b")
}

public client_disconnect(id)
    if(task_exists(TASK+id))
    remove_task(TASK+id)

public rank(param[])
{
    new id = param[0]
   
    static stats[8], body[8]
    get_user_stats(id, stats, body)
   
   
    if ( stats[0] >= 0 && stats[0] <= 0)
        set_user_health(id, 10)
    else if ( stats[0] >= 1 && stats[0] <= 2)
        set_user_health(id, 20) 
    else if ( stats[0] >= 3 && stats[0] <= 4)
        set_user_health(id, 40) 
    else if ( stats[0] >= 5 && stats[0] <= 9)
        set_user_health(id, 60) 
    else if ( stats[0] >= 10 && stats[0] <= 14)
        set_user_health(id, 80) 
    else if ( stats[0] >= 15 && stats[0] <= 19)
        set_user_health(id, 80) 
    else if ( stats[0] >= 20 && stats[0] <= 29)
        set_user_health(id, 80) 
    else if ( stats[0] >= 30 && stats[0] <= 39)
        set_user_health(id, 90) 
    else if ( stats[0] >= 40 && stats[0] <= 49)
        set_user_health(id, 100) 
    else if ( stats[0] >= 50 && stats[0] <= 59)
        set_user_health(id, 110) 
    else if ( stats[0] >= 60 && stats[0] <= 69)
        set_user_health(id, 110) 
    else if ( stats[0] >= 70 && stats[0] <= 79)
        set_user_health(id, 110) 
    else if ( stats[0] >= 80 && stats[0] <= 89)
        set_user_health(id, 110) 
    else if ( stats[0] >= 90 && stats[0] <= 99)
        set_user_health(id, 110) 
    else if ( stats[0] >= 100 && stats[0] <= 109)
        set_user_health(id, 115) 
    else if ( stats[0] >= 110 && stats[0] <= 119)
        set_user_health(id, 120) 
    else if ( stats[0] >= 120 && stats[0] <= 129)
        set_user_health(id, 130) 
    else if ( stats[0] >= 130 && stats[0] <= 139)
        set_user_health(id, 140) 
    else if ( stats[0] >= 140 && stats[0] <= 149)
        set_user_health(id, 145) 
    else if ( stats[0] >= 150 )
        set_user_health(id, 150) 
   
}
Co jest nie tak ?
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 04.01.2009

wyniki blędów widać przy kompilacji.

/home/groups/amxmodx/tmp3/textA69QJd.sma(42) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(44) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(46) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(48) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(50) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(52) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(54) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(56) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(58) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(60) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(62) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(64) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(66) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(68) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(70) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(72) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(74) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(76) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(78) : error 017: undefined symbol "set_user_health"
/home/groups/amxmodx/tmp3/textA69QJd.sma(80) : error 017: undefined symbol "set_user_health"

20 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textA69QJd.amx (compile failed).

Odpowiedz

  • +
  • -
darkman - zdjęcie darkman 04.01.2009

dodaj na poczatku kodu #include <fun>
Odpowiedz

  • +
  • -
mgr inż. Pavulon - zdjęcie mgr inż. Pavulon 04.01.2009

A on ma tak działać ?
Co 1s ustawia danemu graczowi ilość HP. Czyli na 1. poziomie jesteś na hit'a a na ostatnim nieśmiertelny prawie.
Odpowiedz

  • +
  • -
ZBAGI - zdjęcie ZBAGI 04.01.2009

on ma dawca HP, co lvl po około +10 HP :D ale coś mi chyba nie wyszło
Odpowiedz

  • +
  • -
mgr inż. Pavulon - zdjęcie mgr inż. Pavulon 04.01.2009

co sekundę

set_task(1.0,"rank",TASK+id,param,1,"b")

sprawdza statystyki, a dokładniej ilość kill'i

get_user_stats(id, stats, body)

i jeżeli gracz ma określoną ich liczbę to ustawia mu hp (nawet jeśli nie żyje ?!)

if ( stats[0] >= 0 && stats[0] <= 0)
set_user_health(id, 10)

A tobie pewnie chodziło o to żeby na początku rundy dodawało ileś hp ;>
Odpowiedz

Seba - zdjęcie Seba 04.01.2009

#define AUTHOR "Edit By ZBAGI"

Fajny plugin napisałeś.
Odpowiedz

  • +
  • -
ZBAGI - zdjęcie ZBAGI 04.01.2009

#define AUTHOR "Edit By ZBAGI"

Fajny plugin napisałeś.


Edit, wiesz co to znaczy ?

Ps. już wiem jak to zrobić, ale dziś już nie zdarzę jutro skończę to pokażę co mi wyszło
Odpowiedz

Seba - zdjęcie Seba 04.01.2009

Edit, wiesz co to znaczy ?

No jakoś nicku autora tam nie widzę.
Odpowiedz

  • +
  • -
ZBAGI - zdjęcie ZBAGI 05.01.2009

ok, już mam prawie skończony ale nie wiem na co zamienić set_task żeby wykonywał na początku rundy a nie co sek.
Odpowiedz

  • +
  • -
mgr inż. Pavulon - zdjęcie mgr inż. Pavulon 05.01.2009

http://amxx.pl/viewtopic.php?t=2177 i znajdź sobie coś o początku rundy
Odpowiedz

  • +
  • -
R3X - zdjęcie R3X 06.01.2009

Można pokazywać lvle i dodawać HP w jednym pluginie. Trzymaj.
v1.1

cvar:

hp_per_lvl 5

Ustawiasz ile hp za level; pamiętaj, że maksymalnie to 255hp więc ustawienie tego parametru przy 20lvlach na wartość np. 10 nie ma sensu


Na prośbę ZBAGIego wersja 1.11


//UPDATE załączników

Załączone pliki

  • Załączony plik  lvl.sma   2,53 KB   67 Ilość pobrań
  • Załączony plik  lvl2.sma   2,53 KB   53 Ilość pobrań
Odpowiedz
Zablokowany