SA-MP Forums Archive
onplayerkeystatechange - 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: onplayerkeystatechange (/showthread.php?tid=454093)



onplayerkeystatechange - Sellize - 27.07.2013

Why doesnt this do anything
Код:
if (PRESSED(KEY_CROUCH))
	{
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        if(GetPlayerVehicleID(playerid) == 462)
	        {
	            new faggio = GetPlayerVehicleID(playerid);
	            new Float:x, Float:y, Float:z;
	            GetVehiclePos(faggio, x, y, z);
	            SetVehiclePos(faggio, x, y + 2, z);
	            PutPlayerInVehicle(playerid, faggio, 0);
	            PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
	        }
	    }
	}



Re: onplayerkeystatechange - MellowHammer - 27.07.2013

pawn Код:
if (PRESSED(KEY_CROUCH))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 462)
            {
                new faggio = GetPlayerVehicleID(playerid);
                new Float:x, Float:y, Float:z;
                GetVehiclePos(faggio, x, y, z);
                SetVehiclePos(faggio, x, y + 2, z);
                PutPlayerInVehicle(playerid, faggio, 0);
                PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
            }
        }
    }



Re: onplayerkeystatechange - dannyk0ed - 27.07.2013

pawn Код:
if(GetPlayerVehicleID(playerid) == 462)
I don't understand what you are trying to do here. If the vehicle ID is 460 then the command goes through.
Are you trying to get the model ID or something else?


Re: onplayerkeystatechange - Richie© - 27.07.2013

Player is inside a faggio, move the faggio and put him back in the faggio and play a sound. Why?


Re: onplayerkeystatechange - Sellize - 27.07.2013

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Player is inside a faggio, move the faggio and put him back in the faggio and play a sound. Why?
lol its funny how you stated it, keep an eye on the filterscripts board. Its a funny script