[pomoc]respekti i ekreiraj

Započeo MicroSD_, Januar 06, 2012, 22:24:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: NX
Detaljan opis problema: Kada se logiram pise mi level: %d.. Respekti: 5/ ... Novac: ...

Krivo mi pise za respekte i za  novac...
Dio skripte: format(string2, sizeof(string2), "*Dobrodosao %s na server,ljepo te opet vidjeti na serveru!",playername2);
SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);
printf("%s se prikljucio na server.",playername2);
SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player

SpawnPlayer(playerid);
if(gTeam[playerid] == 0)
{
gTeam[playerid] = 3;
}

printf("%s has logged in.",playername2);
if (PlayerInfo[playerid][pLevel] > 0)
{
new coordsstring[256];
new hour,minuite,second;
    new year, month,day;
    getdate(year, month, day);
    gettime(hour,minuite,second);
format(string2, sizeof(string2), "*Tvoj dosadasnji zivot: Level [%d] | Respekti [%d/%d] | Novci: [$%d]",PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, COLOR_WHITE,string2);
SCM(playerid, 0xFFFF00FF, RandomPoslovice[random(sizeof(RandomPoslovice))]);
format(coordsstring, sizeof(coordsstring), "*Sada je: %d:%d h | Datum: %d.%d.%d",hour,minuite,day,month,year);
    SendClientMessage(playerid, COLOR_YELLOW,coordsstring);
  }

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Januar 06, 2012, 22:51:07 POSLE PODNE od °° BaD BoY °°

format(string2, sizeof(string2), "*Tvoj dosadasnji zivot: Level [%d] | Respekti [%d/%d] | Novci: [$%d]",PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash]);

Pogledaj kako je formatiran string , vidiš da treba 4 varijabi bit u formatu a ima samo 3...
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

zamijeni samo svoj dio sam mojim :
format(string2, sizeof(string2), "*Tvoj dosadasnji zivot: Level [%d] | Respekti [%d] | Novci: [$%d]",PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, COLOR_WHITE,string2);

Imam jos jedan problem, sto se tice ekreiraj,, lockali su mi temu onu dole...


isao sam sa grupama radit /ekreiraj, i dodu mi errori pa ako netko zna rijesit to


Errori

(23010) : error 010: invalid function or declaration
(22997) : error 014: invalid statement; not in switch
(22980) : error 029: invalid expression, assumed zero
(22980) : error 002: only a single statement (or expression) can follow each "case"
(22977) : error 036: empty statement
(22977) : error 001: expected token: ":", but found ";"


Linije:

23010 - return 1;
22997 -  case 2;
22980 -            Event1 = CreateVehicle(car, 1136.7440,2172.1750,16.4465, 0.0, color1, color2, 60000);
22977 - case 1; // ako je admin ukucao broj 1 na parametru za grupe

neide ; poslije casea nego : daj naučite taj engleski više...

Daj nam kod za sve
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

.......
Poslednja Izmena: Januar 07, 2012, 01:28:41 PRE PODNE od °° BaD BoY °°

