Help with starting engine using key
#2

pawn Код:
if (PRESSED(KEY_HANDBRAKE))
    {
        new idcar = GetPlayerVehicleID(playerid);
        if(IsPlayerConnected(playerid))
        {
            print("conected");
            if(IsPlayerInAnyVehicle(playerid))
            {
                print("in any car");  
                if(gEngine[idcar] == 0)
                {
                    print("gEngine is 0");
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
                    if(IsARentableCar(idcar))
                    {
                        if(HireCar[playerid] != idcar) return 1;
                    }
                    if(IsAHarvest(idcar)) return 1;
                    if(IsADrugHarvest(idcar)) return 1;
                    if(IsASweeper(idcar)) return 1;
                    print("not forbiden");


                    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[idcar] = 1;
                    print("gEngine is 1");
                    new engine,lights,alarm,doors,bonnet,boot,objective;
                    GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, 0, 0, 0, 0, 0);
                    print("Engine is ON");
                    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;
                }
            }
        }
    }
Replace with you command and show me server log.
Reply


Messages In This Thread
Help with starting engine using key - by jakejohnsonusa - 23.11.2012, 20:45
Re: Help with starting engine using key - by Azazelo - 23.11.2012, 20:55
Re: Help with starting engine using key - by jakejohnsonusa - 23.11.2012, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)