Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: V_More poslato Januar 05, 2012, 20:34:15 POSLE PODNE

Naslov: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 20:34:15 POSLE PODNE
Skripta koju koristim:Moj mod od 0
Detaljan opis problema: Pa ima nekih errore, inace treba da se napravi da u dialogu bira Spawn i sad evo:
Dio skripte:case DIALOG_SPAWN: //linija 418
{
if(response)
{
   case 0: //linija 422
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 7);
   }
   
   case 1:
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 35);
   }
   case 2:
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 101);
   }
   case 3:
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 299);
   }
   return 1;
}


Errori:
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(418) : error 040: duplicate "case" label (value 4)
C:\Documents and Settings\User\My Documents\My Documents\Downloads\x Gaming\Hard RP\gamemodes\matrix.pwn(422) : error 014: invalid statement; not in switch
C:\Documents and Settings\User\My Documents\My Documents\Downloads\x Gaming\Hard RP\gamemodes\matrix.pwn(422) : warning 215: expression has no effect
C:\Documents and Settings\User\My Documents\My Documents\Downloads\x Gaming\Hard RP\gamemodes\matrix.pwn(422) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\x Gaming\Hard RP\gamemodes\matrix.pwn(422) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\My Documents\My Documents\Downloads\X Gaming\Hard RP\gamemodes\matrix.pwn(422) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Neke slike/video za lakse dobivanje pomoci(neobavezno)://

Naslov: Odg: [Pomoc]Errori
Poruka od: Gotti747 poslato Januar 05, 2012, 20:38:41 POSLE PODNE
if(dialogid == DIALOG_SPAWN)
{
if(response)
{
   if(listitem == 0)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 7);
   }
    if(listitem == 1)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 35);
   }
    if(listitem == 2)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 101);
   }
    if(listitem == 3)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 299);
   }
                            }
   return 1;
}
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 20:41:56 POSLE PODNE
Citat: [TL:RP] Gotti747 poslato Januar 05, 2012, 20:38:41 POSLE PODNE
if(dialogid == DIALOG_SPAWN)
{
if(response)
{
   if(listitem == 0)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 7);
   }
    if(listitem == 1)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 35);
   }
    if(listitem == 2)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 101);
   }
    if(listitem == 3)
   {
   SpawnPlayer(playerid);
   SetPlayerPos(playerid, x, y, z);
   SetPlayerSkin(playerid, 299);
   }
                            }
   return 1;
}


Onda ima 26 errora, pa sam radio Undo, ne moze ipak tako, moze pomoc, hitno?
Naslov: Odg: [Pomoc]Errori
Poruka od: Gotti747 poslato Januar 05, 2012, 20:45:34 POSLE PODNE
Daj da vidim errore  ::)
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 20:46:33 POSLE PODNE
ovo prvo ti je ok, samo sto ti je 2 puta deklarisan isti dialog id i koristis ga 2. put u case-u
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 20:50:44 POSLE PODNE
Citat: [PG] Pacino poslato Januar 05, 2012, 20:46:33 POSLE PODNE
ovo prvo ti je ok, samo sto ti je 2 puta deklarisan isti dialog id i koristis ga 2. put u case-u

Ne kontam, mozes malo da pojasnis?
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 20:55:48 POSLE PODNE
#define IME_DIALOGA ID_DIALOGA

imas negdje razlicito ime dialoga a isti id, pa sada ga 2 puta koristis pod case dialogid...
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 20:59:40 POSLE PODNE
Citat: [PG] Pacino poslato Januar 05, 2012, 20:55:48 POSLE PODNE
#define IME_DIALOGA ID_DIALOGA

imas negdje razlicito ime dialoga a isti id, pa sada ga 2 puta koristis pod case dialogid...