CMD:ekreiraj(playerid, params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
       new color1;
        new color2;
new car;
new grupa;
if (PlayerInfo[playerid][pAdmin] >= 1338)
   {
        if(sscanf(params, "iii", car, color1, color2)) return SCM(playerid, -1, "{FFFFFF}[{F81414}Ekreiraj{FFFFFF}]{CCCCCC}:{FFFFFF} [id_vozila] [boja1] [boja2] [grupa]");
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   ID vozila mora biti izmedu 400 ili 611 !"); return 1; }
    if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Broj boje mora biti izmedu 0 ili 126 !"); return 1; }
    if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Broj boje mora biti izmedu 0 ili 126 !"); return 1; }
    if(grupa < -1 || grupa > 4) { SendClientMessage(playerid, COLOR_GREY, "   Grupe mogu biti od 1 do 4"); return 1; }

switch(grupa) // tako si definirao varijablu za grupe
{
  case 0: // ako je admin ukucao broj 1 na parametru za grupe
  //new Float:A,Float:B,Float:C;
//GetPlayerPos(playerid, A,B,C);
        Event1 = CreateVehicle(car, 1136.7440,2172.1750,16.4465, 0.0, color1, color2, 60000);
        Event2 = CreateVehicle(car, 1133.2452,2172.0547,16.4458, 0.0, color1, color2, 60000);
        Event3 = CreateVehicle(car, 1130.0612,2172.0432,16.4465, 0.0, color1, color2, 60000);
        Event4 = CreateVehicle(car, 1126.5366,2171.9429,16.4467, 0.0, color1, color2, 60000);
        Event5 = CreateVehicle(car, 1123.1198,2171.8442,16.4445, 0.0, color1, color2, 60000);
        Event6 = CreateVehicle(car, 1119.9983,2171.8345,16.4455, 0.0, color1, color2, 60000);
        Event7 = CreateVehicle(car, 1116.5760,2171.9045,16.4470, 0.0, color1, color2, 60000);
        Event8 = CreateVehicle(car, 1113.0863,2171.7280,16.4445, 0.0, color1, color2, 60000);
        Event9 = CreateVehicle(car, 1110.0243,2171.8267,16.4603, 0.0, color1, color2, 60000);
        Event10 = CreateVehicle(car, 1106.3961,2171.7061,16.4469, 0.0, color1, color2, 60000);
        Event11 = CreateVehicle(car, 1103.0272,2171.7002,16.4459, 0.0, color1, color2, 60000);
        Event12 = CreateVehicle(car, 1099.6069,2172.1028,16.4436, 0.0, color1, color2, 60000);
        Event13 = CreateVehicle(car, 1096.2124,2171.9551,16.4455, 0.0, color1, color2, 60000);
        Event14 = CreateVehicle(car, 1092.9290,2172.1169,16.4234, 0.0, color1, color2, 60000);
        Event15 = CreateVehicle(car, 1089.4404,2171.7271,16.4498, 0.0, color1, color2, 60000);
        Event16 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
        }
        case 1:
        {
        Event17 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
        }
        case 2:
        {
        Event18 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
        }
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "*Admin %s, je kreirao grupu event vozila!",sendername);
            SendAdminMessage(COLOR_YELLOW, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Je Kreirao Grupu Event Vozila (Boja 1: %d | Boja 2: %d)",d,m,y,h,mi,s,sendername,color1,color2);
}
return 1;
}
    CMD:eunisti(playerid, params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
       if (PlayerInfo[playerid][pAdmin] >= 2)
   {
       DestroyVehicle(Event1);
       DestroyVehicle(Event2);
       DestroyVehicle(Event3);
       DestroyVehicle(Event4);
       DestroyVehicle(Event5);
       DestroyVehicle(Event6);
       DestroyVehicle(Event7);
       DestroyVehicle(Event8);
       DestroyVehicle(Event9);
       DestroyVehicle(Event10);
       DestroyVehicle(Event11);
       DestroyVehicle(Event12);
       DestroyVehicle(Event13);
       DestroyVehicle(Event14);
       DestroyVehicle(Event15);
       DestroyVehicle(Event16);
       /*DestroyVehicle(Event17);
       DestroyVehicle(Event18);
       GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, 256, "*Admin %s, je unistio grupu event vozila!",sendername);
       SendAdminMessage(COLOR_YELLOW, string);
       }
   else
   {
  SendClientMessage(playerid,COLOR_GRAD1,"{FFFFFF}[{F81414}AntiCS{FFFFFF}]{CCCCCC} Admini samo!");
   }
        return 1;
    }
    CMD:eport(playerid, params[])
{
       if (PlayerInfo[playerid][pAdmin] >= 2)
   {
   new string[128];
new sendername[MAX_PLAYER_NAME];
new Float:A,Float:B,Float:C;
new grupa;
GetPlayerPos(playerid, A,B,C);
SetVehiclePos(Event1,A,B+5,C+1, 0.0);
SetVehiclePos(Event2,A,B+5,C+1, 0.0);
SetVehiclePos(Event3,A,B+5,C+1, 0.0);
SetVehiclePos(Event4,A+5,B+5,C+1, 0.0);
SetVehiclePos(Event5,A+5,B+5,C+1, 0.0);
SetVehiclePos(Event6,A+5,B+5,C+1, 0.0);
SetVehiclePos(Event7,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event8,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event9,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event10,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event11,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event12,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event13,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event14,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event15,A+10,B+5,C+1, 0.0);
SetVehiclePos(Event16,A+10,B+5,C+1, 0.0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "*Admin %s, je teleportirao grupu event vozila do sebe (rotacija: 2)",sendername);
    SendAdminMessage(COLOR_YELLOW, string);
       }
   else
   {
  SendClientMessage(playerid,COLOR_GRAD1,"{FFFFFF}[{F81414}AntiCS{FFFFFF}]{CCCCCC} Admini samo!");
   }
        return 1;
    }

dodu ovi errori:


(22982) : error 002: only a single statement (or expression) can follow each "case"
(22982) : error 029: invalid expression, assumed zero
(22998) : error 014: invalid statement; not in switch
(22998) : warning 215: expression has no effect
(22998) : error 001: expected token: ";", but found ":"
(22998) : error 029: invalid expression, assumed zero
(22998) : fatal error 107: too many error messages on one line


linije:
Event2 = CreateVehicle(car, 1133.2452,2172.0547,16.4458, 0.0, color1, color2, 60000);
case 1:

Daj cijelu komandu , zeznio si nešto 100%
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

jel imas
new Event1;
new Event2;
new Event3;
itd ...

Citat: Dr.Ninexâ,,¢ poslato Januar 06, 2012, 23:40:18 POSLE PODNE
jel imas
new Event1;
new Event2;
new Event3;
itd ...

Šta ti pričaš? Da nema varijable definirane bacilo bi mu još 20 errora.
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

Citat: Dr.Ninexâ,,¢ poslato Januar 06, 2012, 23:40:18 POSLE PODNE
jel imas
new Event1;
new Event2;
new Event3;
itd ...

imam za sva vozila i opet dodu oni errori

Kažem ti postaj komandu nešto si zeznio.
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

CMD:ekreiraj(playerid, params[])
   {
new string[128];
new sendername[MAX_PLAYER_NAME];
          new color1;
             new color2;
         new car;
         new grupa;
         if (PlayerInfo[playerid][pAdmin] >= 1338)
      {
           if(sscanf(params, "iii", car, color1, color2)) return SCM(playerid, -1, "{FFFFFF}[{F81414}Ekreiraj{FFFFFF}]{CCCCCC}:{FFFFFF} [id_vozila] [boja1] [boja2] [grupa]");
         if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   ID vozila mora biti izmedu 400 ili 611 !"); return 1; }
            if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Broj boje mora biti izmedu 0 ili 126 !"); return 1; }
            if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Broj boje mora biti izmedu 0 ili 126 !"); return 1; }
            if(grupa < -1 || grupa > 4) { SendClientMessage(playerid, COLOR_GREY, "   Grupe mogu biti od 1 do 4"); return 1; }

      switch(grupa) // tako si definirao varijablu za grupe
      {
            case 0: // ako je admin ukucao broj 1 na parametru za grupe
           //new Float:A,Float:B,Float:C;
         //GetPlayerPos(playerid, A,B,C);
           Event1 = CreateVehicle(car, 1136.7440,2172.1750,16.4465, 0.0, color1, color2, 60000);
           Event2 = CreateVehicle(car, 1133.2452,2172.0547,16.4458, 0.0, color1, color2, 60000);
           Event3 = CreateVehicle(car, 1130.0612,2172.0432,16.4465, 0.0, color1, color2, 60000);
           Event4 = CreateVehicle(car, 1126.5366,2171.9429,16.4467, 0.0, color1, color2, 60000);
           Event5 = CreateVehicle(car, 1123.1198,2171.8442,16.4445, 0.0, color1, color2, 60000);
           Event6 = CreateVehicle(car, 1119.9983,2171.8345,16.4455, 0.0, color1, color2, 60000);
           Event7 = CreateVehicle(car, 1116.5760,2171.9045,16.4470, 0.0, color1, color2, 60000);
           Event8 = CreateVehicle(car, 1113.0863,2171.7280,16.4445, 0.0, color1, color2, 60000);
           Event9 = CreateVehicle(car, 1110.0243,2171.8267,16.4603, 0.0, color1, color2, 60000);
           Event10 = CreateVehicle(car, 1106.3961,2171.7061,16.4469, 0.0, color1, color2, 60000);
           Event11 = CreateVehicle(car, 1103.0272,2171.7002,16.4459, 0.0, color1, color2, 60000);
           Event12 = CreateVehicle(car, 1099.6069,2172.1028,16.4436, 0.0, color1, color2, 60000);
           Event13 = CreateVehicle(car, 1096.2124,2171.9551,16.4455, 0.0, color1, color2, 60000);
           Event14 = CreateVehicle(car, 1092.9290,2172.1169,16.4234, 0.0, color1, color2, 60000);
           Event15 = CreateVehicle(car, 1089.4404,2171.7271,16.4498, 0.0, color1, color2, 60000);
           Event16 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
           }
           case 1:
           {
           Event17 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
           }
           case 2:
           {
           Event18 = CreateVehicle(car, 1086.1814,2171.8413,16.4454, 0.0, color1, color2, 60000);
           }
         GetPlayerName(playerid, sendername, sizeof(sendername));
         format(string, 256, "*Admin %s, je kreirao grupu event vozila!",sendername);
            SendAdminMessage(COLOR_YELLOW, string);
         new y, m, d;
         new h,mi,s;
         getdate(y,m,d);
         gettime(h,mi,s);
         format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Je Kreirao Grupu Event Vozila (Boja 1: %d | Boja 2: %d)",d,m,y,h,mi,s,sendername,color1,color2);
}
      return 1;
   }
    CMD:eunisti(playerid, params[])
   {
   new string[128];
new sendername[MAX_PLAYER_NAME];
       if (PlayerInfo[playerid][pAdmin] >= 2)
      {
       DestroyVehicle(Event1);
       DestroyVehicle(Event2);
       DestroyVehicle(Event3);
       DestroyVehicle(Event4);
       DestroyVehicle(Event5);
       DestroyVehicle(Event6);
       DestroyVehicle(Event7);
       DestroyVehicle(Event8);
       DestroyVehicle(Event9);
       DestroyVehicle(Event10);
       DestroyVehicle(Event11);
       DestroyVehicle(Event12);
       DestroyVehicle(Event13);
       DestroyVehicle(Event14);
       DestroyVehicle(Event15);
       DestroyVehicle(Event16);
       /*DestroyVehicle(Event17);
       DestroyVehicle(Event18);
       GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, 256, "*Admin %s, je unistio grupu event vozila!",sendername);
       SendAdminMessage(COLOR_YELLOW, string);
       }
      else
      {
        SendClientMessage(playerid,COLOR_GRAD1,"{FFFFFF}[{F81414}AntiCS{FFFFFF}]{CCCCCC} Admini samo!");
      }
        return 1;
    }
    CMD:eport(playerid, params[])
   {
       if (PlayerInfo[playerid][pAdmin] >= 2)
      {
      new string[128];
new sendername[MAX_PLAYER_NAME];
   new Float:A,Float:B,Float:C;
   new grupa;
   GetPlayerPos(playerid, A,B,C);
   SetVehiclePos(Event1,A,B+5,C+1, 0.0);
   SetVehiclePos(Event2,A,B+5,C+1, 0.0);
   SetVehiclePos(Event3,A,B+5,C+1, 0.0);
   SetVehiclePos(Event4,A+5,B+5,C+1, 0.0);
   SetVehiclePos(Event5,A+5,B+5,C+1, 0.0);
   SetVehiclePos(Event6,A+5,B+5,C+1, 0.0);
   SetVehiclePos(Event7,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event8,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event9,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event10,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event11,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event12,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event13,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event14,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event15,A+10,B+5,C+1, 0.0);
   SetVehiclePos(Event16,A+10,B+5,C+1, 0.0);
   GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, 256, "*Admin %s, je teleportirao grupu event vozila do sebe (rotacija: 2)",sendername);
    SendAdminMessage(COLOR_YELLOW, string);
       }
      else
      {
        SendClientMessage(playerid,COLOR_GRAD1,"{FFFFFF}[{F81414}AntiCS{FFFFFF}]{CCCCCC} Admini samo!");
      }
        return 1;
    }