SA-MP Forums Archive
Help With This! - 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: Help With This! (/showthread.php?tid=283240)



Help With This! - [MKD]Max - 14.09.2011

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");
	    }
	}
}
}



Re: Help With This! - [MWR]Blood - 14.09.2011

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;
}



Re: Help With This! - [MKD]Max - 14.09.2011

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


Re: Help With This! - bkart - 14.09.2011

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;
}



Re: Help With This! - [MKD]Max - 14.09.2011

not work too the lift stay up please help!


Re: Help With This! - [MKD]Max - 14.09.2011

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


Re: Help With This! - Kingunit - 14.09.2011

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