[Pomoc]Oko kravljeg sistema

Započeo Sarkenzo, April 25, 2017, 04:03:46 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: Moja od 0
Detaljan opis problema:Pravio sam sistem mlekara i sada napravio sam sve ekstra da uzme kofu pa mu se stvore krave pa dodje do njih dotakne ih i krene da ih muze e sada ne znam kako da napravim da kada je pomuze ne moze vise da je muze.Ja sam nesto pokusavao ali to ne valja ne moze da muze vise nijednu kravu a meni treba samo za onu koju je predhodno pomuzao da ne moze vise.
Dio skripte: /

if(newkeys & KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, FarmerKordOpreme))
{
if(IgracevInfo[playerid][uPosao] != 15)
{
SendClientMessage(playerid, -1, "Niste Mlekar");
return 1;
}
if(Oprema[playerid] == 14)
{
Oprema[playerid] = 0;
SendClientMessage(playerid, -1, "Vratili ste opremu");
SetPlayerSkin(playerid,IgracevInfo[playerid][uLik]);
RemovePlayerAttachedObject(playerid, KOFA_SLOT);
return 1;
}
if(Oprema[playerid] == 0)
{
Oprema[playerid] = 14;
SendClientMessage(playerid, -1, "Uzeli ste opremu");
SetPlayerSkin(playerid, 161);
StvoriKofe(playerid);
StvoriKrave(playerid);
IgracevInfo[playerid][MlekarTimer] = SetTimerEx("TimerKofe", 250, true, "i", playerid);
SCM NZM"Sada pokupite kofu");
return 1;
}
}
}


publics TimerKofe(playerid)
{
if(IgracevInfo[playerid][uPosao] == 15)
{
new Float:grPos[3],
cpid = -1;

for(new t = 0; t < 5; t++)
{
GetDynamicObjectPos(IgracevInfo[playerid][uObjekatKofe][t], grPos[0], grPos[1], grPos[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, grPos[0], grPos[1], grPos[2]))
{
cpid = t;
break;
}
}
if( cpid == -1 ) return 1;
if(UzeoKofu[playerid] == 0)
{
UzeoKofu[playerid] = 1;
SetPlayerAttachedObject( playerid, KOFA_SLOT, 19468, 6, 0.285581, -0.065038, 0.003429, 4.789758, 267.121978, 0.000000, 1.000000, 1.000000, 1.000000 ); // cj_bucket -
DestroyDynamicObject(IgracevInfo[playerid][uObjekatKofe][cpid]);
SCM NZM"Uzeli ste kofu sada pomuzite kravu");
IgracevInfo[playerid][KravaTimer] = SetTimerEx("Muzenje", 250, true, "i", playerid);
}
}
return 1;
}


publics Zavrseno_Krava(playerid)
{
MuzeKravu[playerid] = 0;
SCM NZM"Pomuzli ste kravu");
ClearAnimations( playerid );
TogglePlayerControllable( playerid, true );
IgracevInfo[playerid][uPomuzena] = 1;
return true;
}


publics Muzenje(playerid)
{
if(IgracevInfo[playerid][uPosao] == 15)
{
if(Oprema[playerid] == 14)
{
if(UzeoKofu[playerid] == 1)
{
if(MuzeKravu[playerid] == 0)
{
if(IgracevInfo[playerid][uPomuzena] == 0)
{
new Float:grPos[3],
cpid = -1;

for(new t = 0; t < 12; t++)
{
GetDynamicObjectPos(IgracevInfo[playerid][uObjekatKrave][t], grPos[0], grPos[1], grPos[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, grPos[0], grPos[1], grPos[2]))
{
cpid = t;
break;
}
}
if( cpid == -1 ) return 1;
TogglePlayerControllable( playerid, false );
GameTextForPlayer( playerid, "~b~Muzete kravu, ~r~pricekajte~b~...", 5900, 1 );
IgracevInfo[playerid][KravaTimer] = SetTimerEx( "Zavrseno_Krava", 6000, false, "ui", playerid);
ApplyAnimation( playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 1, 0, 0 );
MuzeKravu[playerid] = 1;
return true;
}
}
}
}
}
return 1;
}


stock StvoriKrave(playerid)
{
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][0] = CreateDynamicObject(19833, -984.14941, -1252.32666, 132.53552,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][1] = CreateDynamicObject(19833, -1018.65643, -1257.56897, 129.68126,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][2] = CreateDynamicObject(19833, -991.58167, -1239.98035, 130.79396,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][3] = CreateDynamicObject(19833, -982.80225, -1285.47229, 132.10622,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][4] = CreateDynamicObject(19833, -997.33698, -1292.25879, 132.29762,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][5] = CreateDynamicObject(19833, -1006.62061, -1237.96533, 129.96957,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][6] = CreateDynamicObject(19833, -1001.17218, -1257.39258, 131.20000,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][7] = CreateDynamicObject(19833, -1016.76398, -1271.58850, 129.86133,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][8] = CreateDynamicObject(19833, -1015.91797, -1290.34412, 130.37143,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][9] = CreateDynamicObject(19833, -986.45081, -1269.40283, 132.10622,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][10] = CreateDynamicObject(19833, -1003.17352, -1275.77026, 130.37143,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
IgracevInfo[playerid][uPomuzena] = 0,IgracevInfo[playerid][uObjekatKrave][11] = CreateDynamicObject(19833, -1015.31689, -1247.20081, 129.96957,   0.00000, 0.00000, 0.00000, -1, -1, playerid, 50.0);
}
Poslednja Izmena: April 25, 2017, 04:05:44 PRE PODNE od Sarkenzo

Napravis da ti svaka krava kada je pomuzes ima poseban id, sto bi u prevodu znacilo :

Ako je id krave 0 onda i kod provere treba da bude 0

IgracevInfo[playerid][uPomuzena] = 0
IgracevInfo[playerid][uObjekatKrave][0]

Isto tako napravis i za sledecu :

IgracevInfo[playerid][uPomuzena] = 1
IgracevInfo[playerid][uObjekatKrave][1]

I na kraju napravis proveru publics Zavrseno_Krava(playerid)
{
MuzeKravu[playerid] = 0;
SCM NZM"Pomuzli ste kravu");
ClearAnimations( playerid );
TogglePlayerControllable( playerid, true );
IgracevInfo[playerid][uPomuzena] = string koji bi oznacavao id krave;
return true;
}

Napravi da svaka krava ima svoj ID i kad muze da mu vrednost stavi na ID te krave ako me razumes :D

___________
~ On permanent vacation ~ /