Jump to content
  • 0

Pasagerul poate porni/opri masina


andreistalker

Question

Problema: Pasagerul poate porni/opri masina

Cod:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)// tasta 2

    {

        new vehicleid = GetPlayerVehicleID(playerid);

        if(vehicleid == INVALID_VEHICLE_ID)

                return SendClientMessage(playerid,-1,"Eroare:{FF0000}Nu esti intr-un vehicul!");



        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);


        if(EngineVehicle[vehicleid] == 0) //EngineVehicle == 0 == Stop

        {

	SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);

    new String[256];
    format(String,sizeof(String),"{FFFF00}Ai pornit motorul la {FF0000}%s.",GetVehicleName(vehicleid));
	SendClientMessage(playerid,-1,String);



            EngineVehicle[vehicleid] = 1;

        }

        else if(EngineVehicle[vehicleid] == 1) //EngineVehicle == 1 = Started

        {
            SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);

	new String[256];

    format(String,sizeof(String),"{FFFF00}Ai oprit motorul la {FF0000}%s.",GetVehicleName(vehicleid));
	SendClientMessage(playerid,-1,String);



            EngineVehicle[vehicleid] = 0;

        }

    }
	return 1;
}

 

Edited by andreistalker
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Pune o restrictie la pornire

If (GetPlayerState (plqyerid) == PLAYER_STATE_DRIVER)

 Este scris de mana deci cauta si tu la onplayerstatechange daca e gresit

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid, 1642.7878,-2238.8320,13.4965);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

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.