[Pomoc] Komanda /v

Započeo ...Nikola..., Oktobar 19, 2011, 17:23:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: LARP Edit
Detaljan opis problema: Da li neko moze da mi ovu komandu stavi u Dialog i da mi radi sve ovo sto je ponudjeno
Dio skripte:
  if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        new x_nr[64];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Koristenje: /v(ozilo) [ime]");
            SendClientMessage(playerid, 0x83BFBFAA, "Moguca imena: parkiraj, lock, unlock, boja ,prodaj, lociraj, gpsoff");
            return 1;
        }
        if(strcmp(x_nr,"parkiraj",true) == 0)
        {
          if(IsPlayerConnected(playerid))
  {
new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
    if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
          for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][mA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][mA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
}
return 1;
}
else if(strcmp(x_nr,"lock",true) == 0)
        {
                    new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo zakljucano!");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
Vozila[skljuc][mZakljucan] = 1;
UpdateVozilo(skljuc);
return 1;
}
}
return 1;
        }
        else if(strcmp(x_nr,"unlock",true) == 0)
        {
                    new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo otkljucano!");
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
Vozila[skljuc][mZakljucan] = 0;
UpdateVozilo(skljuc);
return 1;
}
}
return 1;
        }
       else if(strcmp(x_nr,"boja",true) == 0)
        {
        new boja[2];
    new skljuc = PlayerInfo[playerid][pMainKey];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
      {
if(PlayerInfo[playerid][pMainKey] != 255)
      {
        for(new i = 1; i < sizeof(Vozila); i++)
{
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
boja[0] = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
  boja[1]= strval(tmp);
    Vozila[skljuc][mpBoja] = boja[0];
      Vozila[skljuc][mdBoja] = boja[1];
ChangeVehicleColor(Vozila[skljuc][mOsobno], Vozila[skljuc][mpBoja],Vozila[skljuc][mdBoja]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vasa nova boja je postavljena!");
UpdateVozilo(skljuc);
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nisi u svome vozilu!");
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Moras biti u svom vozilu!");
}
return 1;
        }
     else if(strcmp(x_nr,"prodaj",true) == 0)
        {
     if(GetPlayerState(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid,12.0,1106.5691,-1428.4077,15.7969))
    {
new mkljuc = PlayerInfo[playerid][pMainKey];
new kljuc0 = GetMyCar2(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pMainKey] != 255)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(mkljuc == i)
    {
    if( Vozila[mkljuc][mKoristen] == 1)
    {
      if(PlayerInfo[playerid][pCar1] != 255 && PlayerInfo[playerid][pCar2] != 255)
        {
            if(PlayerInfo[playerid][pMainKey] == PlayerInfo[playerid][pCar1])
                {
                Vozila[kljuc0][mBroj] = 1;
                UpdateVozilo(kljuc0);
                }
        }
        new varid = CjenaVozilaIzModela(GetVehicleModel(GetPlayerVehicleID(playerid)));
    Vozila[mkljuc][mKoristen] = 0;
    Vozila[mkljuc][mModel] = 0;
Vozila[mkljuc][mX] = 0;
Vozila[mkljuc][mY] = 0;
Vozila[mkljuc][mZ] = 0;
Vozila[mkljuc][mA] = 0;
Vozila[mkljuc][mBroj] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Vozila[mkljuc][mVlasnik], "Drzava", 0, strlen("Drzava"), 999);
if(PlayerInfo[playerid][pCar1] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar1] = 255;}
else if(PlayerInfo[playerid][pCar2] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar2] = 255;}
if(PlayerInfo[playerid][pCar1] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar1];}
else if(PlayerInfo[playerid][pCar2] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar2];}
else {PlayerInfo[playerid][pMainKey] = 255;}
DestroyVehicle(vehicleid);
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, Modeli_vozila[varid][1]);
SendClientMessage(playerid, COLOR_GREEN, "Prodali ste vozilo!");
UpdateVozilo(i);
return 1;
   }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Niste u svom vozilu!!");
return 1;
}
}
}
}
    }
    else
    {
     SendClientMessage(playerid, COLOR_LIGHTRED, "Niste na mjestu za prodaju (kod >>delivery<< mjesta)!");
      }
  }
    else
{
    SendClientMessage(playerid, COLOR_LIGHTRED, "Trebate biti u vozilu!");
  }
  return 1;
        }
