[POMOC] /gov komanda,

Započeo Lexa, Septembar 06, 2012, 04:31:36 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim:CLRP
Detaljan opis problema:Problem imam kod ubacivanja nove organizacije koja je koa PD,FBI-  a moja orga je CIA.Ne radi mi /gov i prijavljuje mi eror kod /m komande kad stavim !IsACiaCar(tmpcar)).Sve sam pregledao i sve uradio kao FBI,ali ne znam kako nee da radi gov???Stalno mi prijavljuje niste clan Policije,mada sam sve uradio kao sto ima FBI???
Da li ima tut kao praviti druge Policije na skripti sa svim komndama koje ima LSPD?
Dio skripte:

   if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(gTeam[playerid] != 2)
         {
             if(PlayerInfo[playerid][pLeader] != 7)
             {
                SendClientMessage(playerid, COLOR_GREY, "Niste policajac!");
                return 1;
            }
         }
         if(PlayerInfo[playerid][pRank] < 6)
         {
             SendClientMessage(playerid, COLOR_GREY, "Morate biti rank 6 da biste ovo koristili !");
             return 1;
         }
         GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[64];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/gov)ernment [text]");
            return 1;
         }
         SendClientMessageToAll(COLOR_WHITE, "|___________ Najave iz Uprave ___________|");
         if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
         {
            if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "P.D Direktor %s: {FFFFFF}%s.", sendername, result); }
             else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "P.D Direktor %s: {FFFFFF}%s.", sendername, result); }
             else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "P.D Direktor %s: {FFFFFF}%s.", sendername, result); }
            SendClientMessageToAll(COLOR_BLUE, string);
         }
         else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
         {
            format(string, sizeof(string), "FBI Direktor %s: {FFFFFF}%s.", sendername, result);
            SendClientMessageToAll(COLOR_BLUE, string);
         }
         else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
         {
            format(string, sizeof(string), "Pukovnik %s: {FFFFFF}%s.", sendername, result);
            SendClientMessageToAll(COLOR_BLUE, string);
         }
         else if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
         {
            format(string, sizeof(string), "CIA Direktor %s: {FFFFFF}%s.", sendername, result);
            SendClientMessageToAll(COLOR_BLUE, string);
         }
         else if(PlayerInfo[playerid][pLeader] == 7)
         {
            format(string, sizeof(string), "Gradonacelnik %s: {FFFFFF}%s.", sendername, result);
            SendClientMessageToAll(COLOR_BLUE, string);
         }
      }
      return 1;
   }
---------------------------------------------------------------------------------------------------------------------------------------------
Problem erora kod /m komande - prijavi  error 017: undefined symbol "IsACiaCar"(kad ga izbrisem onda radi)?       


   if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         new tmpcar = GetPlayerVehicleID(playerid);
         GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[128];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/m)egaphone [megaphone chat]");
            return 1;
         }
         if(gTeam[playerid] == 2 || IsACop(playerid) || IsAnFbiCar(playerid) || IsNgCar(playerid) || IsAArmijacar(playerid) || IsAnCiaCar(playerid))
            {
            if(!IsACopCar(tmpcar) || !IsAnFbiCar(tmpcar) || !IsNgCar(tmpcar) || !IsAArmijacar(tmpcar) || !IsACiaCar(tmpcar))
            {
               if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
               {
                   new currank[64];
                   if(PlayerInfo[playerid][pRank] == 1) { currank = "PD.Kadet"; }
                  else if(PlayerInfo[playerid][pRank] == 2) { currank = "PD.Policajac"; }
                  else if(PlayerInfo[playerid][pRank] == 3) { currank = "PD.Narednik"; }
                  else if(PlayerInfo[playerid][pRank] == 4) { currank = "PD.Inspektor"; }
                  else if(PlayerInfo[playerid][pRank] == 5) { currank = "PD.Porucnik"; }
                  else if(PlayerInfo[playerid][pRank] == 6) { currank = "PD.Nacelnik "; }
                  else { currank = "PD.Kadet"; }
                  format(string, sizeof(string), "[%s %s:o< %s]", currank, sendername, result);
                  ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
               }
               else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
               {
                  format(string, sizeof(string), "[FBI Agent %s:o< %s]", sendername, result);
                  ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
               }
               else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
               {
                  format(string, sizeof(string), "[Casnik %s:o< %s]", sendername, result);
                  ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
               }
               else if(PlayerInfo[playerid][pMember] == 19||PlayerInfo[playerid][pLeader] == 19)
                    {
                   new ciarank[64];
                   if(PlayerInfo[playerid][pRank] == 1) { ciarank = "Agent"; }
                  else if(PlayerInfo[playerid][pRank] == 2) { ciarank = "Visi Agent"; }
                  else if(PlayerInfo[playerid][pRank] == 3) { ciarank = "Obavjestajac"; }
                  else if(PlayerInfo[playerid][pRank] == 4) { ciarank = "Inspektor"; }
                  else if(PlayerInfo[playerid][pRank] == 5) { ciarank = "Savjetnik"; }
                  else if(PlayerInfo[playerid][pRank] == 6) { ciarank = "Direktor"; }
                  else { ciarank = "Agent"; }
                  format(string, sizeof(string), "[CIA Agent %s:o< %s]", sendername, result);
                  ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
               }
               else if(PlayerInfo[playerid][pMember] == 17||PlayerInfo[playerid][pLeader] == 17)
               {
                  new armijarank[64];
                   if(PlayerInfo[playerid][pRank] == 1) { armijarank = "Vojnik"; }
                  else if(PlayerInfo[playerid][pRank] == 2) { armijarank = "Skupnik"; }
                  else if(PlayerInfo[playerid][pRank] == 3) { armijarank = "Narednik"; }
                  else if(PlayerInfo[playerid][pRank] == 4) { armijarank = "Poruènik"; }
                  else if(PlayerInfo[playerid][pRank] == 5) { armijarank = "Pukovnik"; }
                  else if(PlayerInfo[playerid][pRank] == 6) { armijarank = "General"; }
                  else { armijarank = "Vojnik"; }
                  format(string, sizeof(string), "[%s %s:o< %s]", armijarank, sendername, result);
                  ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
               }
               printf("%s", string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Niste u policajskom vozilu!");
                return 1;
            }
            }
         else
         {
             SendClientMessage(playerid, COLOR_GRAD2, "Niste clan Tima!");
            return 1;
         }
      }
      return 1;


