[Ajuda] Garagem lvl
#1

boas alguem me ajuda neste comando?

pawn Код:
CMD:entergarage(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    for(new idx=1; idx<MAX_GARAGES; idx++) // Dynamic Garages
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked.");
            if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            format(string, sizeof(string), "* %s lifts the door and enters the garage.", RPN(playerid));
            SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            return 1;
        }
    }
    return 1;
}
Aqui esta "gLevel" que й a garagem lvl 1, eu criei 10 garagens como adiciono neste comando as restantes garagens?

pawn Код:
if(GarageInfo[idx][gLevel] == 2) //garagem lvl 2
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
agradeзo a ajuda
Reply
#2

alguem me ajuda? desculpem duble post nao consegui editar o de cima, alguem me ajuda?

sу quero juntar mais nivel de garagens ao comando, o comando sу tem uma garagem lvl1 disponivel que й esta:

pawn Код:
if(GarageInfo[idx][gLevel] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
eu quero adicionar as seguintes garagens: garagem lvl 2,3,4,5,6,7,8,9 e 10 e tentei fazer isto:

pawn Код:
CMD:entergarage(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    for(new idx=1; idx<MAX_GARAGES; idx++) // Dynamic Garages
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked.");
            if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            format(string, sizeof(string), "* %s lifts the door and enters the garage.", RPN(playerid));
            SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 2)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 3)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 4)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 5)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 6)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 7)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 8)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 9)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            SetPlayerVirtualWorld(playerid, idx+500);
            if(GarageInfo[idx][gLevel] == 10)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -1749.8448,677.3413,105.1406);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -1749.8448,677.3413,105.1406);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            return 1;
        }
    }
    return 1;
}
Mas dame muitos erros :S alguem me ajuda? agradeзo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)