Jesi siguran, imam samo 4 dialoga, i imaju razlicite ID-ove i nazive, nije do toga ja msm:D
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 21:05:41 POSLE PODNE
case DIALOG_SPAWN: //linija 418
{
if(response)
{
switch(listitem)
{
    case 0:
{//linija 422
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 7);
    }
   
    case 1:
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerSkin(playerid, 35);
    }
    case 2:
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerSkin(playerid, 101);
    }
    case 3:
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerSkin(playerid, 299);
    }

}
}
}

Eto..
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:07:53 POSLE PODNE
Ok, sada ima manje errora, ovo x se moze zanemarit, jer to cu kasnije unijet koordinate, a evo sta jios ima:

C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(418) : error 040: duplicate "case" label (value 4)
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(427) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(434) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(440) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(446) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(453) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(453) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 21:10:37 POSLE PODNE
case DIALOG_SPAWN: //linija 418
{
if(response)
{
switch(listitem)
{
case 0:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 7);
}
case 1:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 35);
}
case 2:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 101);
}
case 3:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 299);
}
}
}
}

Probaj sad, ako se bude 1. ponovio onda je 100% do onoga sto sam ti ja gore reko...
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:13:07 POSLE PODNE
Opet isti errori, ne vidim ni sta si promenio?
Naslov: Odg: [Pomoc]Errori
Poruka od: Mr.Gagi poslato Januar 05, 2012, 21:15:31 POSLE PODNE
Isti ti je dialogid. Ili promeni pod DIALOG_SPAWN ili mozes koristiti DIALOG_SPAWN+1 (DIALOG_SPAWN + neki_broj)

EDIT:
Cini mi se i da je Pacino to vec objasnio gore
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:18:35 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:15:31 POSLE PODNE
Isti ti je dialogid. Ili promeni pod DIALOG_SPAWN ili mozes koristiti DIALOG_SPAWN+1 (DIALOG_SPAWN + neki_broj)

EDIT:
Cini mi se i da je Pacino to vec objasnio gore

Promjenio sam umjesto DIALOG_SPAWN u DIALOG_SPAWNE i opet isto?
Naslov: Odg: [Pomoc]Errori
Poruka od: Mr.Gagi poslato Januar 05, 2012, 21:20:22 POSLE PODNE
Citat: |BU| Vectro64 poslato Januar 05, 2012, 21:18:35 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:15:31 POSLE PODNE
Isti ti je dialogid. Ili promeni pod DIALOG_SPAWN ili mozes koristiti DIALOG_SPAWN+1 (DIALOG_SPAWN + neki_broj)

EDIT:
Cini mi se i da je Pacino to vec objasnio gore

Promjenio sam umjesto DIALOG_SPAWN u DIALOG_SPAWNE i opet isto?
Isti ti je dialogid nisi promeni dialogid
Evo ovako uradi
#define DIALOG_NESTO    9389

I pod ShowPlayerDialog umesto DIALOG_SPAWN (taj za to) stavi DIALOG_NESTO i umesto case DIALOG_SPAWN: stavis case  DIALOG_NESTO:
Testirao sam ako je isti ID i do tog je
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:24:11 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:20:22 POSLE PODNE
Citat: |BU| Vectro64 poslato Januar 05, 2012, 21:18:35 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:15:31 POSLE PODNE
Isti ti je dialogid. Ili promeni pod DIALOG_SPAWN ili mozes koristiti DIALOG_SPAWN+1 (DIALOG_SPAWN + neki_broj)

EDIT:
Cini mi se i da je Pacino to vec objasnio gore

Promjenio sam umjesto DIALOG_SPAWN u DIALOG_SPAWNE i opet isto?
Isti ti je dialogid nisi promeni dialogid
Evo ovako uradi
#define DIALOG_NESTO    9389

I pod ShowPlayerDialog umesto DIALOG_SPAWN (taj za to) stavi DIALOG_NESTO i umesto case DIALOG_SPAWN: stavis case  DIALOG_NESTO:
Testirao sam ako je isti ID i do tog je

Opet isti errori:

