SA-MP Forums Archive
I have problem with my /enter command it's doesn't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I have problem with my /enter command it's doesn't work (/showthread.php?tid=350305)



I have problem with my /enter command it's doesn't work - RenSoprano - 11.06.2012

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;
}



Respuesta: I have problem with my /enter command it's doesn't work - CidadeNovaRP - 12.06.2012

What the value of DDoorsInfo? Verific this.


Re: I have problem with my /enter command it's doesn't work - zSuYaNw - 12.06.2012

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!


Re: I have problem with my /enter command it's doesn't work - RenSoprano - 12.06.2012

DDoorsIndo has 800 var's
#define MAX_DDOORS 800


Re: I have problem with my /enter command it's doesn't work - JhnzRep - 12.06.2012

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..


Re: I have problem with my /enter command it's doesn't work - RenSoprano - 12.06.2012

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


AW: I have problem with my /enter command it's doesn't work - Extremo - 12.06.2012

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.


Re: I have problem with my /enter command it's doesn't work - RenSoprano - 12.06.2012

Everything is fine only command is bugged no errors or warnings


Re: AW: I have problem with my /enter command it's doesn't work - Unfriendly - 12.06.2012

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.