my door is not work
#1

Hello, i've problem with my script which is i cannot see my doors, but i can open it. here is the codes and function

function
pawn Код:
enum _doors
{
    gID,
    gFactionID,

    gModelID,

    gOpen,

    Float:closeX, Float:closeY, Float:closeZ, Float: rotX, Float: rotY, Float: rotZ,

    Float:openX, Float:openY, Float:openZ, Float: openrotX, Float: openrotY, Float: openrotZ,
}
new Doors [ ] [ _doors ] = {
    /*
  LSPD
    */

    { 0,    -1, 1569,0, 228.21446228,152.25320435,1002.02343750,0.00000000,0.00000000,270.24060059, 228.21386719,152.25292969,1002.02343750,0.00000000,0.00000000,190.23622131},
    { 1,    -1, 1569,0, 228.23715210,162.22810364,1002.02343750,0.00000000,0.00000000,270.48620605, 228.23632812,162.22753906,1002.02343750,0.00000000,0.00000000,198.48338318},
    { 2,    -1, 1569,0, 276.64627075,189.38932800,1006.17187500,0.00000000,0.00000000,179.62646484, 276.64550781,189.38867188,1006.17187500,0.00000000,0.00000000,251.62097168},
    { 3,    -1, 1569,0, 297.69183350,189.40219116,1006.17187500,0.00000000,0.00000000,180.12646484, 297.69140625,189.40136719,1006.17187500,0.00000000,0.00000000,250.12637329},
    { 4,    -1, 1569,0, 213.74092102,177.05651855,1002.02600098,0.00000000,0.00000000,0.00000000, 213.72116089,177.07305908,1002.02600098,0.00000000,0.00000000,278.00000000},
    { 5,    -1, 1569,0, 217.72319031,177.07225037,1002.03125000,0.00000000,0.00000000,0.00000000, 217.72265625,177.07128906,1002.03125000,0.00000000,0.00000000,287.99996948},
    { 6,    -1, 1569,0, 217.72792053,160.30047607,1002.02343750,0.00000000,0.00000000,0.00000000, 217.72753906,160.29980469,1002.02343750,0.00000000,0.00000000,74.00000000},
    { 7,    -1, 1569,0, 215.78199768,160.32064819,1002.02343750,0.00000000,0.00000000,180.41442871, 215.78125000,160.32031250,1002.02343750,0.00000000,0.00000000,106.41198730}
};
pawn Код:
COMMAND:door(playerid)
{
    new i = playerid;
    for(new g; g < sizeof(Doors); g++)
    {
        if(IsPlayerInRangeOfPoint(i, 3.0, Doors[g][closeX],Doors[g][closeY],Doors[g][closeZ]) || IsPlayerInRangeOfPoint(i, 3.0, Doors[g][openX],Doors[g][openY],Doors[g][openZ]))
        {
            if(Doors[g][gFactionID] == -1 && PlayerInfo[i][playerteam] != COPS && PlayerInfo[i][playerteam] != SASF && PlayerInfo[i][playerteam] != FBI && PlayerInfo[i][playerteam] != POLITIC)
                return SendClientError(playerid, "Only for LSPD / SASF / FBI / GOV");
            if(Doors[g][gFactionID] != -1 && Doors[g][gFactionID] != PlayerInfo[i][playerteam])
                return SendClientError(playerid, "You don't have the permission!");
            if(Doors[g][gOpen] == 0)
            {
                MoveObject(Doors[g][gID], Doors[g][openX], Doors[g][openY], Doors[g][openZ], 5.0);
                SetObjectRot(Doors[g][gID], Doors[g][openrotX],Doors[g][openrotY],Doors[g][openrotZ]);
                Doors[g][gOpen] = 1;
                Action(playerid, "opens up the door.");
            }
            else if(Doors[g][gOpen] == 1)
            {
                MoveObject(Doors[g][gID], Doors[g][closeX],Doors[g][closeY],Doors[g][closeZ], 5.0);
                SetObjectRot(Doors[g][gID], Doors[g][rotX],Doors[g][rotY],Doors[g][rotZ]);
                Doors[g][gOpen] = 0;
                Action(playerid, "closes the door.");
            }
        }
    }
    return 1;
}
Reply
#2

where's CreateObject ?
Reply
#3

how can i do?
Reply
#4

did you add the createobject at " Onplayerconnect ? and on your code ? "
Reply
#5

Edit : Nevermind i fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)