16.07.2012, 21:09
(
Последний раз редактировалось kaiks; 16.07.2012 в 22:04.
)
Okay, i want to do something under this:
It must detect, if player's engine is not running, and say "/engine to start engine".
I've tried that, but i got a result that if you were on a vehicle and started the engine, then entered
to another vehicle, then it didn't say anything. It should've said "/engine to start engine" on the other vehicle too.
I hope you understood it,my engine script is here:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
I've tried that, but i got a result that if you were on a vehicle and started the engine, then entered
to another vehicle, then it didn't say anything. It should've said "/engine to start engine" on the other vehicle too.
I hope you understood it,my engine script is here:
pawn Код:
YCMD:mootor(playerid, params[])
{
#pragma unused params
new string[128];
new sendername[MAX_PLAYER_NAME];
new vehiclename[128];
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(!IsPlayerDriver(playerid))
{
SendClientMessage(playerid, COLOR_GREY,"Sa ei ole sхidukis!");
return 1;
}
else if(IsPlayerDriver(playerid))
{
if(engine != 1)
{
engine = 1;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GetVehicleName(vehicleid, vehiclename, sizeof(vehiclename));
mootor[playerid] = 1;
format(string, sizeof(string), "* %s kдivitab sхiduki mootori.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
engine = 0;
mootor[playerid] = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s suretab sхiduki mootori.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
return engine;
}