else if(strcmp(x_nr,"lociraj",true) == 0)
        {
                    new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
{
    if(PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
        return 1;
        }
        new Float:aX ,Float:aY ,Float:aZ;
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
        /*
if(Signal(playerid) == 6)
    {
GameTextForPlayer(playerid, "~r~Nema signala!", 1000, 1);
return 1;
    }
else if(Signal(playerid) == 5)
    {
    new signalrandom = random(6);
    switch(signalrandom)
      {
        case 0, 1, 2, 3:
        {
            SCM(playerid, COLOR_LIGHTRED, "Signal slab! Neuspjelo lociranje!");
        }
        case 4, 5:
        {
            GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS:Signal slab... Odrediste oznaceno na karti!");
        }
    }
    }
else
*/
{
GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS: Odrediste oznaceno na karti!");
        }

}
}
return 1;
        }
        else if(strcmp(x_nr,"gpsoff",true) == 0)
        {
            if(PlayerInfo[playerid][pMainKey] != 255)
        {
            DisablePlayerCheckpoint(playerid);
            }
            else
            {
            SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
            }
return 1;
        }
        else
        {
             SendClientMessage(playerid, COLOR_LIGHTBLUE, "Koristenje: /v(ozilo) [ime]");
            SendClientMessage(playerid, 0x83BFBFAA, "Moguca imena: parkiraj, lock, unlock, boja,prodaj, lociraj, gpsoff");
            return 1;
        }
    }
    return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /

dragan12

Pa koristi ShowPlayerDialog(playerid,ID DIALOG STAVI,DIALOG_STYLE_LIST,"Kupnja","Kupi\nBoja....","Uradi","Izadji");
I onda pod OnDialogResponse samo ubacujes
http://wiki.sa-mp.com/wiki/OnDialogResponse

Ali nije mi jasno Gde sta da postavim zato sam i otvorio temu.Mozete li mi objasniti to na primeru Parkiranja nisam se bavio ovime
Poslednja Izmena: Oktobar 19, 2011, 17:36:21 POSLE PODNE od ...Nikola...

dragan12

if(dialogid == ID DIALOGA KOJI SI STAVIO)
    {
            if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
            {
            switch(listitem)
            {
                case 0:
                {
new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
    if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
          for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][mA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][mA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}                 
                }
                case 1:
                {
                    //Pa stvar dva koja je po redu prebacis
                }
                case 2:
                {
                    //Pa stvar tri koja je po redu prebacis
                }
                case 3:
                {
                    //Pa stvar cetiri koja je po redu prebacis
                }
               

            }

        }
       

    }

