[Pomoc] /v komanda mala pomoc s dialogom

Započeo Patrick, Oktobar 20, 2011, 11:35:54 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Patrick

Skripta koju koristim: Moj mod
Detaljan opis problema: Htio bi stavit komandu /V u dialog napravio sam al mi pawo prestane radit imam previse errora definisao sam si novi dialog id 5000 i kad napravim kak treba nece radi ako bi mi ko mogao napravit onda bi si ja dalje za /Mo i ostale ownershipe napravio sam HVALA!
Dio skripte:
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;
   }
Neke slike/video za lakse dobivanje pomoci(neobavezno):

dragan12

http://balkan-samp.com/forum/index.php?topic=32304.0
Isti princip samo uradis tako i probaj samo stavi svoje delove iz komande i ostalo sredi sto trebas :)

Patrick

evo napravio sam samo za lociraj sad prvo da vidim ako cu znat al imam 26errora :'(

Citatif(dialogid == 1234)
    {
            if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
            {
            switch(listitem)
            {
            case 0:
                {
                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;
      }
               


napravio sam
Citat#define dialogid 1234

napravio sam i komandu /V a ovo staru sam iskljucio
Citat
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
   {
               ShowPlayerDialog(playerid,1234,DIALOG_STYLE_LIST,"Vozilo","Lociraj","Uradi","Izadji");
   }
   

Citat: Patrick poslato Oktobar 20, 2011, 22:13:02 POSLE PODNE
evo napravio sam samo za lociraj sad prvo da vidim ako cu znat al imam 26errora :'(

Citatif(dialogid == 1234)
    {
            if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
            {
            switch(listitem)
            {
            case 0:
                {
                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;
      }
               


napravio sam
Citat#define dialogid 1234

napravio sam i komandu /V a ovo staru sam iskljucio
Citat
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
   {
               ShowPlayerDialog(playerid,1234,DIALOG_STYLE_LIST,"Vozilo","Lociraj","Uradi","Izadji");
   }
   

Erori su ti zbog zagrada.. Imas 10 otvorenih { , i samo jednu zatvorenu }
Street's Creed

Street's Creed gaming zajednica se vraća.
Forum: www.streets-creed.info
IP: 213.149.60.34:7774

Patrick


dragan12

if(dialogid == 1234)
   {
           if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
           {
           switch(listitem)
           {
           case 0:
               {
           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();
}
}
//Tu za case 1:
}
}
        return 1;
     }
               



               if(strcmp(tmp, "prodaj", true) == 0)
                   {
         f(IsPlayerConnected(playerid))
        {

Te dve stvari ti uopste nisu bile potrebne. ono prvo je za proveru da li je ukucao prodaj, a ovo je drugo zastarela funkcija koja nije potrebna sada da se koristi.
Poslednja Izmena: Oktobar 21, 2011, 13:23:40 POSLE PODNE od [BD]Gagi

Patrick

4 errora


CitatC:\Users\Beno Laptop\Desktop\rallstonica gm\pawno\include\JunkBuster.inc(3239) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(9123) : warning 219: local variable "skin" shadows a variable at a preceding level
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(11902) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(11902) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(11906) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\gm\gamemodes\bwwrp.pwn(11912) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(11985) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\a gm\gamemodes\bwwrp.pwn(13359) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(13360 -- 13369) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(18245) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(18246) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(18247) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(18248) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\rallstonica gm\gamemodes\bwwrp.pwn(18249) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\gm\gamemodes\bwwrp.pwn(18250) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(18251) : warning 213: tag mismatch
C:\Users\Beno Laptop\Desktop\gm\gamemodes\bwwrp.pwn(18464) : warning 216: nested comment
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(20357) : error 017: undefined symbol "playername"
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(20357) : error 017: undefined symbol "playername"
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(20357) : error 029: invalid expression, assumed zero
C:\Users\Beno Laptop\Desktop\ gm\gamemodes\bwwrp.pwn(20357) : 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.

dobro ima i dots wariniga to imam vec od prije al sad kad onda stav im
Citatnew playername [MAX_PLAYER_NAME];

opet baci da sender name onda opet za string i opet 6 errora za player name -.-


if(dialogid == 1234)
{
if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
else
{
switch(listitem)
{
case 0:
{
new
playername[MAX_PLAYER_NAME];

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))
{
   new car = pCarKey[playerid];
   CarInfo[car][cOwned] = 0;
   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();
}
}
//Tu za case 1:
}
}
}
}
}

Last nick: Paradox

Patrick


Probaj ovako:

if(dialogid == 1234)
{
if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
else
{
switch(listitem)
{
case 0:
{
new
playername[MAX_PLAYER_NAME];

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))
{
   new car = pCarKey[playerid];
   CarInfo[car][cOwned] = 0;
   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();
}
}
/*Tu za case 1:
}
}*/
}
}
}

Last nick: Paradox