Hello!
Az a bajom ezzel, hogy nem tom hogy rendezzem, hogy ne bugoljon....
Sok féle képpen próbáltam de mindig valami bug beütött...
if(gTeam[playerid] == Team_Ember)
{
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject[playerid] = CreatePickup(2907, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;
gTeam[playerid] = Team_Zombi;
Zombiscore += 1;
if(gTeam[killerid] == Team_Zombi)
{
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject[playerid] = CreatePickup(2907, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;
gTeam[playerid] = Team_Zombi;
Zombiscore += 1;
}
if(gTeam[killerid] == Team_Ember)
{
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject[playerid] = CreatePickup(2907, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;
gTeam[playerid] = Team_Zombi;
Zombiscore += 1;
}
}
if(gTeam[playerid] == Team_Zombi)
{
new RandomHus = random(2);
switch (RandomHus)
{
case 0:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject1[playerid] = CreatePickup(2804, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806
}
case 1:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject2[playerid] = CreatePickup(2806, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806;
}
}
gTeam[playerid] = Team_Zombi;
Emberscore += 1;
if(gTeam[killerid] == Team_Ember)
{
//new RandomHus = random(2);
switch (RandomHus)
{
case 0:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject1[playerid] = CreatePickup(2804, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806
}
case 1:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject2[playerid] = CreatePickup(2806, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806;
}
}
gTeam[playerid] = Team_Ember;
Emberscore += 1;
}
if(gTeam[killerid] == Team_Zombi)
{
//new RandomHus = random(2);
switch (RandomHus)
{
case 0:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject1[playerid] = CreatePickup(2804, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806
}
case 1:
{
//DestroyDynamicObject(hObject [playerid]);
GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]);
hObject2[playerid] = CreatePickup(2806, 1, Yh[playerid], Xh[playerid], Zh[playerid]-0.;//2804,2806;
}
}
gTeam[playerid] = Team_Zombi;
Emberscore += 1;
}
}
Ez a kicsike kavarodik sajnos, mert sok függvénynek kell teljesülnie... :wag:
4 szempontnak kéne bug mentesen mûködnie:
1. Ember -> Zombit õl (zombi hulla,emberscore+1,ember legyen)
2. Zombi -> Embert õl (ember hulla,zombiscore+1,zombi legyen)
3.Ember meghal simán[nincs killer id tehát] (ember hulla,zombiscore+1,zombi legyen)
4.Zombi =||= (zombi hulla,emberscore+1,zombi marad)
Valamiért a rendszer kavarodik()ezt nem kell olvasni, csak ha szempontot nézel miért is nem...
Nos ha simán hal meg akár zombi akár ember azt ugye jól csinálja mondjuk, de ha killer id is van akkor az elöbbit amit írtam és azt is számolja else függvény javítható, de a többi akkor bebugol ezesetben, ilyen logikai bombákkal lõ vissza mindig ha javítani akarom...
Remélem érthetõ volt a problémám :wall: