[Pomoc] Zakljucavanje auta.

Započeo IxyzZz, Decembar 13, 2011, 16:13:41 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: RP
Detaljan opis problema: Neznam kako da namjestim na primjer da civil nemoze uci u taxi vozilo ili neko drugo sluzbeno vozilo i da mu npr. pise nemas kljuceve od taxi vozila ili tako nesto.
Dio skripte: //
Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Poslednja Izmena: Decembar 13, 2011, 16:14:01 POSLE PODNE od IxyzZz




Evo posto niko nije reko evo ovako pisi bar je to lako ako i nakon ovog neskuzis javi mi se U PM



public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

   if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
   {
      if (IsACopCar(vehicleid) && !ispassenger)
      {
         if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
          else
         {
             SendClientMessage(playerid, SIVA, "(Izbacen!) Samo clanovi Policije!");
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsNgCar(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pLeader]==1|| PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
          else
         {
             SendClientMessage(playerid, SIVA, "(Izbacen!) Samo clanovi Specijalnih Jedinica!");
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsNpcVehicle(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pLeader]==100) {}
          else
         {
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsAnAmbulance(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pMember]==4 || PlayerInfo[playerid][pLeader]==4) { }
          else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Pokusaj kraÄ'e vozila Hitne Pomoci"); }
      }
      if (IsATank(vehicleid) && !ispassenger)
      {
         if(PlayerInfo[playerid][pLeader]== 1 || PlayerInfo[playerid][pLeader]==3 || PlayerInfo[playerid][pMember]==3) {}
          else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Kradja Tenka"); SendClientMessage(playerid, COLOR_GREY,"You don't know how to drive it yet."); }
      }
   }



   return 1;
}
Poslednja Izmena: Decembar 13, 2011, 17:13:32 POSLE PODNE od DanijelBCRP

Citat: DanijelBCRP poslato Decembar 13, 2011, 17:12:57 POSLE PODNE
Evo posto niko nije reko evo ovako pisi bar je to lako ako i nakon ovog neskuzis javi mi se U PM



public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

   if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
   {
      if (IsACopCar(vehicleid) && !ispassenger)
      {
         if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
          else
         {
             SendClientMessage(playerid, SIVA, "(Izbacen!) Samo clanovi Policije!");
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsNgCar(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pLeader]==1|| PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
          else
         {
             SendClientMessage(playerid, SIVA, "(Izbacen!) Samo clanovi Specijalnih Jedinica!");
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsNpcVehicle(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pLeader]==100) {}
          else
         {
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
         }
      }
      if (IsAnAmbulance(vehicleid) && !ispassenger)
      {
          if(PlayerInfo[playerid][pMember]==4 || PlayerInfo[playerid][pLeader]==4) { }
          else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Pokusaj kraÄ'e vozila Hitne Pomoci"); }
      }
      if (IsATank(vehicleid) && !ispassenger)
      {
         if(PlayerInfo[playerid][pLeader]== 1 || PlayerInfo[playerid][pLeader]==3 || PlayerInfo[playerid][pMember]==3) {}
          else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Kradja Tenka"); SendClientMessage(playerid, COLOR_GREY,"You don't know how to drive it yet."); }
      }
   }



   return 1;
}



Izbaciva mi error u ovom redu

if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)




Mod RP FTW :D

1.) Odi u PAWNO i stisni CTRL + F i upisi public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
2.) Pod taj public dodaj: if (IsACopCar(vehicleid) && !ispassenger)
     {
        if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
         else
        {
            SendClientMessage(playerid, COLOR_BOJA, "Poruka");
           new Float:x, Float:y, Float:z;
           GetPlayerPos(playerid, x, y, z);
           SetPlayerPos(playerid, x,  y, z);
        }
     }

3.)Ovo IsACopCar ti je public u kojem pisu ID-ovi vozila npr 135,136,137,138,139 ili ako je ispred CreateVehicleEx npr. copcar1 = CreateVehicleEx..., copcar2 = CreateVehicleEx... su ti ti Cop Auti....

Public IsACopCar:
public IsACopCar(carid)
{
for(new i = 0; i < sizeof(copcar); i++)
{
if(carid == copcar[i]) return 1;
}
return 0;
}


Radi po ovome sto sam ti gore napiso za svaki public
Poslednja Izmena: Decembar 14, 2011, 20:01:16 POSLE PODNE od !вє!ѕєуzιι¢н™
Izrada web aplikacija/desktop aplikacija, kontakt PM.
VPS/Dedi managment 'n' hosting @pm also.

