Vehicle System Halp
#1

Can someone help me with script
Код:
#include <a_samp>
#include <zcmd>

#define VEHICLE_PARAMS_UNSET    -1
#define VEHICLE_PARAMS_OFF  0
#define VEHICLE_PARAMS_ON   1
#define vehicleid GetPlayerVehicleID(playerid);

native SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
native GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);

new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Vehicle Control System Loaded");
	print(" Coded by Auxxx");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print(" Vehicle Control System Un-Loaded");
	print(" Coded by Auxxx");
	print("--------------------------------------\n");
	return 1;
}

public OnGameModeInit()
{
	return 1;
}

CMD:veh(playerid, params[])
{
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
	if(strcmp(params, "Engine", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(EngineStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
				}
				else if(EngineStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Lights", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(LightsStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					LightsStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
				}
				else if(LightsStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					LightsStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Alarm", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(AlarmStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					AlarmStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {2F991A}on!");
				}
				else if(AlarmStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					AlarmStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {E31919}off!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Doors", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(DoorsStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					DoorsStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {2F991A}open!");
				}
				else if(DoorsStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					DoorsStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {E31919}closed!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Bonnet", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(BonnetStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					BonnetStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {2F991A}open!");
				}
				else if(BonnetStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					BonnetStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {E31919}closed!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Boot", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(BootStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					BootStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {2F991A}open!");
				}
				else if(BootStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					BootStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {E31919}closed!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else if(strcmp(params, "Objective", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(ObjectiveStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					ObjectiveStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {2F991A}active!");
				}
				else if(ObjectiveStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					ObjectiveStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {E31919}unactive!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	else SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX: /veh [function]"),
	SendClientMessage(playerid, 0xFFFFFFAA, "Functions: Engine, Lights, Alarm, Doors, Bonnet, Boot, Objective");
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (PRESSED(KEY_LOOK_BEHIND))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(EngineStatus[playerid] == 0)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
				}
				else if(EngineStatus[playerid] == 1)
				{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
	}
	return 1;
}
The Problems are
Код:
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(9) : error 001: expected token: ")", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(9) : error 001: expected token: ";", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(10) : error 001: expected token: ")", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(10) : error 001: expected token: ";", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : error 001: expected token: ",", but found ";"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : error 029: invalid expression, assumed zero
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : error 001: expected token: ";", but found ")"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(49) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
If anyone cold help me, I am gratefully to him/her
Reply
#2

oh......you people are hard.... anyway... show what are the lines with the errors...
Reply
#3

Quote:
Originally Posted by XePloiT
Посмотреть сообщение
oh......you people are hard.... anyway... show what are the lines with the errors...
Number 9 native SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
Number 10 native GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
Nunber 49 GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);
Reply
#4

I guess you need to put those vars on top of your FS:
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
Reply
#5

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
I guess you need to put those vars on top of your FS:
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
Код:
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(11) : error 001: expected token: ")", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(11) : error 001: expected token: ";", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(12) : error 001: expected token: ")", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(12) : error 001: expected token: ";", but found "("
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "engine" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "alarm" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "bonnet" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "boot" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 219: local variable "objective" shadows a variable at a preceding level
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : error 001: expected token: ",", but found ";"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : error 029: invalid expression, assumed zero
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : warning 215: expression has no effect
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : error 001: expected token: ";", but found ")"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(51) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#6

Forgot to tell you, If you put it on top of the GM / FS.
Delete it from other callbacks, as OnPlayerCommandText.

EDIT:
Try this:
pawn Код:
#include <a_samp>
#include <zcmd>

#define VEHICLE_PARAMS_UNSET    -1
#define VEHICLE_PARAMS_OFF  0
#define VEHICLE_PARAMS_ON   1
#define vehicleid GetPlayerVehicleID(playerid);

new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Un-Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

CMD:veh(playerid, params[])
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
    if(strcmp(params, "Engine", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Alarm", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(AlarmStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {2F991A}on!");
                }
                else if(AlarmStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Doors", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(DoorsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {2F991A}open!");
                }
                else if(DoorsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Bonnet", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BonnetStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {2F991A}open!");
                }
                else if(BonnetStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Boot", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BootStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {2F991A}open!");
                }
                else if(BootStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Objective", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(ObjectiveStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {2F991A}active!");
                }
                else if(ObjectiveStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {E31919}unactive!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX: /veh [function]"),
    SendClientMessage(playerid, 0xFFFFFFAA, "Functions: Engine, Lights, Alarm, Doors, Bonnet, Boot, Objective");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_LOOK_BEHIND))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Forgot to tell you, If you put it on top of the GM / FS.
