Jump to content
  • 0

Am 2 erori la compiler


Oliver. - RPG2

Question

3 answers to this question

Recommended Posts

  • 0
Acum 6 minute, Oliver. - RPG2 a spus:

Am o problema la compiler si stau de 2 ore sa o rezolv, acestea sunt erorile:

gamemode new-life RPG\pawno\include\systems.inc(1263) : warning 219: local variable "tmpobjid" shadows a variable at a preceding level

gamemode new-life RPG\gamemodes\gmm.pwn(36877) : warning 217: loose indentation

Va rog eu mult am nevoie de ajutor

Sunt warninguri nu errori si arata linia 1263 si 36877 sa vedem care e problema 

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

  • 0

Salut @Oliver. - RPG2,

Warningurile respective inseamna urmatoarele:

  • warning 219: local variable "tmpobjid" shadows a variable at a preceding level => variabila "tmpobjid" a fost deja definita odata mai sus. (Rezolvare: deschizi fisierul systems.inc, care se afla in folderul pawno -> include, cauti linia 1263 si stergi urmatoarea linie "new tmpobjid")

Daca codul tau este scris in felul urmator de la linia 1263 in jos:

new tmpobjid = CreateDynamicObject( etc etc.. );
new tmpobjid = CreateDynamicObject( etc etc.. );
new tmpobjid = CreateDynamicObject( etc etc.. );

...atunci il modifici dupa exemplul acesta:

tmpobjid = CreateDynamicObject( etc etc.. );
tmpobjid = CreateDynamicObject( etc etc.. );
tmpobjid = CreateDynamicObject( etc etc.. );

Diferenta este ca lipseste "new" din fata variabilei tmpobjid, care e deja definita mai sus de linia 1263 conform warningului tau.

De asemenea, daca nu folosesti variabila tmpobjid intr-o functie, precum exemplul de mai jos, atunci poti sterge "tmpobjid = " din fata lui CreateDynamicObject.

tmpobjid = CreateDynamicObject( etc etc.. );
SetDynamicObjectMaterial( tmpobjid, etc, etc.. );

 

  • warning 217: loose indentation => te avertizeaza de faptul ca codul (scriptul) din jurul liniei 36877 nu este aranjat in rand cu celelalte.

Exemplu de script care iti genereaza acest warning:

if( PlayerInfo[ playerid ][ pAdmin ] ) {
	SendClientMessage( playerid, -1, "Esti admin." );
		SendClientMessage( playerid, -1, "Mesaj" ); // linia cu problema, care nu se afla in rand cu celelalte
	SendClientMessage( playerid, -1, "Mesaj" );
}

Exemplu de script corect aranjat:

if( PlayerInfo[ playerid ][ pAdmin ] ) {
	SendClientMessage( playerid, -1, "Esti admin." );
	SendClientMessage( playerid, -1, "Mesaj" ); // linia e aranjata acum
	SendClientMessage( playerid, -1, "Mesaj" );
}

 

Daca te-am ajutat =>

spacer.png

Link to comment
Share on other sites

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.