[Ajuda]Sistema Motor
#4

pawn Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
    {
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);
        if(carro != INVALID_VEHICLE_ID)
        {
            if(motor[playerid] == 0)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
                motor[playerid] = 1;
                SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
            }
            else if(motor[playerid] == 1)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
                motor[playerid] = 0;
                SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
            }
        }
        return 1;
    }

Quote:
Originally Posted by Enderman
Посмотреть сообщение
pawn Код:
//new motor[MAX_PLAYERS];

if (strcmp("/motoron", cmdtext, true, 10) == 0)
    {
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);
        if(carro != INVALID_VEHICLE_ID)
        {
            if(motor[playerid] == 0)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
                motor[playerid] = 1;
                SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
            }
            if(motor[playerid] == 1)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
                motor[playerid] = 0;
                SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
            }
        }
    }
    return true;
}
Se nгo usar else if vai dar erro in-game.
Reply


Messages In This Thread
[Ajuda]Sistema Motor - by Scripter_Sk8 - 31.12.2011, 14:52
AW: [Ajuda]Sistema Motor - by Enderman - 31.12.2011, 15:04
Re: [Ajuda]Sistema Motor - by Scripter_Sk8 - 31.12.2011, 15:05
Re: [Ajuda]Sistema Motor - by Lуs - 31.12.2011, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)