CMD:engine(pid)
{
if(IsPlayerInAnyVehicle(pid))
{
new id = GetPlayerVehicleID(pid);
if(VBroke[id] == 1) return ErrorMessage(pid, "Vehicle is broken or out of fuel.");
if(VehicleInfo[id][vRented] == pid || VehicleInfo[id][vFaction] == PlayerInfo[pid][pFaction] || strmatch(VehicleInfo[id][vOwner], GetName(pid)))
{
new engine, lights, alarm, doors, bonnet, boot, objective, string[100];
GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0)
{
SetVehicleParamsEx(id, 1, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "twists the key, starting the engine of the %s.", GetVehicleFriendlyName(id));
MeMessage(pid, string);
return 1;
}
else
{
SetVehicleParamsEx(id, 0, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "twists the key, shutting off the engine of the %s.", GetVehicleFriendlyName(id));
MeMessage(pid, string);
return 1;
}
}
else return ErrorMessage(pid, "You don't have a key for this vehicle.");
}
else return ErrorMessage(pid, "You aren't in a vehicle.");
}
Doesn't matter if you tried it in localhost - If your script is not properly done and has lots of bottlenecks any script executed will have lag regardless of your ping.
What happens with the message? Does it also take 5 seconds to be sent, or it does get sent instantly after typing the command? |
i know it has bottlenecks, that's why I was trying to prevent comments "shit host get new one"
The engine/message does not come up until about 5 seconds after typnig the command sometimes, however, other times it works fine |