Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Darkic poslato Februar 22, 2020, 18:56:41 POSLE PODNE

Naslov: y_timers
Poruka od: Darkic poslato Februar 22, 2020, 18:56:41 POSLE PODNE
Problem(error/warning): Do sada sam radio sa obicnim timerima, medjutim odlucio sam se za y timere zbog bolje optimizacije. Prvi put radim i ne znam u cemu je problem. Inace verzija YSI-a je 5.1
C:\Users\Desktop\test server\gamemodes\timeri.pwn(15) : error 017: undefined symbol "defer"
C:\Users\Desktop\test server\gamemodes\timeri.pwn(15) : error 017: undefined symbol "TestTimer"
C:\Users\Desktop\test server\gamemodes\timeri.pwn(29) : error 010: invalid function or declaration
C:\Users\Desktop\test server\pawno\include\YSI\y_timers.inc(76) : symbol is never used: "USE@YSI_Coding@y_timers"
[/b]
Dio skripte: [pawn]
#include <a_samp>
#include <sscanf2>
#include <streamer>
#include <pawn.CMD>
#include <YSI\y_timers>

main()
{
   print("MOD JE STARTOVAN");
   print("----------------");
}

public OnGameModeInit()
{
   defer TestTimer(); // LINIJA 15
   return 1;
}

timer TestTimer[1000]() //LINIJA 29
{
   print("TEST PORUKA!");
}
[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
Naslov: Odg: y_timers
Poruka od: algorhitmically poslato Februar 22, 2020, 19:00:34 POSLE PODNE
Umesto:
[pawn]#include <YSI\y_timers>[/pawn]
koristi:
[pawn]#include <YSI_Coding\y_timers>[/pawn]
Naslov: Odg: y_timers
Poruka od: Darkic poslato Februar 22, 2020, 19:01:56 POSLE PODNE
Pokusavao sam, crasha mi pawno https://prnt.sc/r67b07
Nakon toga izbaci errore


C:\Users\Desktop\test server\pawno\include\YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_utils_impl.inc(428) : error 017: undefined symbol "isnull"
C:\Users\Desktop\test server\pawno\include\YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_utils_impl.inc(428) : error 010: invalid function or declaration
Naslov: Odg: y_timers
Poruka od: algorhitmically poslato Februar 22, 2020, 19:06:44 POSLE PODNE
Preporucujem ti da obrises ceo YSI lib i svaki include vezan za njega, skines poslednju verziju i ubacis.

Evo ti definicija za isnull:
[pawn]
#if !defined isnull
   #define isnull(%1) \
      ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
[/pawn]

Btw, koju verziju compilera koristis i koji?
Naslov: Odg: y_timers
Poruka od: Darkic poslato Februar 22, 2020, 19:08:30 POSLE PODNE
Default compiler

Kada skinem poslednju verziju YSI-a, trazi mi da ubacim milion nekih fajlova
Could not include "https://github.com/Zeex/amx_assembly" - ensure its files are in "include\amx_assembly\"

Kada sve to odradim, opet mi crasha pawno. Nije ni bitno batalicu YSI i vracam se na obicne timere
Naslov: Odg: y_timers
Poruka od: algorhitmically poslato Februar 22, 2020, 19:11:58 POSLE PODNE
Probaj ovaj: https://github.com/pawn-lang/compiler/releases
Naslov: Odg: y_timers
Poruka od: Darkic poslato Februar 22, 2020, 21:50:43 POSLE PODNE
Sa tim compailerom je malo bolja situacija
C:\Users\Desktop\test server\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_warning.inc(8) : warning 237: user warning: y_malloc heap allocation is unstable.  Use `YSI_NO_HEAP_MALLOC` to disable it, or `YSI_YES_HEAP_MALLOC` to disable this warning: git.io/YSI_HEAP_MALLOC
C:\Users\Desktop\test server\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_heapalloc.inc(166) : warning 239: literal array/string passed to a non-const parameter
C:\Users\Desktop\test server\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_heapalloc.inc(167) : warning 239: literal array/string passed to a non-const parameter


Previse cimanja radi minimalne optimizacije. I obicni timeri zavrsavaju posao
Naslov: Odg: y_timers
Poruka od: algorhitmically poslato Februar 22, 2020, 21:55:47 POSLE PODNE
Nije lose koristiti y_timers i uvek je dobro ostati up to date.
Zeexov compiler ti je em brzi em dobija redovan support.

Na pocetak skripte dodaj
#define YSI_NO_HEAP_MALLOC

ako koristis y_ini OBAVEZNO koristi ovo gore, ali ako hoces recimo da ubrzas mod i koristis na primer mysql koristi:

#define YSI_YES_HEAP_MALLOC