[POMOC] 1 Error

Započeo Acke, Maj 14, 2014, 17:29:53 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Mileston Roleplay
Detaljan opis problema: Editujem posao Kosac Trave i napravio sam da pre nego sto pocne kositi travu mora da stavi prikolicu.Uradio sam to na istom principu kao kod posla farmer,ono da mora da se zakaci plug komandom /zakaci.Evo kako sam to uradio a izbacuje ERROR:

(1813) : error 001: expected token: ";", but found "new" EVO GA ERROR,a linije 1813 je ovo: new KosiTravu[Max_Players];

Deo skripte: new KosiTravu[MAX_PLAYERS]; Ovo je u vezi posla

public TravaT(playerid)
{
new Float:Pos[3];
for(new i = 0; i < broj_objekata_trave; i++)
{
    GetPlayerObjectPos(playerid,Trava[i][playerid],Pos[0],Pos[1],Pos[2]);
    Ako(IsPlayerInRangeOfPoint(playerid,2.0,Pos[0],Pos[1],Pos[2]) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 572)
    {
        DestroyPlayerObject(playerid,Trava[i][playerid]);
        Trava[i][playerid] = 999;
    }
}
new broj = BrojTrave(playerid);
Ako(broj == broj_objekata_trave)//Mislim da bi tako videces vec ili je sa -1 mrzi me sada da razmisljam
{
  KosiTravu[playerid] = 0;
new globalstring[256];
new isplata=(random(20)+10);
format(globalstring, sizeof(globalstring), "Zaradili ste: $%d.Plata vam je stigla na racun.", isplata);
SCM(playerid, SVETLOPLAVA, globalstring);
PlayerInfo[playerid][pRadnaKnjizica] += isplata;
KillTimer(TravaTimer[playerid]);
}
Povratak 1;
}
Tajmer

COMMAND:kositravu(playerid, params[])
{
new idv = GetPlayerVehicleID(playerid);
Ako(PlayerInfo[playerid][pPosao] != 4)
{
SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Nisi Kosac Trave! ");
Ako(zakacenaprikolica[playerid]!= 1) Povratak SCM(playerid, 1, "{00A6FF}mlClient: {FFFFFF}Moras prvo zakaciti prikolicu !(/prikolicakosenje).");
Ako(KosiTravu[playerid] >= 1)
Povratak 1;
}
Ako(KosiTravu[playerid] >= 1)
{
SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Vec kosis travu!");
Povratak 1;
}
Ako(!VoziloKosac(idv))
{
SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Nisi u vozilu kosaca!");
Povratak 1;
}
Ako(VoziloKosac(idv))
{
KosiTravu[playerid] = 1;
            SCM(playerid, SIVA, " {00E82E}[POSAO]{FFFFFF}: Pokosi svu travu i dobices novac!");
  //------------------------------------------------------------------
            Trava[0][playerid] = CreatePlayerObject(playerid,801, -2510.39746, -265.27820, 37.94316,   0.00000, 0.00000, 0.00000);
            Trava[1][playerid] = CreatePlayerObject(playerid,801, -2640.06348, -263.24417, 6.02239,   0.00000, 0.00000, 0.00000);
            Trava[2][playerid] = CreatePlayerObject(playerid,801, -2649.67310, -254.87529, 5.60821,   0.00000, 0.00000, 0.00000);
            Trava[3][playerid] = CreatePlayerObject(playerid,801, -2648.10815, -273.28482, 6.02138,   0.00000, 0.00000, 0.00000);
            Trava[4][playerid] = CreatePlayerObject(playerid,801, -2636.29053, -282.52933, 6.02138,   0.00000, 0.00000, 0.00000);
            Trava[5][playerid] = CreatePlayerObject(playerid,801, -2624.19458, -278.02032, 7.06978,   0.00000, 0.00000, 0.00000);
            Trava[6][playerid] = CreatePlayerObject(playerid,801, -2599.48877, -268.76358, 15.63977,   0.00000, 0.00000, 0.00000);
            Trava[7][playerid] = CreatePlayerObject(playerid,801, -2606.69312, -282.24756, 12.61722,   0.00000, 0.00000, 0.00000);
            Trava[8][playerid] = CreatePlayerObject(playerid,801, -2584.89600, -265.08527, 18.46281,   0.00000, 0.00000, 0.00000);
            Trava[9][playerid] = CreatePlayerObject(playerid,801, -2589.89233, -253.00870, 17.85171,   0.00000, 0.00000, 0.00000);
            Trava[10][playerid] = CreatePlayerObject(playerid,801, -2601.00928, -255.44485, 17.85171,   0.00000, 0.00000, 0.00000);
            Trava[11][playerid] = CreatePlayerObject(playerid,801, -2604.60547, -242.24551, 17.43336,   0.00000, 0.00000, 0.00000);
            Trava[12][playerid] = CreatePlayerObject(playerid,801, -2582.89648, -247.29367, 18.13837,   0.00000, 0.00000, 0.00000);
            Trava[13][playerid] = CreatePlayerObject(playerid,801, -2589.98975, -283.30624, 17.93942,   0.00000, 0.00000, 0.00000);
            Trava[14][playerid] = CreatePlayerObject(playerid,801, -2570.14795, -274.93604, 22.03407,   0.00000, 0.00000, 0.00000);
            Trava[15][playerid] = CreatePlayerObject(playerid,801, -2535.79443, -288.12350, 35.58849,   0.00000, 0.00000, 0.00000);
            Trava[16][playerid] = CreatePlayerObject(playerid,801, -2554.56958, -283.63831, 28.80653,   0.00000, 0.00000, 0.00000);
            Trava[17][playerid] = CreatePlayerObject(playerid,801, -2529.65601, -269.28537, 37.04818,   0.00000, 0.00000, 0.00000);
            Trava[18][playerid] = CreatePlayerObject(playerid,801, -2521.03662, -260.81979, 36.72781,   0.00000, 0.00000, 0.00000);
            Trava[19][playerid] = CreatePlayerObject(playerid,801, -2535.79443, -288.12350, 35.58849,   0.00000, 0.00000, 0.00000);
            Trava[20][playerid] = CreatePlayerObject(playerid,801, -2521.16064, -289.75278, 36.72171,   0.00000, 0.00000, 0.00000);
  //------------------------------------------------------------------
            TravaTimer[playerid] = SetTimerEx("TravaT",500,Jeste,"i",playerid);

}
Povratak 1;
    }
