Jump to content
  • 0

pomoc [Help] Onplayerkeystatechange


Guest Norhy

Dotaz

Ahoj. Prezeral som si Wikinu a našiel som tam toto:

 

#define HOLDING(%0) \
((newkeys & (%0)) == (%0))

 

Tak som sa rozhodol že to vyskúšam. V OnPlayerKeyStateChange mám toto:

 

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if (HOLDING( KEY_FIRE ))
   {
 new Float:Armour;
 GetPlayerArmour(playerid, Armour);
 SetPlayerArmour(playerid, Armour+1);
}
return 1;
}

 

Avšak keď v hre držím LMB tak sa nič nedeje. Len keď stlačím a pustím. Takže keď držím LMB tak by sa mi mala doplňovať AP, čo sa ale nedeje, len keď stlačím LMB.

 

Poprosím o help.

Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0

QWERTY nesúhlasím. Tieto funkcie sú na uľahčenie práce. Norhy tu sú pre teba dalšie definicie (Používam ich i ja v móde):

 

#define HOLDING(%0) \
   ((newkeys & (%0)) == (%0))
#define PRESSED(%0) \
   (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \
   (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

Edited by MasterMatoSK
Link to comment
Share on other sites

  • 0

Norhy: sekundový timer a funkcia getplayerkeys...

použi pressed tam urob timer a keď to tlačidlo pustí(released) tak ten timer vypne

toto čo ti piše Dress neodporúčam... je to možne na serveri s 2 hračmi ale ak ich tam budeš mať 50+ tak určite nie.

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