please help my about /engine
#2

pawn Код:
if(!strcmp(cmd, "/engine", true))
    {
        if(!IsPlayerConnected(playerid)) return 1;
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You must be in a vehicle to use this command.");
        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) || IsADrugHarvest(idcar) || IsASweeper(idcar)) return 1;
        if(CanTurnEngine[playerid] != idcar || CanTurnEngine[playerid] == 9999) return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
        if(!engineOn[GetPlayerVehicleID(playerid)])
        {
            format(string, sizeof(string), "* %s spins a key and tries to start their vehicle's engine.", sendername);
            SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
            GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
            gEngine[playerid] = 1;
        }
        else if(engineOn[GetPlayerVehicleID(playerid)])
        {
            format(string, sizeof(string), "* %s spins a key and turns off their vehicle's engine.", sendername);
            GameTextForPlayer(playerid, "~w~Engine Shut Down.",3500,3);
            gEngine[playerid] = 0;
        }
        ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        new y, m, d, 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;
    }
You had TogglePlayerControllable in your code, which is used to freeze/unfreeze a player. Read more here: https://sampwiki.blast.hk/wiki/TogglePlayerControllable
Reply


Messages In This Thread
please help my about /engine - by kurniarocki - 12.02.2014, 02:11
Re: please help my about /engine - by Threshold - 12.02.2014, 03:30

Forum Jump:


Users browsing this thread: 1 Guest(s)