KEY_YES doesn't work properly? [+Rep] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: KEY_YES doesn't work properly? [+Rep] (
/showthread.php?tid=602415)
KEY_YES doesn't work properly? [+Rep] -
Amit1998 - 06.03.2016
Hey guys,
I'm trying to make script which basically means that when a player clicks on Y it does the following
PHP код:
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..
Re: KEY_YES doesn't work properly? [+Rep] -
MicroKyrr - 06.03.2016
PHP код:
if(newkeys == KEY_YES)
Re: KEY_YES doesn't work properly? [+Rep] -
Crayder - 07.03.2016
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.
pawn Код:
ONKSC{
print("OPKSC Called");
if(newkeys & KEY_YES) {
print("KEY_YES is in newkeys.");
if(Is in sphere)
print("player is in sphere");