Whats wrong?
#6

Quote:
Originally Posted by AlexzzPro
Посмотреть сообщение
this is my new code:
pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    return 1;
                }
                if(engineon[playerid] == 0)
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
                    engineon[playerid] = 1;
                    return 1;
            }
            else if (engineon[playerid] == 1)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                if(vid != INVALID_VEHICLE_ID) {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                engineon[playerid] = 0;
                }
            }
        }
    }
 }
}

and it still dosent work.
I am not sure but try this:


pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    return 1;
                }
                if(engineon[playerid] == 0)
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
                    engineon[playerid] = 1;
                    return 1;
            }
            else if (engineoff[playerid] == 1)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                if(vid != INVALID_VEHICLE_ID) {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                engineon[playerid] = 0;
                }
            }
        }
    }
 }
}
If alried don't work try this:


pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    return 1;
                }
                if(engineon[playerid] == 0)
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
                    engineon[playerid] = 1;
                    return 1;
            }
            else if (engineoff[playerid] == 0)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                if(vid != INVALID_VEHICLE_ID) {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                engineon[playerid] = 0;
                }
            }
        }
    }
 }
}
if continue dont working try this:

pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    return 1;
                }
                if(engineon[playerid] == 0)
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "*%s turns the ignition and starts the vehicle.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, COLOR_YELLOW, " Your vehicle started succesfully!");
                    engineon[playerid] = 1;
                    return 1;
            }
            else if (engineon[playerid] == 0)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "*%s turns the ignition and turns off the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                if(vid != INVALID_VEHICLE_ID) {
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                engineon[playerid] = 0;
                }
            }
        }
    }
 }
}
If it dont work too i dont know
Reply


Messages In This Thread
Whats wrong? - by BizzyD - 25.01.2011, 10:48
Re: Whats wrong? - by Tomejus - 25.01.2011, 10:52
Re: Whats wrong? - by BizzyD - 25.01.2011, 11:00
Re: Whats wrong? - by BizzyD - 25.01.2011, 11:10
Re: Whats wrong? - by BizzyD - 25.01.2011, 11:47
Re: Whats wrong? - by ricardo178 - 25.01.2011, 11:49
Re: Whats wrong? - by wizzi - 25.01.2011, 11:54
Re: Whats wrong? - by BizzyD - 25.01.2011, 12:01
Re: Whats wrong? - by ricardo178 - 25.01.2011, 12:04
Re: Whats wrong? - by BizzyD - 25.01.2011, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)