PARTNERI:

* Marketing


-UPOZORENJE-

Samo registrovani članovi mogu da vide/koriste forum u celini.
Prijavite se ili registrujte nalog na Balkan SA-MP forumu.


Autor Tema: [FilterScript] Job Farmer - Module Script  (Pročitano 728 puta)

0 članova i 1 gost pregledaju ovu temu.

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #15 poslato: Avgust 11, 2019, 18:24:13 posle podne »
Rrrrresi glupavog Doza  :D
@tema GJ

Hvala :D

Ali ponavljati isto nije uredu, a i tajmere moras zvati izvan "switch" a već kad trebaš samo koristiti jedan timer onda uradi na način "case" od 1...5..



case 1...5 ti je isto sto bi bilo i

case 1: {

}
case 2: {

}

Lijepo izgleda  ;D

Hvala tebra :D

 

Van mreže Spooky.

Odg: Job Farmer - Module Script
« Odgovor #16 poslato: Avgust 11, 2019, 19:15:22 posle podne »
@LANMY.pwN

Primjer 1.

CMD:muzikravu(playerid, params[]) {
if(FarmerDuznost[playerid] < 1) return Error(playerid, "Niste na duznosti kao farmer");
if(KravaMuzi_CP[playerid] < 1 ) return Error(playerid, "Niste ukljucili muzu da bi muzli kravu!");
if(IzabranaKrava_Muzenje[playerid] < 1 ) return Error(playerid, "Niste dosli kod te krave!");
switch(IzabranaKrava_Muzenje[playerid]) {
case 1: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Jagoda");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Zvezdana");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
}
case 2: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Cveta");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Ruza");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 3: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Daliborka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Mira");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 4: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Milka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Helga");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 5: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Belka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Rumenka");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
}
return true;
}

Primjer 2.

CMD:muzikravu(playerid, params[]) {
if(FarmerDuznost[playerid] < 1) return Error(playerid, "Niste na duznosti kao farmer");
if(KravaMuzi_CP[playerid] < 1 ) return Error(playerid, "Niste ukljucili muzu da bi muzli kravu!");
if(IzabranaKrava_Muzenje[playerid] < 1 ) return Error(playerid, "Niste dosli kod te krave!");
TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
switch(IzabranaKrava_Muzenje[playerid]) {
case 1: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Jagoda");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Zvezdana");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
}
  }
return true;
}

You'll be always in my heart, the end and thanks for amazing times. #WeAreLords
Respect: androo
Sviđaju vam se moji radovi ? Podržite me PayPal donacijom na E-Mail. [email protected]
 

Van mreže Rixxx

Odg: Job Farmer - Module Script
« Odgovor #17 poslato: Avgust 11, 2019, 22:48:28 posle podne »
Solidno, GJ.
 
Korisnici koji su se zahvalili: LANMY.pwN

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #18 poslato: Avgust 11, 2019, 22:55:07 posle podne »
@LANMY.pwN

Primjer 1.

CMD:muzikravu(playerid, params[]) {
if(FarmerDuznost[playerid] < 1) return Error(playerid, "Niste na duznosti kao farmer");
if(KravaMuzi_CP[playerid] < 1 ) return Error(playerid, "Niste ukljucili muzu da bi muzli kravu!");
if(IzabranaKrava_Muzenje[playerid] < 1 ) return Error(playerid, "Niste dosli kod te krave!");
switch(IzabranaKrava_Muzenje[playerid]) {
case 1: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Jagoda");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Zvezdana");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
}
case 2: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Cveta");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Ruza");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 3: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Daliborka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Mira");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 4: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Milka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Helga");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
case 5: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Belka");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Rumenka");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
  TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
  LoopingAnimJob(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
}
}
return true;
}

Primjer 2.

CMD:muzikravu(playerid, params[]) {
if(FarmerDuznost[playerid] < 1) return Error(playerid, "Niste na duznosti kao farmer");
if(KravaMuzi_CP[playerid] < 1 ) return Error(playerid, "Niste ukljucili muzu da bi muzli kravu!");
if(IzabranaKrava_Muzenje[playerid] < 1 ) return Error(playerid, "Niste dosli kod te krave!");
TimerVariable[ playerid ] = SetTimerEx( "TimerMuzenje", 5000, 0, "i", playerid );
switch(IzabranaKrava_Muzenje[playerid]) {
case 1: {
Muzenje_TD(playerid, true);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][9]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][10]);
PlayerTextDrawHide(playerid,MUZI_KRAVU[playerid][11]);
if(IzabranaStala[playerid] == 1) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Jagoda");
else if(IzabranaStala[playerid] == 2) PlayerTextDrawSetString(playerid,MUZI_KRAVU[playerid][6],"Zvezdana");
Mleko[playerid] += random(9);
new mlekoo[60];
format(mlekoo, sizeof(mlekoo), "%d",Mleko[playerid]);
PlayerTextDrawSetString(playerid, MUZI_KRAVU[playerid][14], mlekoo);
  TogglePlayerControllable(playerid,0);
  PlayAudioStreamForPlayer(playerid, "https://k007.kiwi6.com/hotlink/1q3pn8d25e/muzenje.mp3");
  ClearChat( playerid, 25 );
}
  }
return true;
}



U svakom slucaju moze i jedno i drugo jer case ti dodje kao if tako da je isto pozvan 1 put dal pre ili u switchu nije bitno :) Switch je bolja provera nego komanda padne scripta njemu se ne desi switch a tb vec aktivan timer. :)

Solidno, GJ.

Hvala :D

 

Van mreže Roby Mapper

Odg: Job Farmer - Module Script
« Odgovor #19 poslato: Avgust 12, 2019, 15:29:52 posle podne »
Ovo je vrh!
#ROBY_BLACK 4K2019
#SCRIPTER ON DUTY !
----- NIKAD PORAZ SAMO LEKCIJA! -----
 
Korisnici koji su se zahvalili: LANMY.pwN

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #20 poslato: Avgust 13, 2019, 01:13:23 pre podne »

 

Na mreži Fqris

Odg: Job Farmer - Module Script
« Odgovor #21 poslato: Avgust 13, 2019, 03:58:52 pre podne »
fino odradjeno
Citat
"imam ljubicastu krv jer ne poticem sa zemlje"
 
Korisnici koji su se zahvalili: LANMY.pwN

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #22 poslato: Avgust 13, 2019, 12:50:38 posle podne »

 

Van mreže itzbekam

Odg: Job Farmer - Module Script
« Odgovor #23 poslato: Avgust 14, 2019, 22:47:02 posle podne »
Može poslužit  ;)
 
Korisnici koji su se zahvalili: LANMY.pwN

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #24 poslato: Avgust 15, 2019, 00:01:20 pre podne »

 

Van mreže Bondzic

Odg: Job Farmer - Module Script
« Odgovor #25 poslato: Avgust 15, 2019, 18:53:22 posle podne »
gj 8)
 
Korisnici koji su se zahvalili: LANMY.pwN

Na mreži LANMY.pwN

Odg: Job Farmer - Module Script
« Odgovor #26 poslato: Avgust 15, 2019, 20:35:20 posle podne »