Help With Key
#1

what is worng why its not work i try to ways its under

1.
Код:
p
ublic OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	if(PRESSED(KEY_SECONDARY_ATTACK))
	{

	if(X >= 1019.6192 && X <= 1047.1677 && Y >= -2321.0471 && Y <= -2347.2522)
             {
		SendClientMessage(playerid,COLOR_GREEN,"Lift is Going Up");
		MoveObject(lift,1024.61, -2345.58, 12.60,3);
	}
	}
	return 1;
}
2.
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	if(X >= 1019.6192 && X <= 1047.1677 && Y >= -2321.0471 && Y <= -2347.2522)
	{
	if(PRESSED(KEY_SECONDARY_ATTACK))
	{
		SendClientMessage(playerid,COLOR_GREEN,"Lift is Going Up");
		MoveObject(lift,1024.61, -2345.58, 12.60,3);
	}
	}
	return 1;
}
Reply
#2

Why using? if(X >= 1019.6192 && X <= 1047.1677 && Y >= -2321.0471 && Y <= -2347.2522)

Try using https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 20.0, 1019.6192 , 1047.1677 , 0.0000))
    {
        SendClientMessage(playerid,COLOR_GREEN,"Lift is Going Up");
        MoveObject(lift, 1024.61, -2345.58, 12.60,3);
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)