PDA

View Full Version : KEY_YES doesn't work properly? [+Rep]


Amit1998
06/03/2016, 07:17 PM
Hey guys,
I'm trying to make script which basically means that when a player clicks on Y it does the following
if(IsPlayerInSphere(playerid, 1528.4960,117.3113,17.3281, 15) && (newkeys & KEY_YES)) // LEAD
{
GivePlayerMoneyEx(playerid, -5000);

ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.1, 1, 1, 1,0,0,1);
new myobject = CreateDynamicObject(1271, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToPlayer(myobject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
if(GetTickCount() - PlayerTemp[playerid][cmdtick] < 4000) return SendClientWarning(playerid, "You may use this feature only once in each 4 seconds.");

but nothing happens as I click it, seems like it doesn't detect the key for some reason..

MicroKyrr
06/03/2016, 11:05 PM
if(newkeys == KEY_YES)

Crayder
07/03/2016, 12:16 AM
DON'T do what MicroKyrr said, that answer makes no sense.

What you need to do right now is add prints all over so you can track what's going on.

ex.ONKSC{
print("OPKSC Called");
if(newkeys & KEY_YES) {
print("KEY_YES is in newkeys.");
if(Is in sphere)
print("player is in sphere");