- Komanda Kosi travu ovo sam ubacio: Ako(zakacenaprikolica[playerid]!= 1) Povratak SCM(playerid, 1, "{00A6FF}mlClient: {FFFFFF}Moras prvo zakaciti prikolicu !(/prikolicakosenje).");

    {
         Ako(newkeys == KEY_ACTION)
    {
Ako(PlayerInfo[playerid][pPosao] != 3) Povratak 1;
    Drugo Ako(!IsPlayerInAnyVehicle(playerid)) Povratak 1;
    Drugo Ako(GetVehicleModel(GetPlayerVehicleID(playerid)) != 572)  Povratak 1;
new vehicleid = GetPlayerVehicleID(playerid);
Ako(IsTrailerAttachedToVehicle(vehicleid))
{
DetachTrailerFromVehicle(vehicleid);
Povratak 1;
}
new Float:x, Float:y, Float:z;
new Float:dist, Float:closedist=8, closeveh;
for(new i=1; i < MAX_VEHICLES; i++)
{
Ako(i != vehicleid && GetVehiclePos(i, x, y, z))
{
dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
Ako(dist < closedist)
{
closedist = dist;
closeveh = i;
}
}
}
Ako(!closeveh) Povratak 1;
Ako(GetVehicleModel(closeveh) != 611)  Povratak 1;
AttachTrailerToVehicle(closeveh, vehicleid);
    Povratak 1;
    }
   }
Ovo je isto u vezi posla

I jos Komanda /prikolicakosenje

COMMAND:prikolicakosenje(playerid, params[])
{
    Ako(PlayerInfo[playerid][pPosao] != 4) Povratak 1;
    Drugo Ako(!IsPlayerInAnyVehicle(playerid)) Povratak 1;
    Drugo Ako(GetVehicleModel(GetPlayerVehicleID(playerid)) != 572)  Povratak 1;
new vehicleid = GetPlayerVehicleID(playerid);
Ako(IsTrailerAttachedToVehicle(vehicleid))
{
DetachTrailerFromVehicle(vehicleid);
zakacenaprikolica[playerid] = 0;
Povratak 1;
}
new Float:x, Float:y, Float:z;
new Float:dist, Float:closedist=8, closeveh;
for(new i=1; i < MAX_VEHICLES; i++)
{
Ako(i != vehicleid && GetVehiclePos(i, x, y, z))
{
dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
Ako(dist < closedist)
{
closedist = dist;
closeveh = i;
}
}
}
Ako(!closeveh) Povratak 1;
Ako(GetVehicleModel(closeveh) != 611)  Povratak 1;
zakacenaprikolica[playerid] = 1;
AttachTrailerToVehicle(closeveh, vehicleid);
    Povratak 1;
}


Dugacak je opis,ali hteo sam sto detaljnije da opisem ovam problem.
Rescpect for:Gagi,Denis_Lapi,C++

BUMP




Nije valjda da niko ne zna resenje.
Rescpect for:Gagi,Denis_Lapi,C++

ovaka eror se javlja u slucaju da varijabla nemoze biti pozvana pogledaj iznad ili ispod da nisi gde izostavio ;
69

Znao sam to vec sam pregledao izgledao mi sve okej evo ti kod:

1811 new plugovi[5];
1812 new KosiTravu[MAX_PLAYERS];
1813 new ObjekatKanta[MAX_PLAYERS];


To je jedna linija iznad i jedna ispod,msm da znam sta je...Evo sad opet da pokusam.
Rescpect for:Gagi,Denis_Lapi,C++

