Help Plz
#1

error 017: undefined symbol "KEY_ALT"
PHP код:
    if(GetPlayerVehicleID(playerid) == 447)
    {
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_ALT))
    {
    new 
GetPlayerVehicleID(playerid);
    
SetVehicleHealth(v,-5);
    
GameTextForPlayer(playerid"~b~Stop spamming Your Vehicle Gun ~r~Heat Up."30001);
    }
return 
1;
}

Help Plz thanks
Reply
#2

Try Do KEY_LALT Insted of KEY_ALT

If that doesnt work... Try
pawn Код:
if(newkeys == KEY_LALT)
    {
Reply
#3

same error 017: undefined symbol "KEY_LALT"
Reply
#4

Use this :-
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(GetPlayerVehicleID(playerid) == 447)
   {
    if(PRESSED(KEY_WALK))
    {
    new v = GetPlayerVehicleID(playerid);
    SetVehicleHealth(v,-5);
    GameTextForPlayer(playerid, "~b~Stop spamming Your Vehicle Gun ~r~Heat Up.", 3000, 1);
    }
return 1;
}
}
Reply
#5

You can't put a callback inside an if() statement. It needs to be the other way around.

As for the key definitions, you can only detect the key actions, such as KEY_SPRINT, KEY_JUMP etc., not literal keys like 'LALT'. LALT by default is KEY_WALK.

See https://sampwiki.blast.hk/wiki/Keys
Reply
#6

but the key not working in game AVI its Anti seasparrow kill spam , CTRL key to shoot from Seasparrow but i press it still not work
Reply
#7

Quote:
Originally Posted by Avi Raj
Посмотреть сообщение
Use this :-
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(GetPlayerVehicleID(playerid) == 447)
   {
    if(PRESSED(KEY_WALK))
    {
    new v = GetPlayerVehicleID(playerid);
    SetVehicleHealth(v,-5);
    GameTextForPlayer(playerid, "~b~Stop spamming Your Vehicle Gun ~r~Heat Up.", 3000, 1);
    }
return 1;
}
}
It would be better to explain his mistakes to him, so he can actually learn..
Reply
#8

but dude its not working i did if(PRESSED(KEY_WALK))
Reply
#9

hey, its the KEY_SECONDARY_ATTACK for seasparrow shot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)