GetPlayerKeys doesn't work
#1

Код:
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(ud == KEY_SPRINT && ud == KEY_JUMP){
Kick(playerid);
}
I don't get kick if i press W+S, why ?

Thanks.
Reply
#2

U're trying to check two keys pressed at same time, is not possible, but u can check the new key and old key pressed in OnPlayerKeyStateChange, KEY_SPRINT would oldkeys and key_jump would newkey
Reply
#3

Why this doesn't work ?

Код:
	if(newkeys & KEY_SPRINT && newkeys & KEY_JUMP){
			if(IsPlayerInAnyVehicle(playerid)){
			SetTimerEx("ewsnow", 14000, false, "i", playerid);
			}
	}

forward ewsnow(playerid);
public ewsnow(playerid){
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(ud == KEY_SPRINT){
SetTimerEx("ewsnoww", 1000, false, "i", playerid);
}
return 1;
}
forward ewsnoww(playerid);
public ewsnoww(playerid){
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(ud == KEY_JUMP){
if(IsPlayerInAnyVehicle(playerid)){
Kick(playerid);
}
}
return 1;
}
I want to detect if the player still pressing for 15 second key W + S, then kick him if he still + if he is a vehicle.
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)