SA-MP Forums Archive
When i enter a place all CMD disable - 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: When i enter a place all CMD disable (/showthread.php?tid=395781)



When i enter a place all CMD disable - Red_Dragon. - 27.11.2012

When i add this filterscript
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2655.207519,639.643737,14.454549))
        {
            SetPlayerPos(playerid, 1170.0588,-1352.4019,2423.0461); // SF Hospital Entrance
            SetPlayerInterior(playerid, 1);
        }
    }
    if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, -2655.207519,639.643737,14.454549);// SF Hospital Exit
            SetPlayerInterior(playerid, 0);
        }
    }
    return 1;
}
when go at the pickup i press /enter and i enter and all is good but when i enter all commands becomes disabled and cannot get out of that place !!!


Re: When i enter a place all CMD disable - Red_Dragon. - 27.11.2012

What do you mean ? sorry i cannot understand you


AW: When i enter a place all CMD disable - Skimmer - 27.11.2012

What you mean with? Which commands?
Quote:

all commands




Re: When i enter a place all CMD disable - Red_Dragon. - 28.11.2012

I mean what are the area checks ? and what is wrong with that code so when i do /enter i get stuck and i cannot get in again


Re: When i enter a place all CMD disable - NumbSkull - 28.11.2012

if you are hard coding the door in you may want the exit near where you are placed when you enter the hospital


Re: When i enter a place all CMD disable - Red_Dragon. - 28.11.2012

:/ don't understand what point you want ?!


Re: When i enter a place all CMD disable - Glad2BeHere - 28.11.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2655.207519,639.643737,14.454549))
        {
            SetPlayerPos(playerid, 1170.0588,-1352.4019,2423.0461); // SF Hospital Entrance
            SetPlayerInterior(playerid, 1);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, -2655.207519,639.643737,14.454549);// SF Hospital Exit
            SetPlayerInterior(playerid, 0);
        }
        return 1;
    }
    return 0;
}
try that


Re: When i enter a place all CMD disable - Red_Dragon. - 28.11.2012

Now no command in thw whole server work


Re: When i enter a place all CMD disable - Red_Dragon. - 30.11.2012

Bump
N.B: after 48 hours


Re: When i enter a place all CMD disable - NumbSkull - 30.11.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2655.207519,639.643737,14.454549))
        {
            SetPlayerPos(playerid, 1170.0588,-1352.4019,2423.0461); // SF Hospital Entrance
            SetPlayerInterior(playerid, 1);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1170.0588,-1352.4019,2423.0461))
        {
            SetPlayerPos(playerid, -2655.207519,639.643737,14.454549);// SF Hospital Exit
            SetPlayerInterior(playerid, 0);
        }
        return 1;
    }
^that will place the exit where you enterd the hospital and removed the return 0; after the cmd so it can reach the rest of you code