28.03.2010, 20:20
Hello,
I am using the following car system:
http://forum.sa-mp.com/index.php?topic=160633.0
I edited it to my GM and i have this command
if the player owns the car it will turn on the engine and if he dont, it wont.
Any ways i got the public vehicles on the GM too (LSPD,EMT,ETC..) and they're not buyable so when i try to /engine it says i dont own the vehicle. How can i fix it ?
I am using the following car system:
http://forum.sa-mp.com/index.php?topic=160633.0
I edited it to my GM and i have this command
if the player owns the car it will turn on the engine and if he dont, it wont.
Any ways i got the public vehicles on the GM too (LSPD,EMT,ETC..) and they're not buyable so when i try to /engine it says i dont own the vehicle. How can i fix it ?
Код:
if(strcmp(cmd, "/engine", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(!strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
{
SendClientMessage(playerid,COLOR_VEH,"This is not your car!");
return 1;
}
if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
{
TogglePlayerControllable(playerid,1);
EngineStatus[GetPlayerVehicleID(playerid)] = 1;
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"turns on his vehicle's engine.");
}
else
{
PlayerActionMessage(playerid,15.0,"turns on her vehicle's engine.");
}
}
else
{
TogglePlayerControllable(playerid,0);
EngineStatus[GetPlayerVehicleID(playerid)] = 0;
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"turns off his vehicle's engine.");
}
else
{
PlayerActionMessage(playerid,15.0,"turns off her vehicle's engine.");
}
}
}
else
{
SendClientMessage(playerid,COLOR_VEH,"You are not in a car!");
}
return 1;
}

