Salutare,acesta este al 9-lea WarGods Tutorial,iar astazi vom vorbi despre biblioteca hamsandwich,este o blibloteca care are anumite functii,care ne vor ajuta la unele plugin-uri grozave in viitor.
-Codul nostru de astazi va fi in felul urmator,vom inregistra o functie ham,pentru respawn,iar cand jucatorul a primit respawn,i vom seta,de exemplu armura,sa incepem.
AMXX Code:You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
1)A-ti vazut in primele linii:
,aceasta este libraria,care ne permite sa utilizam functii precum:AMXX Code:You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
- Respawn.
- Bullet damage.
- Adaugare efecte pe ecran,etc.
2)In public_init(),a-ti vazut acea linie de cod:
,RegisterHam,este o functie din bliblioteca hamsandwich,care ne permite sa inregistram un ham,asa se numeste tipul de functie.AMXX Code:You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
,exista 3 parametrii,pentru aceasta functie:AMXX Code:You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
- Primul parametru,este "Ce tip de ham vrei sa folosesti?",in cazul nostru tipul de ham este de spawn,sau mai bine zis respawn.
- Al 2-lea parametru,se refera "Carui tip de entitate,sa fie executata aceasta functie,in cazul nostru "player" = jucator,se va executa functia de respawn,doar pentru jucatorii adevarati.
- Iar al 3-lea parametru,este numele publicului pe care-l va executa,iar la noi publicul este numit "cmd_spawn".
3)In publicul nostru "cmd_spawn",a-ti vazut o functie precum:
,aceasta functie apartine de biblioteca cstrike,doar incluzand-o vom avea acces la ea.Aceasta functie are 2 parametri precum,"La cine sa-i seteze armura?",iar al 2-lea,"In ce valoare sa o setez?"AMXX Code:You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
-Logica este foarte simpla,cand un jucator va primi respawn,el va primi 100 AP,iar pe langa un mesaj cu textul "Ai primit armura gratuita",foarte simplu.
Acesta a fost al 9-lea WarGods Tutorial,sper ca a-ti inteles sau am omis ceva,va rog postati,pana data viitoare spor in continuare .