I have problem with my /enter command it's doesn't work
#1

Hello, I try to make one Dynamic Doors System and it's work but my enter commnad doesn't work no errors or warnings. If someone know how to fix it please help me +REP

pawn Код:
CMD:enter(playerid, params[]) // By JhnzRep
{
   
    for(new b = 1; b < sizeof(DDoorsInfo); b++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.0, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]))//Checks if player is near the Enter.
        {
            if(DDoorsInfo[b][dLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Door is locked!");//Checks it it is locked/
            SetPlayerPos(playerid, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddExitA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddInteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddInteriorVW]);
            InsideDoors[playerid] = b;
            return 1;
        }
        if(IsPlayerInRangeOfPoint(playerid, 2.0, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]) && GetPlayerVirtualWorld(playerid) == DDoorsInfo[b][ddInteriorVW])//Checks if player is in near the exit.
        {
            SetPlayerPos(playerid, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddEnterA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddExteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddExteriorVW]);
            InsideDoors[playerid] = 0;
            return 1;
        }
    }                                            
    if (IsPlayerInRangeOfPoint(playerid,3.0,2249.8784,52.7020,26.6671))
    {
        SetPlayerPos(playerid,207.5627,-103.7291,1005.2578);
        SetPlayerVirtualWorld(playerid, 15);
        SetPlayerFacingAngle(playerid, 270);
    }
    return 1;
}
Reply
#2

What the value of DDoorsInfo? Verific this.
Reply
#3

pawn Код:
CMD:enter(playerid, params[])
{

    // DEBUGG TESTING!!
   
    printf("DDoorsInfo Has %d var's", sizeof(DDoorsInfo));
   

    // You has started at "0"!
    for(new b = 0; b < sizeof(DDoorsInfo); b++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.0, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]))//Checks if player is near the Enter.
        {
            if(DDoorsInfo[b][dLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Door is locked!");//Checks it it is locked/
            SetPlayerPos(playerid, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddExitA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddInteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddInteriorVW]);
            InsideDoors[playerid] = b;
            break;
        }
        if(IsPlayerInRangeOfPoint(playerid, 2.0, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]) && GetPlayerVirtualWorld(playerid) == DDoorsInfo[b][ddInteriorVW])//Checks if player is in near the exit.
        {
            SetPlayerPos(playerid, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddEnterA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddExteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddExteriorVW]);
            InsideDoors[playerid] = 0;
            break;
        }
    }
   
    if (IsPlayerInRangeOfPoint(playerid,3.0,2249.8784,52.7020,26.6671))
    {
        SetPlayerPos(playerid,207.5627,-103.7291,1005.2578);
        SetPlayerVirtualWorld(playerid, 15);
        SetPlayerFacingAngle(playerid, 270);
    }
    return 1;
}
Make an simple Debug test for check values!
Reply
#4

DDoorsIndo has 800 var's
#define MAX_DDOORS 800
Reply
#5

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
pawn Код:
CMD:enter(playerid, params[])
{

    // DEBUGG TESTING!!
   
    printf("DDoorsInfo Has %d var's", sizeof(DDoorsInfo));
   

    // You has started at "0"!
    for(new b = 0; b < sizeof(DDoorsInfo); b++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.0, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]))//Checks if player is near the Enter.
        {
            if(DDoorsInfo[b][dLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Door is locked!");//Checks it it is locked/
            SetPlayerPos(playerid, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddExitA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddInteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddInteriorVW]);
            InsideDoors[playerid] = b;
            break;
        }
        if(IsPlayerInRangeOfPoint(playerid, 2.0, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]) && GetPlayerVirtualWorld(playerid) == DDoorsInfo[b][ddInteriorVW])//Checks if player is in near the exit.
        {
            SetPlayerPos(playerid, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]);
            SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddEnterA]);
            SetPlayerInterior(playerid, DDoorsInfo[b][ddExteriorInt]);
            SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddExteriorVW]);
            InsideDoors[playerid] = 0;
            break;
        }
    }
   
    if (IsPlayerInRangeOfPoint(playerid,3.0,2249.8784,52.7020,26.6671))
    {
        SetPlayerPos(playerid,207.5627,-103.7291,1005.2578);
        SetPlayerVirtualWorld(playerid, 15);
        SetPlayerFacingAngle(playerid, 270);
    }
    return 1;
}
Make an simple Debug test for check values!
Haha, edit of my system...I'm fine with that..But do not release it..As your own..
Reply
#6

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Haha, edit of my system...I'm fine with that..But do not release it..As your own..
Ohh sorry I will Edit it
Reply
#7

Does it give you any message at all? For example that the door is locked all the time?

If not, try increasing the range on the entrance because from the looks of it I cannot really see anything wrong.

Regards.
Reply
#8

Everything is fine only command is bugged no errors or warnings
Reply
#9

Quote:
Originally Posted by Extremo
Посмотреть сообщение
Does it give you any message at all? For example that the door is locked all the time?

If not, try increasing the range on the entrance because from the looks of it I cannot really see anything wrong.

Regards.
This.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)