Job Farmer - Module Script

Započeo xLanmi, Avgust 11, 2019, 12:40:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Citat: Galardo poslato Avgust 11, 2019, 15:49:49 POSLE PODNE
Rrrrresi glupavog Doza  :D
@tema GJ

Hvala :D

Citat: M0nster poslato Avgust 11, 2019, 16:04:38 POSLE PODNE
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: {

}

Citat: Slade poslato Avgust 11, 2019, 17:07:06 POSLE PODNE
Lijepo izgleda  ;D

Hvala tebra :D

One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020

@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


Citat: M0nster 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;
}




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. :)

Citat: Rixxx poslato Avgust 11, 2019, 22:48:28 POSLE PODNE
Solidno, GJ.

Hvala :D

One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020

Ovo je vrh!
#ROBY
#ONLINE !
----- NIKAD PORAZ SAMO LEKCIJA! -----


One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020

fino odradjeno

TIIIIIRRRRRRUUUUUU RIIIIIIIIIIIIIIIII RUUUUUUUUUUUUU


One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020



One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020



One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020