Uradio sam sve opet i sad nema Errora ni Warninga ali kada kucam /kositravu pokrene ceo zapis i pojave se objekti kao da nisam  ni ubacio ono   Ako(zakacenaprikolica[playerid]!= 1) Povratak SCM(playerid, 1, "{00A6FF}mlClient: {FFFFFF}Moras prvo zakaciti prikolicu !(/prikolicakosenje)."); Jel treba jos negde uraditi neku proveru?
Rescpect for:Gagi,Denis_Lapi,C++

probaj ovako
COMMAND:kositravu(playerid, params[])
{
new idv = GetPlayerVehicleID(playerid);
Ako(PlayerInfo[playerid][pPosao] != 4) return SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Nisi Kosac Trave! ");
Ako(zakacenaprikolica[playerid]!= 1) Povratak SCM(playerid, 1, "{00A6FF}mlClient: {FFFFFF}Moras prvo zakaciti prikolicu !(/prikolicakosenje).");
Ako(KosiTravu[playerid] >= 1) return SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Vec kosis travu!");
Ako(!VoziloKosac(idv)) return SCM(playerid, SIVA, "{00A6FF}mlClient: {FFFFFF}Nisi u vozilu kosaca!");
Ako(VoziloKosac(idv))
{
KosiTravu[playerid] = 1;
            SCM(playerid, SIVA, " {00E82E}[POSAO]{FFFFFF}: Pokosi svu travu i dobices novac!");
  //------------------------------------------------------------------
            Trava[0][playerid] = CreatePlayerObject(playerid,801, -2510.39746, -265.2server uklonjen!, 37.94316,   0.00000, 0.00000, 0.00000);
            Trava[1][playerid] = CreatePlayerObject(playerid,801, -2640.06348, -263.24417, 6.02239,   0.00000, 0.00000, 0.00000);
            Trava[2][playerid] = CreatePlayerObject(playerid,801, -2649.67310, -254.87529, 5.60821,   0.00000, 0.00000, 0.00000);
            Trava[3][playerid] = CreatePlayerObject(playerid,801, -2648.10815, -273.28482, 6.02138,   0.00000, 0.00000, 0.00000);
            Trava[4][playerid] = CreatePlayerObject(playerid,801, -2636.29053, -282.52933, 6.02138,   0.00000, 0.00000, 0.00000);
            Trava[5][playerid] = CreatePlayerObject(playerid,801, -2624.19458, -278.02032, 7.06978,   0.00000, 0.00000, 0.00000);
            Trava[6][playerid] = CreatePlayerObject(playerid,801, -2599.48877, -268.76358, 15.63977,   0.00000, 0.00000, 0.00000);
            Trava[7][playerid] = CreatePlayerObject(playerid,801, -2606.69312, -282.24756, 12.61722,   0.00000, 0.00000, 0.00000);
            Trava[8][playerid] = CreatePlayerObject(playerid,801, -2584.89600, -265.08527, 18.46281,   0.00000, 0.00000, 0.00000);
            Trava[9][playerid] = CreatePlayerObject(playerid,801, -2589.89233, -253.00870, 17.85171,   0.00000, 0.00000, 0.00000);
            Trava[10][playerid] = CreatePlayerObject(playerid,801, -2601.00928, -255.44485, 17.85171,   0.00000, 0.00000, 0.00000);
            Trava[11][playerid] = CreatePlayerObject(playerid,801, -2604.60547, -242.24551, 17.43336,   0.00000, 0.00000, 0.00000);
            Trava[12][playerid] = CreatePlayerObject(playerid,801, -2582.89648, -247.29367, 18.13837,   0.00000, 0.00000, 0.00000);
            Trava[13][playerid] = CreatePlayerObject(playerid,801, -2589.98975, -283.30624, 17.93942,   0.00000, 0.00000, 0.00000);
            Trava[14][playerid] = CreatePlayerObject(playerid,801, -2570.14795, -274.93604, 22.03407,   0.00000, 0.00000, 0.00000);
            Trava[15][playerid] = CreatePlayerObject(playerid,801, -2535.79443, -288.12350, 35.58849,   0.00000, 0.00000, 0.00000);
            Trava[16][playerid] = CreatePlayerObject(playerid,801, -2554.56958, -283.63831, 28.80653,   0.00000, 0.00000, 0.00000);
            Trava[17][playerid] = CreatePlayerObject(playerid,801, -2529.65601, -269.28537, 37.04818,   0.00000, 0.00000, 0.00000);
            Trava[18][playerid] = CreatePlayerObject(playerid,801, -2521.03662, -260.81979, 36.72781,   0.00000, 0.00000, 0.00000);
            Trava[19][playerid] = CreatePlayerObject(playerid,801, -2535.79443, -288.12350, 35.58849,   0.00000, 0.00000, 0.00000);
            Trava[20][playerid] = CreatePlayerObject(playerid,801, -2521.16064, -289.75278, 36.72171,   0.00000, 0.00000, 0.00000);
  //------------------------------------------------------------------
            TravaTimer[playerid] = SetTimerEx("TravaT",500,Jeste,"i",playerid);

}
Povratak 1;
}
69

Radi sad hvala puno :)
Rescpect for:Gagi,Denis_Lapi,C++