To je primer.
A ono ShowPlayerDialog ide u komandu

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
{
       new x_nr[64];
       x_nr = strtok(cmdtext, idx);
       if(!strlen(x_nr))
       {
           ShowPlayerDialog(playerid,1001,DIALOG_STYLE_LIST,"Vozilo","Parkiraj/nZakljucaj/nOdkljucaj/nBoja/nProdaj/nLociraj/nUgasi gps","Uradi","Izadji");
           return 1;
       }
       if(strcmp(x_nr,"parkiraj",true) == 0)
       {
        if(IsPlayerConnected(playerid))
  {
new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
  if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][mA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][mA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
}
return 1;
}
else if(strcmp(x_nr,"lock",true) == 0)
        {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo zakljucano!");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
Vozila[skljuc][mZakljucan] = 1;
UpdateVozilo(skljuc);
return 1;
}
}
return 1;
        }
        else if(strcmp(x_nr,"unlock",true) == 0)
       {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo otkljucano!");
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
Vozila[skljuc][mZakljucan] = 0;
UpdateVozilo(skljuc);
return 1;
}
}
return 1;
       }
      else if(strcmp(x_nr,"boja",true) == 0)
       {
      new boja[2];
    new skljuc = PlayerInfo[playerid][pMainKey];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
if(PlayerInfo[playerid][pMainKey] != 255)
      {
      for(new i = 1; i < sizeof(Vozila); i++)
{
    if(vehicleid == Vozila[i][mOsobno])
    {
  if(skljuc == i)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
boja[0] = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
  boja[1]= strval(tmp);
    Vozila[skljuc][mpBoja] = boja[0];
      Vozila[skljuc][mdBoja] = boja[1];
ChangeVehicleColor(Vozila[skljuc][mOsobno], Vozila[skljuc][mpBoja],Vozila[skljuc][mdBoja]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vasa nova boja je postavljena!");
UpdateVozilo(skljuc);
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nisi u svome vozilu!");
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Moras biti u svom vozilu!");
}
return 1;
       }
    else if(strcmp(x_nr,"prodaj",true) == 0)
       {
    if(GetPlayerState(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid,12.0,1106.5691,-1428.4077,15.7969))
   {
new mkljuc = PlayerInfo[playerid][pMainKey];
new kljuc0 = GetMyCar2(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pMainKey] != 255)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(mkljuc == i)
    {
    if( Vozila[mkljuc][mKoristen] == 1)
    {
     if(PlayerInfo[playerid][pCar1] != 255 && PlayerInfo[playerid][pCar2] != 255)
        {
            if(PlayerInfo[playerid][pMainKey] == PlayerInfo[playerid][pCar1])
                {
              Vozila[kljuc0][mBroj] = 1;
                UpdateVozilo(kljuc0);
                }
      }
       new varid = CjenaVozilaIzModela(GetVehicleModel(GetPlayerVehicleID(playerid)));
    Vozila[mkljuc][mKoristen] = 0;
    Vozila[mkljuc][mModel] = 0;
Vozila[mkljuc][mX] = 0;
Vozila[mkljuc][mY] = 0;
Vozila[mkljuc][mZ] = 0;
Vozila[mkljuc][mA] = 0;
Vozila[mkljuc][mBroj] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Vozila[mkljuc][mVlasnik], "Drzava", 0, strlen("Drzava"), 999);
if(PlayerInfo[playerid][pCar1] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar1] = 255;}
else if(PlayerInfo[playerid][pCar2] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar2] = 255;}
if(PlayerInfo[playerid][pCar1] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar1];}
else if(PlayerInfo[playerid][pCar2] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar2];}
else {PlayerInfo[playerid][pMainKey] = 255;}
DestroyVehicle(vehicleid);
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, Modeli_vozila[varid][1]);
SendClientMessage(playerid, COLOR_GREEN, "Prodali ste vozilo!");
UpdateVozilo(i);
return 1;
  }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Niste u svom vozilu!!");
return 1;
}
}
}
}
    }
    else
  {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Niste na mjestu za prodaju (kod >>delivery<< mjesta)!");
   }
  }
  else
{
  SendClientMessage(playerid, COLOR_LIGHTRED, "Trebate biti u vozilu!");
  }
  return 1;
       }
else if(strcmp(x_nr,"lociraj",true) == 0)
       {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
{
  if(PlayerInfo[playerid][pMainKey] == 255)
       {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
        return 1;
        }
        new Float:aX ,Float:aY ,Float:aZ;
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
{
GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS: Odrediste oznaceno na karti!");
        }

}
}
return 1;
       }
      else if(strcmp(x_nr,"gpsoff",true) == 0)
      {
         if(PlayerInfo[playerid][pMainKey] != 255)
        {
          DisablePlayerCheckpoint(playerid);
          }
          else
          {
          SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
          }
return 1;
       }
       else
       {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Koristenje: /v(ozilo) [ime]");
           SendClientMessage(playerid, 0x83BFBFAA, "Moguca imena: parkiraj, lock, unlock, boja,prodaj, lociraj, gpsoff");
           return 1;
       }
   }
   return 1;
}

