Help With This!
#1

what i need to do when player press Onkey F lift get down and when he press F again lift go up help!


Код:
	if(PRESSED(KEY_SECONDARY_ATTACK))
	{
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);
	if(gTeam[playerid] == TEAM_ARMY)
	{
	if(x >= 1000.30 && x <= 1031.69 && y >=  -2352.85 && y <=  -2319.59)
	{
	    MoveObject(lift,1015.39, -2336.91, 12.19,3);
	    SendClientMessage(playerid,COLOR_GREEN,"Lift Going Down");
	    LiftDown =1;
	}
	if(x >= 1000.30 && x <= 1031.69 && y >=  -2352.85 && y <=  -2319.59)
	{
	    if(LiftDown == 1)
	    {
	    MoveObject(lift,1015.39, -2336.91, 19.24,3);
	    SendClientMessage(playerid,COLOR_GREEN,"Lift Going Up");
	    }
	}
}
}
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        if(gTeam[playerid] == TEAM_ARMY)
        {
            if(x >= 1000.30 && x <= 1031.69 && y >=  -2352.85 && y <=  -2319.59)
            {
                MoveObject(lift,1015.39, -2336.91, 12.19,3);
                SendClientMessage(playerid,COLOR_GREEN,"Lift Going Down");
                LiftDown = 1;
            }
            if(x >= 1000.30 && x <= 1031.69 && y >=  -2352.85 && y <=  -2319.59)
            {
                if(LiftDown == 1)
                {
                    MoveObject(lift,1015.39, -2336.91, 19.24,3);
                    SendClientMessage(playerid,COLOR_GREEN,"Lift Going Up");
                    LiftDown = 0;
                }
            }
        }
    }
    return 1;
}
Reply
#3

I know that ! but all i need is when i press F lift get down and when i press again lift get up but nothing work in this format ! help
Reply
#4

Try:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        if(gTeam[playerid] == TEAM_ARMY)
        {
            if(x >= 1000.30 && x <= 1031.69 && y >=  -2352.85 && y <=  -2319.59)
            {
                if(LiftDown == 0)
                {
                    MoveObject(lift,1015.39, -2336.91, 12.19,3);
                    SendClientMessage(playerid,COLOR_GREEN,"Lift Going Down");
                    LiftDown = 1;
                }
                else
                {
                    MoveObject(lift,1015.39, -2336.91, 19.24,3);
                    SendClientMessage(playerid,COLOR_GREEN,"Lift Going Up");
                    LiftDown = 0;
                }
            }
        }
    }
    return 1;
}
Reply
#5

not work too the lift stay up please help!
Reply
#6

Sorry for bump but im realy need to tell you bkart realy thanks you help its work i coped you
Reply
#7

Give him some reputation if he helped you. Next time - just using the edit button is enough.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)