SA-MP Forums Archive
hotkeys problem.. - 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: hotkeys problem.. (/showthread.php?tid=534335)



hotkeys problem.. - jimis - 29.08.2014

hi guys i have this:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if ((
newkeys==KEY_YES)&&(GetPlayerState(playerid)==PLAYER_STATE_ONFOOT))
    {
        new 
pkid;
        new 
pskin GetPlayerSkin(playerid);
        if(
pskin == 265 || pskin == 266 || pskin == 282 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288)
        {
                        new 
Float:xFloat:yFloat:z;
                        
GetPlayerPos(pkidxyz);
                        if(
IsPlayerInRangeOfPoint(playerid5.0xyz))
                        {
                            new 
pname[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME], string1[250], string2[256], string3[100], string4[100];
                            
GetPlayerName(playeridpnamesizeof(pname));
                            
GetPlayerName(pkidanamesizeof(aname));
                            if (
GetPlayerWantedLevel(pkid) >= 1)
                            {
                                
cufftim SetTimerEx("cufeer"1000false"i"playerid);
                                return 
1;
                            }
                         }
        }
    }
    else
    if ((
newkeys==KEY_SUBMISSION)&&(GetPlayerState(playerid)==PLAYER_STATE_ONFOOT))
    {
        new 
pcolor GetPlayerColor(playerid);
        if (
RobBurger[playerid] == )
        if(
IsPlayerInRangeOfPoint(playerid,2.0,375.8449,-65.2709,1001.5078))
        if(
pcolor == COLOR_WHITE || pcolor == COLOR_RED)
        {
                     
CountDownTimerlisties SetTimerEx("CountDownlisties"1000true"i"playerid);
            
SendClientMessage(playeridCOLOR_GREEN"You start robbing CrewBar!");
            
Robgym[playerid] = 1;
            
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+1);
            
timer6 SetTimerEx("RobGym"15000false"i"playerid);
            
SetTimerEx("after6"50000false"i"playerid);
           }
           else
        if (
RobSex[playerid] == )
        if(
IsPlayerInRangeOfPoint(playerid,2.0,-103.6512,-24.6736,1000.7188) || IsPlayerInRangeOfPoint(playerid,2.0,2476.2017,-1747.2950,13.1127) || IsPlayerInRangeOfPoint(playerid,2.0,2107.4668,-1789.6288,13.1291))
        if(
pcolor == COLOR_WHITE || pcolor == COLOR_RED)
        {
                        if (
GetPlayerVirtualWorld(playerid) == 22)
                        {
                            
CountDownTimerlisties SetTimerEx("CountDownlisties"1000true"i"playerid);
                               
SendClientMessage(playeridCOLOR_GREEN"You start robbing SexShop2, stay here for 15 sec to complete the robbery!");
                            
SetPlayerColor(playerid,COLOR_RED);
                            
RobSex[playerid] = 1;
                            
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+1);
                            
timer13 SetTimerEx("RobSex2"15000false"i"playerid);
                            
SetTimerEx("after13"50000false"i"playerid);
                        }
                        else
                        if (
GetPlayerVirtualWorld(playerid) == 13)
                        {
                            
CountDownTimerlisties SetTimerEx("CountDownlisties"1000true"i"playerid);
                            
SendClientMessage(playeridCOLOR_GREEN"You start robbing SexShop1 ,stay here for 15 sec to complete the robbery!");
                            
RobSex[playerid] = 1;
                            
SetPlayerColor(playerid,COLOR_RED);
                            
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+1);
                               
timer12 SetTimerEx("RobSex3"15000false"i"playerid);
                            
SetTimerEx("after12"50000false"i"playerid);
                        }
        }
    }
    return 
1;

when i press yes or midle mouse button , nothing happends , but i want it with hotkey, may someone tell me whats wrong?? thanks guys , its really important


Re: hotkeys problem.. - Rudy_ - 29.08.2014

i think you need old keys too, add KEY_YES as old keys, just with new keys


Re: hotkeys problem.. - jimis - 29.08.2014

you mean to replace "newkeys" with "oldkeys" ??


Re: hotkeys problem.. - Rudy_ - 29.08.2014

No...
pawn Код:
if((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH)
Something like this


Re: hotkeys problem.. - jimis - 29.08.2014

ok , i am going to test it


Re: hotkeys problem.. - jimis - 29.08.2014

no.. still not working, but thanks for your time


Re: hotkeys problem.. - jimis - 29.08.2014

some help guys ...