Mozes li iz komande da obrises sve sto netreba nego samo da ima ovo za dialog sta je potrebno i Dole pod OnDialogResponse da vidis sta nevalja i ispravis molim te


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1001)
   {
           if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
           {
           switch(listitem)
           {
               case 0:
               {
               new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
  if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][mA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][mA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
               }
               case 1:
               {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo zakljucano!");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
Vozila[skljuc][mZakljucan] = 1;
UpdateVozilo(skljuc);
}
return 1;
        }
               }
               case 2:
               {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo otkljucano!");
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
Vozila[skljuc][mZakljucan] = 0;
UpdateVozilo(skljuc);
return 1;
}
               }
               case 3:
               {
                new boja[2];
    new skljuc = PlayerInfo[playerid][pMainKey];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
if(PlayerInfo[playerid][pMainKey] != 255)
      {
      for(new i = 1; i < sizeof(Vozila); i++)
{
    if(vehicleid == Vozila[i][mOsobno])
    {
  if(skljuc == i)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
boja[0] = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
  boja[1]= strval(tmp);
    Vozila[skljuc][mpBoja] = boja[0];
      Vozila[skljuc][mdBoja] = boja[1];
ChangeVehicleColor(Vozila[skljuc][mOsobno], Vozila[skljuc][mpBoja],Vozila[skljuc][mdBoja]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vasa nova boja je postavljena!");
UpdateVozilo(skljuc);
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nisi u svome vozilu!");
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Moras biti u svom vozilu!");
}
return 1;
       }
               }
              case 4:
               {
               if(GetPlayerState(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid,12.0,1106.5691,-1428.4077,15.7969))
   {
new mkljuc = PlayerInfo[playerid][pMainKey];
new kljuc0 = GetMyCar2(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pMainKey] != 255)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(mkljuc == i)
    {
    if( Vozila[mkljuc][mKoristen] == 1)
    {
     if(PlayerInfo[playerid][pCar1] != 255 && PlayerInfo[playerid][pCar2] != 255)
        {
            if(PlayerInfo[playerid][pMainKey] == PlayerInfo[playerid][pCar1])
                {
              Vozila[kljuc0][mBroj] = 1;
                UpdateVozilo(kljuc0);
                }
      }
       new varid = CjenaVozilaIzModela(GetVehicleModel(GetPlayerVehicleID(playerid)));
    Vozila[mkljuc][mKoristen] = 0;
    Vozila[mkljuc][mModel] = 0;
Vozila[mkljuc][mX] = 0;
Vozila[mkljuc][mY] = 0;
Vozila[mkljuc][mZ] = 0;
Vozila[mkljuc][mA] = 0;
Vozila[mkljuc][mBroj] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Vozila[mkljuc][mVlasnik], "Drzava", 0, strlen("Drzava"), 999);
if(PlayerInfo[playerid][pCar1] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar1] = 255;}
else if(PlayerInfo[playerid][pCar2] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar2] = 255;}
if(PlayerInfo[playerid][pCar1] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar1];}
else if(PlayerInfo[playerid][pCar2] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar2];}
else {PlayerInfo[playerid][pMainKey] = 255;}
DestroyVehicle(vehicleid);
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, Modeli_vozila[varid][1]);
SendClientMessage(playerid, COLOR_GREEN, "Prodali ste vozilo!");
UpdateVozilo(i);
return 1;
  }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Niste u svom vozilu!!");
return 1;
}
}
}
}
    }
    else
  {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Niste na mjestu za prodaju (kod >>delivery<< mjesta)!");
   }
  }
  else
{
  SendClientMessage(playerid, COLOR_LIGHTRED, "Trebate biti u vozilu!");
  }
  return 1;
       }
               }
               case 5:
               {
new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
{
  if(PlayerInfo[playerid][pMainKey] == 255)
       {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
        return 1;
        }
        new Float:aX ,Float:aY ,Float:aZ;
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
{
GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS: Odrediste oznaceno na karti!");
        }

}
}
return 1;
       }
               }
               case 6:
               {
             if(PlayerInfo[playerid][pMainKey] != 255)
        {
          DisablePlayerCheckpoint(playerid);
          }
          else
          {
          SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
          }
return 1;
       }
               }

           }

       }


   }
   return 0;
}


El ovako treba,ako ne mozes li ispraviti sta nevalja plsss?
Poslednja Izmena: Oktobar 19, 2011, 17:49:24 POSLE PODNE od ...Nikola...

dragan12

