[POMOC] Error kod Motel Systema

Započeo [CM] BrunoHP, Oktobar 05, 2010, 00:55:00 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Kada stisnem odgovor na temi koju sam istu ovu stavio, kaze da je doslo do greske i nakon 2 tjedna ne popravlja se, stavljam ponovno i u pocetku zelim napomenuti da sam stavio dovoljno ")", stoga trazim necju pomoc. Hvala unaprijed!


Sjecate se kako sam u temi Motel trebao kako to napraviti, jedan clan sa foruma mi je pokazao ali time sto je napravio, stvorio error. Rekao je da ce mi dati danas popravljen error, ali to je bilo prije 4 tjedna i vise ne dolazi na MSN. Sada cu vam reci kako izgleda moj sistem i gdje se javlja problem.

Kod forward:
forward UcitajMotel();
forward SacuvajMotel();


Kod new:
new sobeumotelu[11];

Pinfo(izdvojio sam samo pSoba jer o tome govorim):
enum pInfo
{
pSoba
};
new PlayerInfo[MAX_PLAYERS][pInfo];


Kod OnPlayerConnect:
PlayerInfo[playerid][pSoba] = 0;

Kod spawna:
/* -------------------------------------- Motel -------------------------------------- */
       if (PlayerInfo[playerid][pSoba] == 1) //Soba 1
   {
SetPlayerPos(playerid, 98.8528,1179.4883,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 2) //Soba 2
   {
SetPlayerPos(playerid, 98.7300,1171.7739,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 3) //Soba 3
   {
SetPlayerPos(playerid, 98.8566,1162.1509,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 4) //Soba 4
   {
SetPlayerPos(playerid, 99.0185,1178.1738,18.6641);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 5) //Soba 5
   {
SetPlayerPos(playerid, 98.9961,1170.1553,18.6641);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 6) //Soba 6
   {
SetPlayerPos(playerid, 98.9636,1163.6509,18.6641);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 7) //Soba 7
   {
SetPlayerPos(playerid, 86.0440,1162.2635,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 8) //Soba 8
   {
SetPlayerPos(playerid, 78.2655,1162.5160,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 9) //Soba 9
   {
SetPlayerPos(playerid, 68.7173,1162.3577,20.9402);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 10) //Soba 10
   {
SetPlayerPos(playerid, 84.8236,1162.2186,18.6565);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 11) //Soba 11
   {
SetPlayerPos(playerid, 76.7669,1162.4476,18.6641);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }
   if (PlayerInfo[playerid][pSoba] == 12) //Soba 12
   {
SetPlayerPos(playerid, 70.0784,1162.2688,18.6641);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
   }


OnPlayerRegister:
format(var, 32, "Soba=%d\n",PlayerInfo[playerid][pSoba]);fwrite(hFile, var);

OnPlayerLogin:
if( strcmp( key , "Soba" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSoba] = strval( val ); }

Komanda(/rentroom, a pravi /rentroom di iznajmljujes kucu je izmjenjen u drugu komandu):
if (strcmp(cmd, "/rentroom", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
        new ttemp = 0;
           do
{
if(sobeumotelu[ttemp]==0)
{
sobeumotelu[ttemp] = 1;
PlayerInfo[playerid][pSoba] = ttemp;
SacuvajMotel();
break;
}
if(ttemp == 11 && sobeumotelu[ttemp] == 1)
{
SendClientMessage(playerid, COLOR_GRAD, " Sve sobe u hotelu su zauzete!");
break;
}
}
while (temp < 12);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste prijavljeni !");
}
return 1;
   }


Negdje u scripti:
public UcitajMotel()
{
new koordinate[12][64];
new FajlPodaci[128];
new File: file = fopen("motel.ini", io_read);
if(file)
{
fread(file, FajlPodaci);
split(FajlPodaci, koordinate, ',');
new tmot = 0;
while(tmot < 12)
{
sobeumotelu[tmot] = strval(koordinate[tmot]);
tmot++;
}
}
else
{
fopen("motel.ini", io_write);
print("Datoteka motel.ini nije nadjena. Sistem ce sada pokusati stvoriti tu datoteku.");
SacuvajMotel();
}
return 1;
}

public SacuvajMotel()
{
new kstr[128], tpom;
format(kstr, sizeof(kstr), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", for(tpom = 0, tpom < 12, sobeumotelu[tpom], tpom++ ));
new File: file2 = fopen("motel.ini", io_write);
fwrite(file2, kstr);
fclose(file2);
return 1;
}


Errori koji mi se javljaju:
C:\Documents and Settings\Laptop\Desktop\CroMafia\gamemodes\cmr.pwn(3165) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Laptop\Desktop\CroMafia\gamemodes\cmr.pwn(3165) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Laptop\Desktop\CroMafia\gamemodes\cmr.pwn(3165) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Laptop\Desktop\CroMafia\gamemodes\cmr.pwn(3165) : fatal error 107: too many error messages on one line

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


4 Errors.


To je u redu pod "public SacuvajMotel()":
format(kstr, sizeof(kstr), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", for(tpom = 0, tpom < 12, sobeumotelu[tpom], tpom++ ));
Poslednja Izmena: Novembar 06, 2010, 13:33:41 POSLE PODNE od [Saw]BloodMaster

To je u redu pod "public SacuvajMotel()":
format(kstr, sizeof(kstr), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", for(tpom = 0, tpom < 12, sobeumotelu[tpom], tpom++ ));


pise ti >D

BalkanGaming

Citat: Hoxxy poslato Novembar 06, 2010, 11:20:42 PRE PODNE
Pokusaj sa ovim:

format(kstr, sizeof(kstr), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", for(tpom = 0; tpom < 12; sobeumotelu[tpom]; tpom++ ));
Pa da, xD nemozes iznajmit kad ti je jedna soba max u hotelu

Pa ako umijesto zareza stavim tocku-zarez onda se javljaju jos dva errora, stoga necu to mijenjat. Sto mislite sto treba?

pa kaze da je umijesto )   ---> ; , a kad obrisem onda mi samo ovo sto pise kaze.

btw. takoder mi kaze ove druge errore

Reci cu ti ovako, KOMPLETNA skripta je totalno [cenzura]a sve pobrisi i SAM napravi, ako neznas na ovakav mutav nacin onda napravi na neki laksi npr. dini ali ce bolje biti nego ova [cenzura]ost, ili jednostavno napravi "Hotel" kao biznis, znaci da je hotel neciji i da mozes rentati sobe a da vlasnik dobiva novce ;)


Jer koliko ti vidim u kodu imat ces velikih problema ( bugova ) sa /exit teleportirat ce te na drugom mjestu jer nisi cak napravio ni "counter" da mozes definirati kada je u hotelu. Mah ugl. bolje ti je ovo pobrisat i napisat kod ispocetka jer ovaj je bzvz. skroz
Poslednja Izmena: Novembar 07, 2010, 23:47:33 POSLE PODNE od [H]265
Kristijan Stipić