new bool:Motor[MAX_PLAYERS];
if (strcmp(cmdtext, "/motor") == 0) //strcmp
{
new Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo, Veiculo;
Veiculo = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(Veiculo, Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo);
if (Motor[playerid] == true)
{
SetVehicleParamsEx(Veiculo, 0, 0, Alarme, Portas, Capo, PortaMalas, Objetivo);
Motor[playerid] = false;
}
else
{
SetVehicleParamsEx(vehicleid, 1, 1, 0, Portas, Capo, PortaMalas, Objetivo);
Motor[playerid] = true;
}
return 1;
}
COMMAND:motor(playerid, params[])//zcmd
{
new Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo, Veiculo;
Veiculo = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(Veiculo, Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo);
if (Motor[playerid] == true)
{
SetVehicleParamsEx(Veiculo, 0, 0, Alarme, Portas, Capo, PortaMalas, Objetivo);
Motor[playerid] = false;
}
else
{
SetVehicleParamsEx(vehicleid, 1, 1, 0, Portas, Capo, PortaMalas, Objetivo);
Motor[playerid] = true;
}
return 1;
}
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;
}
O comando para ligar e desligar й esse sу que para ligar й /motor 1 e para desligar й /motor 0
pawn Код:
|
C:\Users\Richard\Desktop\url.pwn(44) : error 029: invalid expression, assumed zero
C:\Users\Richard\Desktop\url.pwn(44) : error 017: undefined symbol "cmd_motor"
C:\Users\Richard\Desktop\url.pwn(44) : error 029: invalid expression, assumed zero
C:\Users\Richard\Desktop\url.pwn(44) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:motor(playerid, params[])
#include < zcmd >