Delete it from other callbacks, as OnPlayerCommandText.

EDIT:
Try this:
pawn Код:
#include <a_samp>
#include <zcmd>

#define VEHICLE_PARAMS_UNSET    -1
#define VEHICLE_PARAMS_OFF  0
#define VEHICLE_PARAMS_ON   1
#define vehicleid GetPlayerVehicleID(playerid);

new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Un-Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

CMD:veh(playerid, params[])
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
    if(strcmp(params, "Engine", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Alarm", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(AlarmStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {2F991A}on!");
                }
                else if(AlarmStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Doors", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(DoorsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {2F991A}open!");
                }
                else if(DoorsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Bonnet", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BonnetStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {2F991A}open!");
                }
                else if(BonnetStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Boot", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BootStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {2F991A}open!");
                }
                else if(BootStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Objective", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(ObjectiveStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {2F991A}active!");
                }
                else if(ObjectiveStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {E31919}unactive!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX: /veh [function]"),
    SendClientMessage(playerid, 0xFFFFFFAA, "Functions: Engine, Lights, Alarm, Doors, Bonnet, Boot, Objective");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_LOOK_BEHIND))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    return 1;
}
Код:
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : error 017: undefined symbol "GetVehicleParamsEx"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : warning 202: number of arguments does not match definition
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : error 001: expected token: ",", but found ";"
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\Kyle Rox\Desktop\Server 0.3c\filterscripts\ultimatecar.pwn(41) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

delete the natives they are already in the <a_samp> include
Reply
#9

Quote:
Originally Posted by thimo
Посмотреть сообщение
delete the natives they are already in the <a_samp> include
I already deleted it.
I am using this
pawn Код:
#include <a_samp>
#include <zcmd>

#define VEHICLE_PARAMS_UNSET    -1
#define VEHICLE_PARAMS_OFF  0
#define VEHICLE_PARAMS_ON   1
#define vehicleid GetPlayerVehicleID(playerid);

new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Vehicle Control System Un-Loaded");
    print(" Coded by Auxxx");
    print("--------------------------------------\n");
    return 1;
}

CMD:veh(playerid, params[])
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
    if(strcmp(params, "Engine", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Alarm", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(AlarmStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {2F991A}on!");
                }
                else if(AlarmStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's alarm {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Doors", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(DoorsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {2F991A}open!");
                }
                else if(DoorsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    DoorsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's doors are now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Bonnet", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BonnetStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {2F991A}open!");
                }
                else if(BonnetStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BonnetStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's bonnet is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Boot", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BootStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {2F991A}open!");
                }
                else if(BootStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    BootStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's boot is now {E31919}closed!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else if(strcmp(params, "Objective", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(ObjectiveStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {2F991A}active!");
                }
                else if(ObjectiveStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    ObjectiveStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "The vehicle's objective is now {E31919}unactive!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX: /veh [function]"),
    SendClientMessage(playerid, 0xFFFFFFAA, "Functions: Engine, Lights, Alarm, Doors, Bonnet, Boot, Objective");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_LOOK_BEHIND))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(EngineStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                }
                else if(EngineStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    EngineStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
    return 1;
}
@LV-CNR = You have the wrong script
Reply
#10

Do you have 0.3c include files?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)