Jump to content
  • 0

putin ajutor


jupanu

Question

cum fac sa mearga amndoua pe KEY_FIRE

if(newkeys & KEY_FIRE && IsPlayerInAnyVehicle(playerid))

{

    if(!IsNosVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,0xFF0000AA , "You can not add nitro to the vehicle");

    AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);

}

return 1;

    }

    if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

if (newkeys & KEY_FIRE)

{

    new Float:vx, Float:vy, Float:vz;

    GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);

    if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)

    {

    SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * Boost_Speed[playerid], vy * Boost_Speed[playerid], vz * Boost_Speed[playerid]);

    }

            return 1;

}

  • www.LcsNet.org
  • 91.233.106.13:7777
  • www.Joc-Miniclip.info

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Vezi daca merge ..

if (newkeys==KEY_FIRE)
{
	if(IsPlayerConnected(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(PlayerToPoint(3.0, playerid,2341.0376,2439.0701,7.2954) || PlayerToPoint(3.0, playerid,2328.0708,2447.1416,4.4651))
			{
    		if(!IsNosVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,0xFF0000AA , "You can not add nitro to the vehicle");
    		AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
			return 1;
			}
		}
	}
	else if(IsPlayerConnected(playerid))
	{
		new Float:vx, Float:vy, Float:vz;
		GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
		if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3)
		{
			SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * Boost_Speed[playerid], vy * Boost_Speed[playerid], vz * Boost_Speed[playerid]);
		}
		return 1;
	}
	}
}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

Leon, ce motiv ai avea sa verifici daca playerul care apasa FIRE e conectat ? Crezi ca se deconecteaza in fractiunea aia de secunda ? Si daca da, crezi ca are vre-un efect ? Si in plus newkeys == KEY_FIRE e o prostie, el mai sus o foloseste bine.

Jupane, invata as citesti reguliile.

if (newkeys & KEY_FIRE)
{
    if( IsNosVehicle(GetPlayerVehicleID(playerid)) ) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
   
    new Float:vx, Float:vy, Float:vz;
    GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
    if (floatabs(vx) < 3 && floatabs(vy) < 3 && floatabs(vz) < 3) SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * Boost_Speed[playerid], vy * Boost_Speed[playerid], vz * Boost_Speed[playerid]);
}

Asta e tot, am scos mesajul ala, pt a evita spamul cand apesi click.

     

-Toate tutorialele postate intra aici sau puneti-le direct [url=http://www.sa-mp.ro/forum/index

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.