Jump to content

Question

Posted

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.

Recommended Posts

  • 1
Posted

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
Posted (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 by TheGodfather
  • 0
Posted

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
Posted
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
Posted
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
Posted
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
Posted
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
Posted
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
Posted
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

image.thumb.png.7f4ef819304bb10a1db631bec7811773.png

  • 0
Posted
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

image.thumb.png.7f4ef819304bb10a1db631bec7811773.png

pune functia mai deasupra functiilor din gm

  • 0
Posted

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

image.thumb.png.8c501bf34fa07ce03dd3650fea24abf5.png

image.thumb.png.7c5e49ecd61cbefe09fae9bd753f7cb2.pngimage.thumb.png.c644c43d8b3bbb0341c753303cc3c4a6.png

  • 0
Posted

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
Posted
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_"image.thumb.png.f79d0575b0055d4e46de60d081390917.png

image.png.0cd9691c2c138a5bfa78f970d3d3db9d.pngimage.png.e1fa4c9af4c887c355671f946f497ea2.pngimage.png.fde95ca524b1eac8166e6c0b16fcb280.pngimage.png.c3c59c2cb959fffefea66df323a395a3.png

  • 0
Posted
## `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
Posted (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 commandimage.thumb.png.1e8f6c0fd1ac20e4fb60795f1e6ac6a1.png

Edited by TheGodfather
  • 0
Posted (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 commandimage.thumb.png.1e8f6c0fd1ac20e4fb60795f1e6ac6a1.png

Am reusit sa rezolv asta, dar cand pornesc serverul pe localhost imi spune asta:

image.thumb.png.485656ac7745d83b0a465b45a4735453.png

EDIT:

Am pus asta la inceput de gamemode #define CGEN_MEMORY 100000 dar primesc alte erori, pe langa astea 2:

image.png.8aa7c04a479613322687e67dcf37b9dd.pngimage.thumb.png.364170f8ed924a694e4b75e3ea7a9a06.png

EDIT 2: Asta am rezolvat punand #define MAX_COMMANDS 1000 la inceput de gamemode. Legat de acele scriptfiles, ce pot face?

Edited by TheGodfather
  • 0
Posted
29 minutes ago, TheGodfather said:

Am reusit sa rezolv asta, dar cand pornesc serverul pe localhost imi spune asta:

image.thumb.png.485656ac7745d83b0a465b45a4735453.png

EDIT:

Am pus asta la inceput de gamemode #define CGEN_MEMORY 100000 dar primesc alte erori, pe langa astea 2:

image.png.8aa7c04a479613322687e67dcf37b9dd.pngimage.thumb.png.364170f8ed924a694e4b75e3ea7a9a06.png

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.