Ako se nisam prevario onda ovako ide OnDialogResponse imao si viska zagrada to samo dodas pod taj public:
if(dialogid == 1001)
   {
            if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
            {
            switch(listitem)
            {
                case 0:
                {
                new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
    if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
          for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][mA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][mA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
                }
                case 1:
                {
                    new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo zakljucano!");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
Vozila[skljuc][mZakljucan] = 1;
UpdateVozilo(skljuc);
}
return 1;
        }
                }
                case 2:
                {
                    new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo otkljucano!");
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
Vozila[skljuc][mZakljucan] = 0;
UpdateVozilo(skljuc);
return 1;
}
}
                }
                case 3:
                {
                 new boja[2];
    new skljuc = PlayerInfo[playerid][pMainKey];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
      {
if(PlayerInfo[playerid][pMainKey] != 255)
      {
        for(new i = 1; i < sizeof(Vozila); i++)
{
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
boja[0] = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
  boja[1]= strval(tmp);
    Vozila[skljuc][mpBoja] = boja[0];
      Vozila[skljuc][mdBoja] = boja[1];
ChangeVehicleColor(Vozila[skljuc][mOsobno], Vozila[skljuc][mpBoja],Vozila[skljuc][mdBoja]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vasa nova boja je postavljena!");
UpdateVozilo(skljuc);
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nisi u svome vozilu!");
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Moras biti u svom vozilu!");
}
                }
               case 4:
                {
                if(GetPlayerState(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid,12.0,1106.5691,-1428.4077,15.7969))
    {
new mkljuc = PlayerInfo[playerid][pMainKey];
new kljuc0 = GetMyCar2(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pMainKey] != 255)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(mkljuc == i)
    {
    if( Vozila[mkljuc][mKoristen] == 1)
    {
      if(PlayerInfo[playerid][pCar1] != 255 && PlayerInfo[playerid][pCar2] != 255)
        {
            if(PlayerInfo[playerid][pMainKey] == PlayerInfo[playerid][pCar1])
                {
                Vozila[kljuc0][mBroj] = 1;
                UpdateVozilo(kljuc0);
                }
        }
        new varid = CjenaVozilaIzModela(GetVehicleModel(GetPlayerVehicleID(playerid)));
    Vozila[mkljuc][mKoristen] = 0;
    Vozila[mkljuc][mModel] = 0;
Vozila[mkljuc][mX] = 0;
Vozila[mkljuc][mY] = 0;
Vozila[mkljuc][mZ] = 0;
Vozila[mkljuc][mA] = 0;
Vozila[mkljuc][mBroj] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Vozila[mkljuc][mVlasnik], "Drzava", 0, strlen("Drzava"), 999);
if(PlayerInfo[playerid][pCar1] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar1] = 255;}
else if(PlayerInfo[playerid][pCar2] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar2] = 255;}
if(PlayerInfo[playerid][pCar1] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar1];}
else if(PlayerInfo[playerid][pCar2] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar2];}
else {PlayerInfo[playerid][pMainKey] = 255;}
DestroyVehicle(vehicleid);
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, Modeli_vozila[varid][1]);
SendClientMessage(playerid, COLOR_GREEN, "Prodali ste vozilo!");
UpdateVozilo(i);
return 1;
   }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Niste u svom vozilu!!");
return 1;
}
}
}
    }
    else
    {
     SendClientMessage(playerid, COLOR_LIGHTRED, "Niste na mjestu za prodaju (kod >>delivery<< mjesta)!");
      }
  }
    else
{
    SendClientMessage(playerid, COLOR_LIGHTRED, "Trebate biti u vozilu!");
  }
  return 1;
        }
                }
                case 5:
                {
new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
{
    if(PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
        return 1;
        }
        new Float:aX ,Float:aY ,Float:aZ;
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
{
GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS: Odrediste oznaceno na karti!");
        }

}
}
return 1;
        }
                }
                case 6:
                {
              if(PlayerInfo[playerid][pMainKey] != 255)
        {
            DisablePlayerCheckpoint(playerid);
            }
            else
            {
            SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
            }
return 1;
        }
                }

            }

        }

    }

Komanda samo:
if(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");
}

v.pwn(1) : error 010: invalid function or declaration
v.pwn(4) : error 054: unmatched closing brace ("}")
v.pwn(6) : warning 235: public function lacks forward declaration (symbol "OnDialogResponse")
v.pwn(10) : error 017: undefined symbol "SendClientMessage"
v.pwn(16) : error 017: undefined symbol "PlayerInfo"
v.pwn(16) : warning 215: expression has no effect
v.pwn(16) : error 001: expected token: ";", but found "]"
v.pwn(16) : error 029: invalid expression, assumed zero
v.pwn(16) : fatal error 107: too many error messages on one line

7 Errors.


Kako da popravim ovo?


1
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
4
}
6public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
16
                new skljuc = PlayerInfo[playerid][pMainKey];