Poslednja Izmena: Septembar 06, 2012, 04:37:15 PRE PODNE od Lexa

Ništa te nisam razumeo. Loše koristiš znakove interpunkcije.

Ne radi /gov? Da li dobijaš neku poruku na serveru kada ukucaš /gov? Da li ti ne radi samo za CIA?

Za PD i FBI ako nisi menjao IDove organizacije i gTeam onda bi trebalo da radi. Moguće da nisi podešavao gTeam kada si ubacivao CIA. Pokušaj ovo

  if(gTeam[playerid] != 2)

zameniti ovim

  if(gTeam[playerid] != 2 || PlayerInfo[playerid][pLeader] == ID_ORGANIZACIJE ||  PlayerInfo[playerid][pMember] == ID_ORGANIZACIJE)

Umesto ID_ORGANIZACIJE napiši id od tvoje org (CIA).




Kod /m imaš

     if(gTeam[playerid] == 2 || IsACop(playerid) || IsAnFbiCar(playerid) || IsNgCar(playerid) || IsAArmijacar(playerid) || IsAnCiaCar(playerid))
            {
            if(!IsACopCar(tmpcar) || !IsAnFbiCar(tmpcar) || !IsNgCar(tmpcar) || !IsAArmijacar(tmpcar) || !IsACiaCar(tmpcar))


Ovo ti je paradoks ... Prvo kažeš da se komanda može izvršiti samo ako jeste u vozilu, a odmah posle samo ako nije u vozilu PDa, FBIa i sl.
Briši ovaj drugi if .. a verovatno ćeš morati obrisati i još neku vitičastu zagradu.
Poslednja Izmena: Septembar 06, 2012, 05:06:09 PRE PODNE od mikec


if(PlayerInfo[playerid][pLeader] != 7)
             {
                SendClientMessage(playerid, COLOR_GREY, "Niste policajac!");
                return 1;
            }


Ako igrac nije lider organizacije ID 7 da mu izbaci poruku i da returna? :S

Zameni sa recimo

PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != 2
//u slucaju da ti je PD org id 1 a FBI org id 2 :)

Problem kod komande /gov kad koristim kod CIA je sto pise -Niste Policajac !
Problem uopste je  if(gTeam[playerid] == 2 gdje se nalaze i PD,FBI,SWAT kako dodati CIA da bude u tom timu?

Vegas.

Pod /makeleader za CIA staviš da je npr gTeam[playerid] = 3;

Citat: Vegas. poslato Septembar 06, 2012, 13:33:32 POSLE PODNE
Pod /makeleader za CIA staviš da je npr gTeam[playerid] = 3;



Ne znam gdje bih to stavio-
----------------------------------------------------------------
   if(strcmp(cmd, "/makeleader", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeleader [ID Igraca/Dio Imena] [Broj(1-17)]");
            SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
            SendClientMessage(playerid, 0x33CCFFAA, "1.Police Departament || 2.Federal Bureau of Investigation || 3.S.W.A.T || 4.MD ");
            SendClientMessage(playerid, 0x33CCFFAA, "5.Yakuze || 6.L.C.N || 7.Gradonacalnik || 8.Hitman || 9.CNN || 10.Taxi || 12.Ballas");
            SendClientMessage(playerid, 0x33CCFFAA, "13.Los Surenos || 14.Carbon Racer's || 15.GSF || 16.NGR || 17.Armija || 18.Ruska Mafija || 19.C.I.A");
            SendClientMessage(playerid, 0x33CCFFAA, "20.Trijade || 21.Vagos ");
            SendClientMessage(playerid, LIGHTRED, "|_________________________________________________________________________________|");
            return 1;
         }
         new para1;
         new level;
         para1 = ReturnUser(tmp);
         tmp = strtok(cmdtext, idx);
         level = strval(tmp);
         if(level > 21 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Nemojte ispod 0, ili preko 21!"); return 1; }
         if (PlayerInfo[playerid][pAdmin] >= 1337)
         {
             if(IsPlayerConnected(para1))
             {
                 if(para1 != INVALID_PLAYER_ID)
                 {
                     if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
                     {
                         SendClientMessage(playerid, COLOR_GREY, "Taj igrac je clan neke organizacije!");
                         return 1;
                     }
                  GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  PlayerInfo[para1][pLeader] = level;
                  format(string, sizeof(string), "* Postavljen si za lidera bande/mafije | Od strane Admina: {FFFFFF}%s", sendername);
                  SendClientMessage(para1, SVETLOPLAVA, string);
                  format(string, sizeof(string), "* Postavio si %s-a da vodi {FFFFFF}| %d.", giveplayer,level);
                  SendClientMessage(playerid, SVETLOPLAVA, string);
                  if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
                  else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //LS PD
                  else if(level == 2) { PlayerInfo[para1][pChar] = 165; } //FBI
                  else if(level == 3) { PlayerInfo[para1][pChar] = 166; } //s.wat
                  else if(level == 4) { PlayerInfo[para1][pChar] = 228; } //hitna
                  else if(level == 5) { PlayerInfo[para1][pChar] = 294; } //Yakuza
                  else if(level == 6) { PlayerInfo[para1][pChar] = 113; } //LCN
                  else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //gradonacelnik
                  else if(level == 8) { PlayerInfo[para1][pChar] = 299; } //Hitman
                  else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //Novinari
                  else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
                  else if(level == 12) { PlayerInfo[para1][pChar] = 104; } //TEC
                  else if(level == 13) { PlayerInfo[para1][pChar] = 292; } //surenos
                  else if(level == 14) { PlayerInfo[para1][pChar] = 21; } //carbon racers
                  else if(level == 15) { PlayerInfo[para1][pChar] = 271; } //GSfly
                  else if(level == 16) { PlayerInfo[para1][pChar] = 122; } //NGR
                  else if(level == 17) { PlayerInfo[para1][pChar] = 287; } //Armija
                  else if(level == 18) { PlayerInfo[para1][pChar] = 113; } //Ruska Mafija
                  else if(level == 19) { PlayerInfo[para1][pChar] = 228; } //CIA
                  else if(level == 20) { PlayerInfo[para1][pChar] = 123; } //Trijade
                  else if(level == 21) { PlayerInfo[para1][pChar] = 110; } //Vagos

                  if(level == 0)
                  {
                      gTeam[para1] = 3;
                      PlayerInfo[para1][pTeam] = 3;
                  }
                  else if(level == 1 || level == 2 || level == 3)
                  {
                      gTeam[para1] = 2;
                      PlayerInfo[para1][pTeam] = 2;
                  }
                  else if(level == 4)
                  {
                      gTeam[para1] = 1;
                      PlayerInfo[para1][pTeam] = 1;
                  }
                  else
                  {
                      gTeam[para1] = 15;
                      PlayerInfo[para1][pTeam] = 15;
                  }

                   SetPlayerSkin(para1, PlayerInfo[para1][pChar]);

                   if(level == 0)
                   {
                       PlayerInfo[para1][pRank] = 0;
                   }
                   else
                   {
                      PlayerInfo[para1][pRank] = 6;
                  }
               }
            }//not connected
         }
         else
         {
            SendClientMessage(playerid, WHITE, " Niste ovlasteni da koristite tu komandu.");
         }
      }
      return 1;

  else if(level == 1 || level == 2 || level == 3)
                  {
                      gTeam[para1] = 2;
                      PlayerInfo[para1][pTeam] = 2;
                  }


Stavi ovde još i CIA, koliko vidim, njen ID je 19, tako da:

  else if(level == 1 || level == 2 || level == 3 || level == 19)
                  {
                      gTeam[para1] = 2;
                      PlayerInfo[para1][pTeam] = 2;
                  }



Usput,
Citat: dock poslato Septembar 06, 2012, 11:07:48 PRE PODNE

if(PlayerInfo[playerid][pLeader] != 7)
             {
                SendClientMessage(playerid, COLOR_GREY, "Niste policajac!");
                return 1;
            }


Ako igrac nije lider organizacije ID 7 da mu izbaci poruku i da returna? :S

Zameni sa recimo

PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != 2
//u slucaju da ti je PD org id 1 a FBI org id 2 :)


To i nije toliko bitno za posmatranu situaciju. :)
Poslednja Izmena: Septembar 06, 2012, 15:37:01 POSLE PODNE od mikec