Please HELP!!!!!
#1

My problem is that when i turn the car engine writing command /engine then i leave car and the engine stay turned on i enter to the another car and write the /engine and the command don't work, the car engine doesn't start up, and when i turn of the first cars engine and again go to the next then it work.. So can somone help me? here is Gamemod Download link... http://www.megaupload.com/?d=VN2CAZUY
Reply
#2

because i cant be asked to download your script i will tell you how to do it
in your GameMode
SIMPLE way
pawn Код:
//Where is OnPlayerEnterVehicle  (Fin it and remove your function for the engine & replace it with this)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
return 1;
}

//then when the players exit Turn it off
public OnPlayerExitVehicle(playerid, vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
the more COMPLEX way with the command /engine
which will keep the engine running when you EXIT the car if you turned the engine ON yourself
pawn Код:
//first the command
//i dont know what u use CMD or the normal one so
COMMAND:engine(playerid,params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
SendClientMessage(playerid,0x0000FFFF,"Engine ON");
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
SendClientMessage(playerid,0x0000FFFF,"Engine Off");
}
return 1;
}


//When he Enters
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
}

//When he Exits
public OnPlayerExitVehicle(playerid, vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
}
}
return 1;
}
// when he exits you don't really need it i think but just 2 make sure ;)
Reply
#3

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
because i cant be asked to download your script i will tell you how to do it
in your GameMode
SIMPLE way
pawn Код:
//Where is OnPlayerEnterVehicle  (Fin it and remove your function for the engine & replace it with this)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
return 1;
}

//then when the players exit Turn it off
public OnPlayerExitVehicle(playerid, vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
the more COMPLEX way with the command /engine
which will keep the engine running when you EXIT the car if you turned the engine ON yourself
pawn Код:
//first the command
//i dont know what u use CMD or the normal one so
COMMAND:engine(playerid,params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
SendClientMessage(playerid,0x0000FFFF,"Engine ON");
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
SendClientMessage(playerid,0x0000FFFF,"Engine Off");
}
return 1;
}


//When he Enters
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
}

//When he Exits
public OnPlayerExitVehicle(playerid, vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetPVarInt(playerid, "engine")==1)
{
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 0);
}else
{
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "engine", 1);
}
}
return 1;
}
// when he exits you don't really need it i think but just 2 make sure ;)
it didnt help me beacus there is an other system... do you have skype myb i can send you the gamemod?
Reply
#4

Quote:
Originally Posted by Stuf
Посмотреть сообщение
it didnt help me beacus there is an other system... do you have skype myb i can send you the gamemod?
sorry man cant is too long i got work :X
Reply
#5

The link doesn't work. But I think it's occurring because you need to change the engine variable to [MAX_VEHICLES]. Paste the code in pastebin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)