10
to samo dodam define to nista
Poslednja Izmena: Oktobar 19, 2011, 18:20:52 POSLE PODNE od ...Nikola...

dragan12

To dodajes nadjes taj public OnDialogResponse i tamo dodas.


dragan12

Citat: ...Nikola... poslato Oktobar 19, 2011, 19:29:23 POSLE PODNE
Ma kako da popravim Erore??
A gde si ti to stavio?
Posto je ovde to od 1 - 16 reda. Imas gore dodato #include <a_samp>
Kako si to dodao? Zato ti izbacuje

Koliko ja znm ovo je dijalog a za dijalog se koristi ovo  inputtext a ne cmdtext.
Ja ti nemam pojma to napraviti al ja msl da bi trebao koristiti inputtext......................

Ja sam isto isao ovo ubaciti sto je Gagi dao i meni izbacuje samo ove errore:

C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1080) : warning 225: unreachable code
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1080) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1080) : error 004: function "OnPlayerCommandText" is not implemented
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1082) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1083) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1085) : warning 219: local variable "cmd" shadows a variable at a preceding level
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1086) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1087) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1088) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1165) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1184) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1191) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1233) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1401) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1410) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1436) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1087) : warning 203: symbol is never used: "idx"
C:\Documents and Settings\Darko\Desktop\GF edit\filterscripts\VehOwnershipByIvex.pwn(1087 -- 1528) : error 030: compound statement not closed at the end of file (started at line 756)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



11 Errors.
Ti errori su mi na public OnPlayerCommandText(playerid, cmdtext[]) cudno jer tamo nista nisam dirao samo sam isao po OnDialogResponse


