22.05.2010, 03:51
Almost finished engine, but I have one more problem. When I do /engine in a "factioncar" it says "SERVER: Unknown command"
Code:
Code:
pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
{
new carid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You aren't in a vehicle!");
return 1;
}
if(CInfo[carid-1][cEngine] == 0)
{
OnPlayerCommandText(playerid, "/me spins the key and successfully starts the engine");
TogglePlayerControllable(playerid, 1);
CInfo[carid-1][cEngine] = 1;
return 1;
}
if(CInfo[carid-1][cEngine] == 1)
{
OnPlayerCommandText(playerid, "/me spins the key and shuts off the engine");
TogglePlayerControllable(playerid, 0);
CInfo[carid-1][cEngine] = 0;
return 1;
}
if(FactionCar[carid][fcFaction] != PlayerInfo[playerid][pFaction])
{
OnPlayerCommandText(playerid, "/me tries to start the engine, but fails");
SendClientMessage(playerid, COLOR_GREY, "You don't have the keys for this vehicle!");
return 1;
}
if(FactionCar[carid][fcEngine] == 0)
{
OnPlayerCommandText(playerid, "/me spins the key and successfully starts the engine");
TogglePlayerControllable(playerid, 1);
FactionCar[carid][fcEngine] = 1;
return 1;
}
if(FactionCar[carid][fcEngine] == 1)
{
OnPlayerCommandText(playerid, "/me spins the key and shuts off the engine");
TogglePlayerControllable(playerid, 0);
FactionCar[carid][fcEngine] = 0;
}
return 1;
}