Jump to content

Recommended Posts

  • Administrator
Posted (edited)

ATENTIE! NU folositi

newkeys == macro-ul_comenzii

de exemplu

newkeys == KEY_FIRE

la OnPlayerKeyStateChange.

De ce?

Pentru ca newkeys nu va mai fi la fel ca KEY_FIRE in anumite cazuri.

Pai incercati sa luati un pistol si pune-ti tinta si sa incepeti sa trageti, sa vedeti daca se mai executa instructiunile / instructiunea.

Exemplul este acest cod

if (newkeys == KEY_FIRE)
{
	SendClientMessage(playerid, -1, "Ai tras!");
}

Acum stergeti == si scrieti & (operatorul SI pe biti), acum o sa va mearga.

Poate va intrebati de ce nu a mers, pai nu a mers pentru ca acum valoarea lui newkeys o sa fie KEY_FIRE combinat cu KEY_HANDBRAKE / KEY_AIM.

Edited by WopsS
  • Upvote 4
  • WopsS pinned and featured this topic
  • Administrator
Posted

@WiDuAlK.SaMp hahahahaha, mor de ras!

 

Am postat-o pentru ca am vazut cateva persoane care foloseau egalitatea sa verifice daca se apasa o tasta.

  • 1 month later...
Posted (edited)

 

if (newkeys == KEY_FIRE)
{
	SendClientMessage(playerid, -1, "Ai tras!");
}

 

aici nu trebuia 

 

if ((newkeys ==  KEY_FIRE ) && (IsPlayerInAnyVehicle(playerid)

{

        SendClientMessage(playerid, -1, "AI tras!");

}

 

P.S Doar intreb, deci fara jigniri!

Edited by KelToN.BloWn

                               http://i.imgur.com/NOsIYWt.png

                     Respecta si vei fi respectat. :)

Posted

 

aici nu trebuia 

 

P.S Doar intreb, deci fara jigniri!

Nu, nu e bine.

Ceea ce ai incercat tu sa faci e ca acel mesaj in chat sa apara doar daca esti intr-un vehicul.

Codul corect ar fi:

if(newkeys == KEY_FIRE && IsPlayerAnyVehicle(playerid))
{
    SendClientMessage(playerid, -1, "Ai apasat Click fiind intr-un vehicul!");
}

 

242086.png

  • Administrator
Posted
On 06/30/2015 at 2:20 PM, KelToN.BloWn said:

 

aici nu trebuia 

 

P.S Doar intreb, deci fara jigniri!

Nu, acolo nu voiam sa vad daca jucatorul este in masina si trage voiam doar sa vad daca trage.

P.S:Corect ar fi ca asta

newkeys ==  KEY_FIRE

sa fie

newkeys & KEY_FIRE

Cum am zis si mai jos.

  • WopsS unpinned and pinned this topic
  • WopsS unfeatured this topic
  • 1 year later...

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.