Jump to content
  • 0

pomoc OBUSOK = LAHNUTIE


Pulo15

Dotaz

Zdravim.Prosim Vas pomozte mi spravit taku vec.Ze ak kliknem obuskom tak jeden alebo vsetci si lahnu.Myslim ze som to videl v nejakom Prison Break alebo take nieco.Vdaka.

Link to comment
Share on other sites

21 odpovědí na tuto otázku

Recommended Posts

  • 0
Zdravim.Prosim Vas pomozte mi spravit taku vec.Ze ak kliknem obuskom tak jeden alebo vsetci si lahnu.Myslim ze som to videl v nejakom Prison Break alebo take nieco.Vdaka.

 

To bude keystate pak jestli ma v ruce obušek a pak kdo je blizko a tomu dat animaci lehnutí (když do vas nekdo boxuje tak si tim stylem lehnete)

Link to comment
Share on other sites

  • 0

Je to animacia cracku ta je best+GetDistanceBetweenPlayers(metre daj si aby ho okolo napr. 5 metrov (spusti animaciu)+OnPlayerKeyStateChange(daj si na klik) ine nepoznam dufam xD

Link to comment
Share on other sites

  • 0

Jestli chceš když ho obuškem praští tak si lehne, tak tuhle funkci sem hledal dlouho ( když jsem ještě dělal pawn )

tohle si dej kamkoli ale né do publicu.

 

stock GetClosestPlayer(playerid)

{

new Float:x, Float:y, Float:z;

new Float:x2, Float:y2, Float:z2;

new Float:distance, Float:distance2;

new ClosestPlayer;

GetPlayerPos(playerid, x, y, z);

distance = 9999;

for(new i = 0; i < MAX_PLAYERS; i ++)

{

if(i != playerid)

{

GetPlayerPos(i, x2, y2, z2);

x = x - x2;

y = y - y2;

distance2 = floatsqroot(x*x+y*y);

if(distance2 < distance)

{

distance = distance2;

ClosestPlayer = i;

}

}

}

return ClosestPlayer;

}

 

no a dej si do OnPlayerKey

if(newkeys == ID_STRELBY)
{
new id = GetClosestPlayer(playerid);
ApplyAnimation(id,....);//to si dopln na animaci lehnutí
}

Link to comment
Share on other sites

  • 0
OK tlacidlo uz som nasiel, ale reaguje to na vsetky zbranie nie len na obusok.. treba tam neico este dat aby to islo len na obusok nie ?

Tak toto si tam pridaj.

new zbran = GetPlayerWeapon(playerid);
if(zbran != 3) return SendClientMessage(playerid, 0xff0000, "[sM] Musíš mať obušok !"); //Musíš mať obušok v ruke. Tá trojka znamená ID zbrane
SendClientMessage(playerid, 0xff0000, "[sM] OK !"); // Sem si daj animáciu

Link to comment
Share on other sites

  • 0
Ale ma to este jednu chybu :d preco lahnu vsetci ? a nie len ti, co su v blizkosti mna ? ale lahnu vsetci aj ked som daleko hmm...

Toto si daj do forwardow:

forward GetDistanceBetweenPlayers(playerid,playerid2);

Toto si daj do toho prikazu ci co to mas:

new id = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid, id) < 10){ // toto je vzdialenost hraca od druheho hraca

Este toto: Od [other]Avest-X

 

stock GetClosestPlayer(playerid)

{

new Float:x, Float:y, Float:z;

new Float:x2, Float:y2, Float:z2;

new Float:distance, Float:distance2;

new ClosestPlayer;

GetPlayerPos(playerid, x, y, z);

distance = 9999;

for(new i = 0; i < MAX_PLAYERS; i ++)

{

if(i != playerid)

{

GetPlayerPos(i, x2, y2, z2);

x = x - x2;

y = y - y2;

distance2 = floatsqroot(x*x+y*y);

if(distance2 < distance)

{

distance = distance2;

ClosestPlayer = i;

}

}

}

return ClosestPlayer;

}

 

A toto niekde do modu:

public GetDistanceBetweenPlayers(playerid,playerid2){
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}

Link to comment
Share on other sites

  • 0

:d ok vdaka idem to vyskusat, hadam uz to pojde ;)

 

-- ned 10. led 2010 20:16:44 --

 

KARNEL 252 ide to dobre, len som to musel trchu opravit mas tam chybu :d tam nema byt ze if(zbran != 3) ale if(zbran ==3) pretoze on musi mat zbran ID 3 nie nesmie mat zbran 3 ;)

Link to comment
Share on other sites

  • 0
:d ok vdaka idem to vyskusat, hadam uz to pojde ;)

 

-- ned 10. led 2010 20:16:44 --

 

KARNEL 252 ide to dobre, len som to musel trchu opravit mas tam chybu :d tam nema byt ze if(zbran != 3) ale if(zbran ==3) pretoze on musi mat zbran ID 3 nie nesmie mat zbran 3 ;)

ako chces ale mam to dobre ide to ale ako chces...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...