08.01.2012, 13:54
well this is my engine
and my onplayerstate
well i got some problems. When player does /engine in a bicycle (model 481 509 510) it works and i also tryed
but that didnt work.
another problem is when they enter a bicycle i wanted the engine to be auto turned on but its off
pawn Код:
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == 2)
{
new modelid = GetVehicleModel(playerid);
new vid = GetPlayerVehicleID(playerid);
if(modelid == 481) return SendClientMessage(playerid,red,"ERROR: This BMX doesn't have a engine");
if(modelid == 509) return SendClientMessage(playerid,red,"ERROR: This Bike doesn't have a engine");
if(modelid == 510) return SendClientMessage(playerid,red,"ERROR: This Mountain Bike doesn't have a engine");
if(engine != 1)
{
engine = 1;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have turned your vehicle's engine on");
}
else if(engine == 1)
{
engine = 0;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have turned your vehicle's engine off");
}
}
else return SendClientMessage(playerid, red, "You are not driving a vehicle");
return 1;
}
pawn Код:
new vid = GetPlayerVehicleID(playerid);
new modelid = GetVehicleModel(playerid);
if(newstate == 2)
{
if(PlayerData[playerid][CarLicense] == 0)
{
if(drivingcar[playerid] != 1)
{
if(modelid == 481)
{
engine = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
}
if(modelid == 509)
{
engine = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
}
if(modelid == 510)
{
engine = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
}
}
else
{
SendClientMessage(playerid,orange,"You do not have a driving license therefor are driving illegaly please goto /drivingschool");
}
}
if(PlayerData[playerid][CarLicense] == 1)
{
if(modelid == 481 || modelid == 509 || modelid == 510)
{
engine = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
}
}
if(engine == 0)
{
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid,lightyellow,"This vehicle engines are off, use /engine to on it");
}
}
pawn Код:
if(modelid == 481 || modelid == 509 || modelid == 510)
another problem is when they enter a bicycle i wanted the engine to be auto turned on but its off