05.09.2010, 11:11
Hello,
I had this before with Fishing System which is still not fixed (its own script). Now it occures with engine system to.
. This is the random
And that is the command.
Now it doesnt start the engine, even when it doesnt fail. What is the problem? :S
Regards, Jochem
I had this before with Fishing System which is still not fixed (its own script). Now it occures with engine system to.
pawn Код:
new EngineRandom[][] =
{
{"* Engine started.", 1 },
{"* Engine start failed.", 0 }
};
pawn Код:
dcmd_engine(playerid,params[])
{
#pragma unused params
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(PlayerInfo[vehicleid][EngineRunning] == 0)
{
new rand = random(sizeof(EngineRandom));
SendClientMessage(playerid,COLOR_WHITE,EngineRandom[rand][0]);
PlayerInfo[vehicleid][EngineRunning] = EngineRandom[rand][1];
TogglePlayerControllable(playerid,0);
}
else if(PlayerInfo[vehicleid][EngineRunning] == 1)
{
SendClientMessage(playerid,COLOR_WHITE,"* Engine stopped.");
TogglePlayerControllable(playerid,0);
PlayerInfo[vehicleid][EngineRunning] = 0;
}
}
else return SendClientMessage(playerid,COLOR_RED,"* You are not in a vehicle.");
return 1;
}
Now it doesnt start the engine, even when it doesnt fail. What is the problem? :S
Regards, Jochem