/engine not can't use
#1

why this not cant use
pawn Код:
if(!strcmp(cmd, "/engine", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(!engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;

                    {
                        if(HireCar[playerid] != idcar) return 1;
                    }
                    if(IsAHarvest(idcar)) return 1;
                    if(IsADrugHarvest(idcar)) return 1;
                    if(IsASweeper(idcar)) return 1;


                    if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
                        return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

                    format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
                    GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
                    gEngine[playerid] = 1;
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
                    CommandLog(string);
                    return 1;
                }
                else if(engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
                    {
                        if(HireCar[playerid] != idcar) return 1;
                    }
                    if(IsAHarvest(idcar)) return 1;
                    if(IsADrugHarvest(idcar)) return 1;
                    if(IsASweeper(idcar)) return 1;

                    if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
                        return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

                    format(string, sizeof(string), "* %s spins a key and turns off the engine.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    GameTextForPlayer(playerid, "~w~Engine Shat Down.",3500,3);
                    gEngine[playerid] = 0;
                    TogglePlayerControllable(playerid, 1);
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
                    CommandLog(string);
                    return 1;
                }
            }
        }
        return 1;
    }
Reply
#2

Now we have to guess problems too?
Reply
#3

Iam still don't know what you want
Reply
#4

that command cant trun on the vehicle
Reply
#5

if i use it on vehicle, it can't trun on engine
Reply
#6

or anyone have new commnad /engine to replace my command
Reply
#7

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx ??

pawn Код:
if(!strcmp(cmd, "/engine", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(!engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;

                    {
                        if(HireCar[playerid] != idcar) return 1;
                    }
                    if(IsAHarvest(idcar)) return 1;
                    if(IsADrugHarvest(idcar)) return 1;
                    if(IsASweeper(idcar)) return 1;


                    if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
                        return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

                    format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
                    GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
                    SetVehicleParamsEx(vehicleid, 1, 0, 0, 0, 0, 0, 0); // On
                    gEngine[playerid] = 1;
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
                    CommandLog(string);
                    return 1;
                }
                else if(engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
                    {
                        if(HireCar[playerid] != idcar) return 1;
                    }
                    if(IsAHarvest(idcar)) return 1;
                    if(IsADrugHarvest(idcar)) return 1;
                    if(IsASweeper(idcar)) return 1;

                    if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
                        return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");

                    format(string, sizeof(string), "* %s spins a key and turns off the engine.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    GameTextForPlayer(playerid, "~w~Engine Shat Down.",3500,3);
                    SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0); // Off
                    gEngine[playerid] = 0;
                    TogglePlayerControllable(playerid, 1);
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
                    CommandLog(string);
                    return 1;
                }
            }
        }
        return 1;
    }
Reply
#8

some error
Quote:

C:\Users\User\Desktop\Republic State Roleplay\gamemodes\mode.pwn(27394) : error 017: undefined symbol "vehicleid"
C:\Users\User\Desktop\Republic State Roleplay\gamemodes\mode.pwn(27421) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

line 27394
Код:
SetVehicleParamsEx(vehicleid, 1, 0, 0, 0, 0, 0, 0); // On
line 27421
Код:
SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0); // Off
Reply
#9

please help me
Reply
#10

This.

pawn Код:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)