Normalno ja sam rjesio neke errore evo cod i onog sto sam ja uradio:

  if(dialogid == 1001)
  {
           if(!response) return SendClientMessage(playerid,-1,"Odustali ste!");
           {
           switch(listitem)
           {
               case 0:
               {
               new skljuc = PlayerInfo[playerid][pMainKey];
  new vehicleid = GetPlayerVehicleID(playerid);
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
  if( PlayerInfo[playerid][pMainKey] == 255)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
        return 1;
        }
if(PlayerInfo[playerid][pMainKey] != 0)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(skljuc == i)
      {
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Vozila[i][mX] = x;
Vozila[i][mY] = y;
Vozila[i][mZ] = z;
Vozila[i][tonyA] = a;
SetVehiclePos(vehicleid, Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ]);
SetVehicleZAngle(vehicleid, Vozila[i][tonyA]);
SCM(playerid, COLOR_GREEN, "Parkirano!");
UpdateVozilo(i);
return 1;
  }
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste u svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
               }
               case 1:
               {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo zakljucano!");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
Vozila[skljuc][mZakljucan] = 1;
UpdateVozilo(skljuc);
}
return 1;
        }
               }
               case 2:
               {
                   new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
  {
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
format(string, sizeof(string), "Vozilo otkljucano!");
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
Vozila[skljuc][mZakljucan] = 0;
UpdateVozilo(skljuc);
return 1;
}
}
               }
               case 3:
               {
                new boja[2];
    new skljuc = PlayerInfo[playerid][pMainKey];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
if(PlayerInfo[playerid][pMainKey] != 255)
      {
      for(new i = 1; i < sizeof(Vozila); i++)
{
    if(vehicleid == Vozila[i][mOsobno])
    {
  if(skljuc == i)
    {
tmp = strtok(inputtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
boja[0] = strval(tmp);
tmp = strtok(inputtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/v(ozilo) boja [1] [2]");
return 1;
}
  boja[1]= strval(tmp);
    Vozila[skljuc][mpBoja] = boja[0];
      Vozila[skljuc][mdBoja] = boja[1];
ChangeVehicleColor(Vozila[skljuc][mOsobno], Vozila[skljuc][mpBoja],Vozila[skljuc][mdBoja]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vasa nova boja je postavljena!");
UpdateVozilo(skljuc);
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nisi u svome vozilu!");
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Moras biti u svom vozilu!");
}
               }
              case 4:
               {
               if(GetPlayerState(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid,12.0,1106.5691,-1428.4077,15.7969))
   {
new mkljuc = PlayerInfo[playerid][pMainKey];
new kljuc0 = GetMyCar2(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pMainKey] != 255)
{
        for(new i = 1; i < sizeof(Vozila); i++)
    {
    if(vehicleid == Vozila[i][mOsobno])
    {
    if(mkljuc == i)
    {
    if( Vozila[mkljuc][mKoristen] == 1)
    {
     if(PlayerInfo[playerid][pCar1] != 255 && PlayerInfo[playerid][pCar2] != 255)
        {
            if(PlayerInfo[playerid][pMainKey] == PlayerInfo[playerid][pCar1])
                {
              Vozila[kljuc0][mBroj] = 1;
                UpdateVozilo(kljuc0);
                }
      }
       new varid = CjenaVozilaIzModela(GetVehicleModel(GetPlayerVehicleID(playerid)));
    Vozila[mkljuc][mKoristen] = 0;
    Vozila[mkljuc][mModel] = 0;
Vozila[mkljuc][mX] = 0;
Vozila[mkljuc][mY] = 0;
Vozila[mkljuc][mZ] = 0;
Vozila[mkljuc][tonyA] = 0;
Vozila[mkljuc][mBroj] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(Vozila[mkljuc][mVlasnik], "Drzava", 0, strlen("Drzava"), 999);
if(PlayerInfo[playerid][pCar1] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar1] = 255;}
else if(PlayerInfo[playerid][pCar2] == PlayerInfo[playerid][pMainKey]) {PlayerInfo[playerid][pCar2] = 255;}
if(PlayerInfo[playerid][pCar1] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar1];}
else if(PlayerInfo[playerid][pCar2] != 255){PlayerInfo[playerid][pMainKey] = PlayerInfo[playerid][pCar2];}
else {PlayerInfo[playerid][pMainKey] = 255;}
DestroyVehicle(vehicleid);
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, Modeli_vozila[varid][1]);
SendClientMessage(playerid, COLOR_GREEN, "Prodali ste vozilo!");
UpdateVozilo(i);
return 1;
  }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Niste u svom vozilu!!");
return 1;
}
}
}
    }
    else
  {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Niste na mjestu za prodaju (kod >>delivery<< mjesta)!");
   }
  }
  else
{
  SendClientMessage(playerid, COLOR_LIGHTRED, "Trebate biti u vozilu!");
  }
  return 1;
       }
               }
               case 5:
               {
new skljuc = PlayerInfo[playerid][pMainKey];
if(IsPlayerConnected(playerid))
{
  if(PlayerInfo[playerid][pMainKey] == 255)
       {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
        return 1;
        }
        new Float:aX ,Float:aY ,Float:aZ;
        if(PlayerInfo[playerid][pMainKey] != 255)
        {
{
GetVehiclePos(Vozila[skljuc][mOsobno], aX, aY, aZ);
        SetPlayerCheckpoint(playerid,aX ,aY ,aZ, 8.0);
        SCM(playerid, COLOR_LIGHTBLUE, "GPS: Odrediste oznaceno na karti!");
        }

}
}
return 1;
       }
               }

Tu je lijepo sve u inputtext a ne cmdtext.

Probaj staviti tako mozda ce tebi raditi!!!
Poslednja Izmena: Oktobar 20, 2011, 02:00:15 PRE PODNE od Ante_Street
Trazim "Profesionalnog Skriptera" da mi napravi jednu stvar,cijena nebitna nek mi se javi na pm....trazim lika koji zna raditi ne nekog pocetnika


dragan12

Komanda ide pod public OnPlayerCommandText
Fali ti onaj deo sa enum-om PlayerInfo
fali ti i #include <a_samp>
Pa to samo zameni sa onim u modu.


dragan12

Citat: ...Nikola... poslato Oktobar 20, 2011, 20:02:50 POSLE PODNE
Evo FS gde sam stavio /v el moze neko da mi napravi bez Erora da radi http://www.mediafire.com/?3xvdkostuvxf5wc molim vas
Tu ti fali dosta stvari.  ::)
Za pocetak:
enum pInfo
{
pMainKey,
};
new PlayerInfo[MAX_PLAYERS][pInfo];

Pa ti onda fale definicije boja,enum za Vozila,pa ti fali public/stock UpdateVozilo,
To su neke stvari koje sam na pravi pogled video.
To sve treba da prebacis ali ako si trazio za mod onda ubaci u mod