16.08.2013, 01:04
O comando para ligar e desligar й esse sу que para ligar й /motor 1 e para desligar й /motor 0
pawn Код:
COMMAND:motor(playerid, params[])
{
// Setup local variables
new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Get the player's vehicle
vehicleid = GetPlayerVehicleID(playerid);
// Get the current status of the vehicle
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
// Check if the player is inside a vehicle
if (vehicleid != 0)
{
if (sscanf(params, "i", engine)) SendClientMessage(playerid, 0xFF0000AA, "Use: /motor [0-1]");
else
{
// Set the engine to the value that was passed by the player and leave all other parameters alone
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
}
else
SendClientMessage(playerid, 0x00FF00FF, "Vocк precisa estar dentro de um veнculo para desligб-lo/ligб-lo.");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}