C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(427) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(433) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(439) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(445) : error 017: undefined symbol "x"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(451) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\User\My Documents\My Documents\Downloads\Matrix Gaming\Hard RP\gamemodes\matrix.pwn(451) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


Evo sad, ima samo 5
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 21:26:14 POSLE PODNE
stavi umjesto DIALOG_SPAWNE
broj 4894
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:28:57 POSLE PODNE
Citat: [PG] Pacino poslato Januar 05, 2012, 21:26:14 POSLE PODNE
stavi umjesto DIALOG_SPAWNE
broj 4894
Sto 4849? Ako mi je Gagi dao drugi id onaj 9389, a onda stavim taj?

EDIT: Stavio sam taj sto mi je Gagi dao i opet imam ovih gore 5 errora.
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 21:32:28 POSLE PODNE
Daj oznaci koja je linija 451
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:33:22 POSLE PODNE
Citat: [PG] Pacino poslato Januar 05, 2012, 21:32:28 POSLE PODNE
Daj oznaci koja je linija 451

to je linija gdje je return 1;
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Januar 05, 2012, 21:34:05 POSLE PODNE
daj liniju, tj citavu funkciju da vidim u cemu je problem...
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:35:30 POSLE PODNE
Citat: [PG] Pacino poslato Januar 05, 2012, 21:34:05 POSLE PODNE
daj liniju, tj citavu funkciju da vidim u cemu je problem...

case 9389:
{
if(response)
{
switch(listitem)
{
case 0:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 7);
}
case 1:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 35);
}
case 2:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 101);
}
case 3:
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, x, y, z);
SetPlayerSkin(playerid, 299);
}
}
}
}
    return 1;
}


Evo ti... Nadam se ad ces pomoci ;)
Naslov: Odg: [Pomoc]Errori
Poruka od: Mr.Gagi poslato Januar 05, 2012, 21:39:12 POSLE PODNE
A da pogadjam. Nisi stavio u deo
switch(dialogid)
{
//Tu idu dialozi
}
?
Posto ako je ovo na kraju to onda tako dodje
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:41:56 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:39:12 POSLE PODNE
A da pogadjam. Nisi stavio u deo
switch(dialogid)
{
//Tu idu dialozi
}
?
Posto ako je ovo na kraju to onda tako dodje
Ako sam te dobro skonato, tu i jesu case 0, case 1, case 2...
Naslov: Odg: [Pomoc]Errori
Poruka od: Mr.Gagi poslato Januar 05, 2012, 21:47:17 POSLE PODNE
Citat: |BU| Vectro64 poslato Januar 05, 2012, 21:41:56 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:39:12 POSLE PODNE
A da pogadjam. Nisi stavio u deo
switch(dialogid)
{
//Tu idu dialozi
}
?
Posto ako je ovo na kraju to onda tako dodje
Ako sam te dobro skonato, tu i jesu case 0, case 1, case 2...
Ma fali ti jedna } dodaj i nju posle tog case-a obrisao si je pa zato to radi

EDIT:
Znaci iznad return 1; dodas }
Naslov: Odg: [Pomoc]Errori
Poruka od: V_More poslato Januar 05, 2012, 21:49:12 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:47:17 POSLE PODNE
Citat: |BU| Vectro64 poslato Januar 05, 2012, 21:41:56 POSLE PODNE
Citat: [TL:RP]Mr.Gagi poslato Januar 05, 2012, 21:39:12 POSLE PODNE
A da pogadjam. Nisi stavio u deo
switch(dialogid)
{
//Tu idu dialozi
}
?
Posto ako je ovo na kraju to onda tako dodje
Ako sam te dobro skonato, tu i jesu case 0, case 1, case 2...
Ma fali ti jedna } dodaj i nju posle tog case-a obrisao si je pa zato to radi

EDIT:
Znaci iznad return 1; dodas }

Ok, hvala vam na pomoci, sada je samo onirrori za koordinate.