CitatSkripta koju koristim: RP
Potrebno je navesti da li je GM God Father, Tvoj ili neki drugi.
Mislim da sam video negde tutorial na forumu pa probaj malo da potrazis.
Ne bi' sada da padam kada sam stigao dovde...
Sta god da se desi , zauvek ostacu ovde
Ostacu ovde...Zauvek ostacu ovde...
Ne zelim nigde da odem ... Jer najlakse je uspeti al najteze je ostati covek !!!

Citat: #Electro^ poslato Decembar 14, 2011, 20:29:07 POSLE PODNE
CitatSkripta koju koristim: RP
Potrebno je navesti da li je GM God Father, Tvoj ili neki drugi.
Mislim da sam video negde tutorial na forumu pa probaj malo da potrazis.

Pa ime je promjenjivo




Citat: IxyzZz poslato Decembar 14, 2011, 20:35:24 POSLE PODNE
Citat: #Electro^ poslato Decembar 14, 2011, 20:29:07 POSLE PODNE
CitatSkripta koju koristim: RP
Potrebno je navesti da li je GM God Father, Tvoj ili neki drugi.
Mislim da sam video negde tutorial na forumu pa probaj malo da potrazis.

Pa ime je promjenjivo

AHAHAHHAHAHAH bravo bravo, a meni si našao da sereš kakva mi je mapa.
Kada muškarac priča ženi bezobrazne stvari, to je seksualno uznemiravanje…
A kada žena to radi muškarcu to je 2 eura+PDV po minuti. :D

Citat: Talavander poslato Decembar 23, 2011, 18:12:17 POSLE PODNE
Citat: IxyzZz poslato Decembar 14, 2011, 20:35:24 POSLE PODNE
Citat: #Electro^ poslato Decembar 14, 2011, 20:29:07 POSLE PODNE
CitatSkripta koju koristim: RP
Potrebno je navesti da li je GM God Father, Tvoj ili neki drugi.
Mislim da sam video negde tutorial na forumu pa probaj malo da potrazis.

Pa ime je promjenjivo

AHAHAHHAHAHAH bravo bravo, a meni si našao da sereš kakva mi je mapa.

Ma asu o cemu ti pricas ??




Evo ti bolji nacin na pocetak dodaj ovako u []ti je broj auta uvek stavis 1 vise nego sto ti imas a ovo NRCar to ime stavis kako ti je voljanew NRCar[10]; drugo pod if(newstate == PLAYER_STATE_DRIVER)a to je public ovaj public OnPlayerStateChange(playerid, newstate, oldstate)
{
dodas if(newcar == NRCar[0] || newcar == NRCar[1] || newcar == NRCar[2] || newcar == NRCar[3] || newcar == NRCar[4] || newcar == NRCar[5] || newcar == NRCar[6] || newcar == NRCar[7] || newcar == NRCar[8] || newcar == NRCar[9])
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14){ }
else
{
    SendClientMessage(playerid,COLOR_GREY,"(Izbacen!) Nisi clan NR-a !");
    format(string, sizeof(string), "~b~NR");
                           GameTextForPlayer(playerid, string, 3000, 5);
    RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}

i trece pod OnGameModInit dodas //NR VOZILA---------------------------------------------------------------------------------------------
NRCar[0] = AddStaticVehicle(562,2769.5300,-1604.5176,10.6490,270.4381,9,1); // elegy
NRCar[1] = AddStaticVehicle(562,2769.7178,-1609.3628,10.6490,271.5604,9,1); // elegy
NRCar[2] = AddStaticVehicle(560,2769.7231,-1613.1628,10.6268,270.0414,9,1); // sultan
NRCar[3] = AddStaticVehicle(560,2769.7810,-1617.3020,10.6270,269.9801,9,1); // sultan
NRCar[4] = AddStaticVehicle(411,2770.8030,-1625.6980,10.5519,269.8295,9,1); // infernus
NRCar[5] = AddStaticVehicle(411,2781.5298,-1625.7759,10.6290,269.8853,9,1); // infernus
NRCar[6] = AddStaticVehicle(541,2779.1570,-1601.8914,10.5384,269.2374,9,1); // bullet
NRCar[7] = AddStaticVehicle(522,2793.7817,-1623.4343,10.4829,29.1533,9,1); // nrg
NRCar[8] = AddStaticVehicle(522,2792.7249,-1625.3658,10.4832,35.5509,9,1); // nrg
NRCar[9] = AddStaticVehicle(541,2796.4524,-1611.0948,10.7137,337.8556,9,1); // bullet
Vozila ti stavis svoja normalno i tamo pod drugi korak dodas jos ako imas vozila ili obrises ako imas manje