/v u dialogu mala pomoc

Započeo Patrick, Oktobar 19, 2011, 22:17:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Patrick

Skripta koju korsitim: -
Dio skkripte:
Citatif(strcmp(cmd,"/v",true)==0)
   {
      GetPlayerName(playerid,playername,sizeof(playername));
        tmp = strtok(cmdtext, idx);
       if(!strlen(tmp))
       {
          SendClientMessage(playerid,0x50B4FFFF," ______________________________________");
           SendClientMessage(playerid,0x50B4FFFF,"/v prodaj,lociraj  /vpark");
           SendClientMessage(playerid,0x50B4FFFF," ______________________________________");
           return 1;
       }
       if(strcmp(tmp,"exit",true)==0)
       {
           CarOffered[playerid]=0;
           RemovePlayerFromVehicle(playerid);
           TogglePlayerControllable(playerid, 1);
           return 1;
    }
      if(strcmp(tmp, "prodaj", true) == 0)
      {
          if(IsPlayerConnected(playerid))
         {
            GetPlayerName(playerid, playername, sizeof(playername));
            if(pCarKey[playerid] == 0)
            {
               SendClientMessage(playerid, COLOR_GREY, "Nemas vlastito vozilo!");
               return 1;
            }
            if(pCarKey[playerid]!=0 && strcmp(playername, CarInfo[pCarKey[playerid]][cOwner], true) == 0)
            {
               new car = pCarKey[playerid];
               CarInfo[car][cOwned] = 0;
               GetPlayerName(playerid, sendername, sizeof(sendername));
               strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
               GivePlayerMoney(playerid,CarInfo[car][cValue]);
               PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
               format(string, sizeof(string), "{FFFFFF}Prodali ste vase vozilo za {F81414}%d%", CarInfo[car][cValue]);
               SendClientMessage(playerid, COLOR_ORANGE, string);
               RemovePlayerFromVehicle(playerid);
               TogglePlayerControllable(playerid, 1);
               pCarKey[playerid] = 0;
               SaveCars();
               return 1;
            }
         }
         return 1;
      }
      if(strcmp(tmp, "lociraj", true) == 0)
      {
          if(!IsPlayerConnected(playerid)) { return 1; }
          if(pCarKey[playerid] == 0) { GameTextForPlayer(playerid, "~w~Nemas auto", 2500, 3); return 1; }
          if(cartrack[playerid]==0)
          {
              SendClientMessage(playerid,COLOR_WHITE,"Lokacija oznacena!(Crveni marker)");
              SetPlayerCheckpoint(playerid,CarInfo[pCarKey[playerid]][cLocationx], CarInfo[pCarKey[playerid]][cLocationy], CarInfo[pCarKey[playerid]][cLocationz], 5.0);
              cartrack[playerid] = 1;
              return 1;
         }
         else
         {
              SendClientMessage(playerid,COLOR_WHITE,"Dosao si do svog vozila");
              DisablePlayerCheckpoint(playerid);
              cartrack[playerid] = 0;
              return 1;
         }
        }
  }


   if(strcmp(cmd,"/vpark",true)==0)
   {
      new vehicleid =  GetPlayerVehicleID(playerid);
      if(pCarKey[playerid] == 0) { SendClientMessage(playerid,COLOR_GRAD2," Nemas vlastito vozilo!"); return 1; }
      if(IsPlayerConnected(playerid))
      {
          for(new i = 0; i < sizeof(CarInfo); i++)
          {
             if(vehicleid == CarInfo[ownedvehicle])
             {
                      new Float:x,Float:y,Float:z;
               new Float:a;
               GetVehiclePos(vehicleid, x, y, z);
               GetVehicleZAngle(vehicleid, a);
               CarInfo[cLocationx] = x;
               CarInfo[cLocationy] = y;
               CarInfo[cLocationz] = z;
               CarInfo[cAngle] = a;
            }
         }
      }
      SaveCars();
      new Float:x;
      new Float:y;
      new Float:z;
      new Float:a;
      GetPlayerPos(playerid,x,y,z);
      GetPlayerFacingAngle(playerid,a);
      new formatPARK[256];
      format(formatPARK,sizeof(formatPARK),"{FFFFFF}Auto parkiran na lokaciju {F81414}%s",GetPlayerZone(playerid));
      SendClientMessage(playerid,COLOR_GREEN, formatPARK);
      return 1;
   }
   

Problem koji me muci: Dakle ovako napravio sam novu definiciju
Citat#define DIALOGID 5000
dialo da mi prikazuje  onda sam napravio komandu
Citatif(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
   {
               ShowPlayerDialog(playerid,1001,DIALOG_STYLE_LIST,"Vozilo","Parkiraj/nZakljucaj/nOdkljucaj/nBoja/nProdaj/nLociraj/nUgasi gps","Uradi","Izadji");
   }


i napravio sam tak
Citatcase 0:, case 1:
kao sto je ovo samo za lociraj i prodaj i uopce mi nece compile pa sam mislio ako bi mi neko mogao tak napravit da bi se ja nacuio HVala! ovo je moj primjer kak sam napravio al neznam ako je dobro ovo je samo case 1:
Citatcase 1:
        {
        if(strcmp(tmp, "lociraj", true) == 0)
      {
          if(!IsPlayerConnected(playerid)) { return 1; }
          if(pCarKey[playerid] == 0) { GameTextForPlayer(playerid, "~w~Nemas auto", 2500, 3); return 1; }
          if(cartrack[playerid]==0)
          {
              SendClientMessage(playerid,COLOR_WHITE,"Lokacija oznacena!(Crveni marker)");
              SetPlayerCheckpoint(playerid,CarInfo[pCarKey[playerid]][cLocationx], CarInfo[pCarKey[playerid]][cLocationy], CarInfo[pCarKey[playerid]][cLocationz], 5.0);
              cartrack[playerid] = 1;
              return 1;
         }
         else
         {
              SendClientMessage(playerid,COLOR_WHITE,"Dosao si do svog vozila");
              DisablePlayerCheckpoint(playerid);
              cartrack[playerid] = 0;
              return 1;
        }

Moze neko pomoc??
Ex Yu Gaming Comunity [Otvorenje danas 9.7.2011 u 20:00 sati] IP servera:178.63.80.210:7892


cristiane