TheGodfather Posted July 9, 2022 Posted July 9, 2022 Salut, am vazut pe internet 2 moduri pentru a scrie un foreach si sunt curios ce diferente sunt (daca sunt) intre foreach(Player, i) si foreach(new i : Player) inafara de modul de scriere, desigur.
1 Banditul Posted July 10, 2022 Posted July 10, 2022 Nu e nici o diferenta. Dar daca folosesti prima sintaxa si nu primesti warning legat de faptul ca sintaxa e veche atunci inseamna ca folosesti o versiune foarte antica de YSI sau folosesti acel foreach standalone care e la fel de antic si care recomandat nu ar trebui folosite. Noile versiuni de YSI au destul de multe imbunatatiri atat de performanta cat si noi functionalitati.
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 (edited) 1 hour ago, Banditul said: Nu e nici o diferenta. Dar daca folosesti prima sintaxa si nu primesti warning legat de faptul ca sintaxa e veche atunci inseamna ca folosesti o versiune foarte antica de YSI sau folosesti acel foreach standalone care e la fel de antic si care recomandat nu ar trebui folosite. Noile versiuni de YSI au destul de multe imbunatatiri atat de performanta cat si noi functionalitati. Inteleg, multumesc frumos pentru explicatie Edit: Oare ai putea sa imi dai un link de unde as putea sa iau ultima versiune? Multumesc Edited July 10, 2022 by TheGodfather
0 Banditul Posted July 10, 2022 Posted July 10, 2022 7 minutes ago, TheGodfather said: Inteleg, multumesc frumos pentru explicatie Edit: Oare ai putea sa imi dai un link de unde as putea sa iau ultima versiune? Multumesc https://github.com/pawn-lang/YSI-Includes
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 53 minutes ago, Banditul said: https://github.com/pawn-lang/YSI-Includes Dupa ce am pus ce este acolo in includes, primesc mesajul acesta: ...\pawno\include\foreach.inc(230) : fatal error 100: cannot read from file: "YSI\internal\y_natives"
0 Krootch Posted July 10, 2022 Posted July 10, 2022 Incearca ultima versiune de YSI, daca folosesti Zeex compiler, foloseste ultima versiune si daca primesti warning uri, imi dai mesaj in privat si le rezolv.
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 Just now, Krootch said: Incearca ultima versiune de YSI, daca folosesti Zeex compiler, foloseste ultima versiune si daca primesti warning uri, imi dai mesaj in privat si le rezolv. Am dat putin mai sus un reply catre Banditul legat de eroarea pe care o primesc dupa ce am pus ultima versiune de YSI. Folosesc Zeex compiler.
0 Krootch Posted July 10, 2022 Posted July 10, 2022 Just now, TheGodfather said: Am dat putin mai sus un reply catre Banditul legat de eroarea pe care o primesc dupa ce am pus ultima versiune de YSI. Folosesc Zeex compiler. Si ultima versiune de Zeex?
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 3 minutes ago, Krootch said: Si ultima versiune de Zeex? Da
0 Banditul Posted July 10, 2022 Posted July 10, 2022 Nu folosi #include <foreach> foloseste #include <YSI_Data\y_iterate>
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 1 minute ago, Banditul said: Nu folosi #include <foreach> foloseste #include <YSI_Data\y_iterate> Imi spune asta: fatal error 100: cannot read from file: "YSI_Data\y_iterate"
0 Banditul Posted July 10, 2022 Posted July 10, 2022 7 minutes ago, TheGodfather said: Imi spune asta: fatal error 100: cannot read from file: "YSI_Data\y_iterate" Esti sigur ca ai pus folderele/fisierele de la YSI in folderul pawno > include ? Cele din arhiva asta
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 4 minutes ago, Banditul said: Esti sigur ca ai pus folderele/fisierele de la YSI in folderul pawno > include ? Cele din arhiva asta Da, acum primesc eroarea asta: fatal error 100: cannot read from file: "YSI\y_hooks". Am incercat sa pun fisierul y_hooks in fisierul YSI dar primesc aceeasi eroare
0 Krootch Posted July 10, 2022 Posted July 10, 2022 1 minute ago, TheGodfather said: Da, acum primesc eroarea asta: fatal error 100: cannot read from file: "YSI\y_hooks". Am incercat sa pun fisierul y_hooks in fisierul YSI dar primesc aceeasi eroare #include <YSI_Coding/y_hooks>
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 4 minutes ago, Krootch said: #include <YSI_Coding/y_hooks> Am mai rezolvat alte erori dupa modelul tau, dar desigur vin alte erori De exemplu la linia timer... warning 208: function with tag result used before definition, forcing reparse
0 Krootch Posted July 10, 2022 Posted July 10, 2022 3 minutes ago, TheGodfather said: Am mai rezolvat alte erori dupa modelul tau, dar desigur vin alte erori De exemplu la linia timer... warning 208: function with tag result used before definition, forcing reparse pune functia mai deasupra functiilor din gm
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 M-a rupt... C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_utils_impl.inc(236) : warning 219: local variable "ip" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_utils_impl.inc(901) : warning 219: local variable "ip" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_va\..\..\YSI_Core\y_core\..\..\amx\disasm.inc(111) : warning 219: local variable "ip" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_va\..\..\YSI_Core\y_core\..\..\amx\disasm.inc(144) : warning 219: local variable "ip" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\y_hooks_impl.inc(659) : warning 219: local variable "sName" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(117) : error 017: undefined symbol "MAX_ACTORS" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(120) : error 017: undefined symbol "MAX_ACTORS" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(122) : error 017: undefined symbol "MAX_ACTORS" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Data\y_foreach\y_foreach_iterators.inc(395) : error 017: undefined symbol "MAX_ACTORS" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(197) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(198) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_warning.inc(7) : 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\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(64) : error 021: symbol already defined: "@yH_OnPlayerConnect@004" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(64) : warning 209: function "@yH_OnPlayerConnect@004" should return a value C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(65) : error 021: symbol already defined: "@yH_OnPlayerDisconnect@004" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(120) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\dropAir.inc(185) : error 017: undefined symbol "DONT_USE" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(180) : error 021: symbol already defined: "Range" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(190) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(201) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(232) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(278) : error 017: undefined symbol "DONT_USE" C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(353) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(358) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(358) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(362) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(367) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(367) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(372) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(377) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(377) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(381) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(386) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(386) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(397) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(397) : warning 215: expression has no effect C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(402) : error 076: syntax error in the expression, or invalid function call C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(402) : error 076: syntax error in the expression, or invalid function call
0 Banditul Posted July 10, 2022 Posted July 10, 2022 Aparent exista o functie in YSI numita Range stock Range(const arr[], num = sizeof (arr)) Va trebui sa iti modifici numele parametului , poate in loc de Range sa fie range Edit: Eroarea de la linia 278 e probabil "Dont use SCM" care inseamna ca va trebui sa scrii SendClientMessage
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 50 minutes ago, Banditul said: Aparent exista o functie in YSI numita Range stock Range(const arr[], num = sizeof (arr)) Va trebui sa iti modifici numele parametului , poate in loc de Range sa fie range Edit: Eroarea de la linia 278 e probabil "Dont use SCM" care inseamna ca va trebui sa scrii SendClientMessage Din sutele de erori/warninguri am reusit sa ajung doar la cateva: C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(197) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Visual\y_commands\y_commands_impl.inc(198) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\pawno\include\YSI_Coding\y_timers\..\y_malloc\y_malloc_warning.inc(7) : 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\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(3294) : warning 213: tag mismatch: expected tag "Timer", but found none ("_") C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(39197) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(39270) : error 025: function heading differs from prototype C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn(46781) : error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_"
0 Banditul Posted July 10, 2022 Posted July 10, 2022 ## `error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_"` This will occur on: #pragma dynamic 65536 The error tries to explain the problem. y_malloc can allocate memory from the heap or from global memory. If you are not using `YSI_NO_HEAP_MALLOC` it will use the heap (obviously), aka. dynamic memory. Because of this, it needs to control how much dynamic memory there is. Thus, instead of using `#pragma dynamic`, use `DYNAMIC_MEMORY`: #define DYNAMIC_MEMORY (65536) // Inainte de orice include public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success) Si aici gasesti ce valori sa verifici pentru if (success == ) https://github.com/Misiur/YSI-Includes/blob/e9cf7a1e4154517f2b06cbd36efd0742c2cc3408/YSI_Visual/y_commands/impl.inc#L108-L120 Cat despre acel timer nu sunt 100% sigur pentru ca e prima data folosit in felul asta https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_timers/features.md Presupun ca poti pune Timer:timer Pacanele[]()
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 (edited) 11 minutes ago, Banditul said: ## `error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_"` This will occur on: #pragma dynamic 65536 The error tries to explain the problem. y_malloc can allocate memory from the heap or from global memory. If you are not using `YSI_NO_HEAP_MALLOC` it will use the heap (obviously), aka. dynamic memory. Because of this, it needs to control how much dynamic memory there is. Thus, instead of using `#pragma dynamic`, use `DYNAMIC_MEMORY`: #define DYNAMIC_MEMORY (65536) // Inainte de orice include public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success) Si aici gasesti ce valori sa verifici pentru if (success == ) https://github.com/Misiur/YSI-Includes/blob/e9cf7a1e4154517f2b06cbd36efd0742c2cc3408/YSI_Visual/y_commands/impl.inc#L108-L120 Cat despre acel timer nu sunt 100% sigur pentru ca e prima data folosit in felul asta https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_timers/features.md Presupun ca poti pune Timer:timer Pacanele[]() Pentru if(success == ...) (39277) : warning 213: tag mismatch: expected tag "e_COMMAND_ERRORS", but found none ("_") Linia 39277 este penultima, cea cu unknown command Edited July 10, 2022 by TheGodfather
0 TheGodfather Posted July 10, 2022 Author Posted July 10, 2022 (edited) 27 minutes ago, TheGodfather said: Pentru if(success == ...) (39277) : warning 213: tag mismatch: expected tag "e_COMMAND_ERRORS", but found none ("_") Linia 39277 este penultima, cea cu unknown command Am reusit sa rezolv asta, dar cand pornesc serverul pe localhost imi spune asta: EDIT: Am pus asta la inceput de gamemode #define CGEN_MEMORY 100000 dar primesc alte erori, pe langa astea 2: EDIT 2: Asta am rezolvat punand #define MAX_COMMANDS 1000 la inceput de gamemode. Legat de acele scriptfiles, ce pot face? Edited July 10, 2022 by TheGodfather
0 sunkie Posted July 10, 2022 Posted July 10, 2022 29 minutes ago, TheGodfather said: Am reusit sa rezolv asta, dar cand pornesc serverul pe localhost imi spune asta: EDIT: Am pus asta la inceput de gamemode #define CGEN_MEMORY 100000 dar primesc alte erori, pe langa astea 2: EDIT 2: Asta am rezolvat punand #define MAX_COMMANDS 1000 la inceput de gamemode. Legat de acele scriptfiles, ce pot face? Pur si simplu faci 2 foldere numite fixes si temp in folderul scriptfiles.
Question
TheGodfather
Salut, am vazut pe internet 2 moduri pentru a scrie un foreach si sunt curios ce diferente sunt (daca sunt) intre foreach(Player, i) si foreach(new i : Player) inafara de modul de scriere, desigur.
31 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now