/enter not work ,i try 10 times
#1

Well i try 10 times why this code not work -_-

code:

Код:
#include < a_samp >
new CheckPoint;

public OnGameModeInit()
{
    DisableInteriorEnterExits( );
    CheckPoint = CreatePickup(1318,1,1411.9040527344, -1699.5897216797, 13.787961959839);
    
    
    return 1;
}

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( strcmp( "/enter", cmdtext, true, 6) == 0)
    {
        if( IsPlayerInRangeOfPoint( playerid,10,1411.9040527344, -1699.5897216797, 13.787961959839 ) )
        {
            SetPlayerPos( playerid,501.77899169922, -67.483757019043, 998.25628662109 );
			SetPlayerInterior(playerid,11);

			return 1;
        }
    }
    if( strcmp( "/exit",cmdtext,true,6) == 0)
    {
        if( IsPlayerInRangeOfPoint( playerid,10,501.77899169922, -67.483757019043, 998.25628662109 ) )
        {
            SetPlayerPos( playerid,1411.9040527344, -1699.5897216797, 13.787961959839 );
            SetPlayerInterior(playerid,0);
            
            return 1;
        }
    }
    return 0;
}
public OnPlayerPickUpPickup( playerid, pickupid )
{
    if(pickupid == CheckPoint)
        {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
        }
	return 1;
}
Reply
#2

You getting errors?
Reply
#3

Not,i cant enter -_-
Reply
#4

Try do some debugging, also I would recommend moving your return value like I have done in this example:

pawn Код:
if( strcmp( "/enter", cmdtext, true, 6) == 0)
{
    print("Success 1");
    if( IsPlayerInRangeOfPoint( playerid,10,1411.9040527344, -1699.5897216797, 13.787961959839 ) )
    {
        print("Success 2");
        SetPlayerPos( playerid,501.77899169922, -67.483757019043, 998.25628662109 );
        SetPlayerInterior(playerid,11);    
    }
    print("Success 3");
    return 1;
}
What exactly goes wrong? Also please try that and tell me what it prints, this is how we debug problems with code!
Reply
#5

Check your co-ordinates. Debug your script like this

pawn Код:
#include < a_samp >
new CheckPoint;

public OnGameModeInit()
{
    DisableInteriorEnterExits( );
    CheckPoint = CreatePickup(1318,1,1411.9040527344, -1699.5897216797, 13.787961959839);
   
   
    return 1;
}

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( strcmp( "/enter", cmdtext, true, 6) == 0)
    {
        if( IsPlayerInRangeOfPoint( playerid,10,1411.9040527344, -1699.5897216797, 13.787961959839 ) )
        {
            SetPlayerPos( playerid,501.77899169922, -67.483757019043, 998.25628662109 );
        SetPlayerInterior(playerid,11);
            return 1;
        }
        else
        {
           SendClientMessage(playerid, color, "The coordiantes is not correct");
           return 1;
        }
    }
    if( strcmp( "/exit",cmdtext,true,6) == 0)
    {
        if( IsPlayerInRangeOfPoint( playerid,10,501.77899169922, -67.483757019043, 998.25628662109 ) )
        {
            SetPlayerPos( playerid,1411.9040527344, -1699.5897216797, 13.787961959839 );
            SetPlayerInterior(playerid,0);
            return 1;
        }
        else
        {
           SendClientMessage(playerid, color, "The coordiantes is not correct");
           return 1;
        }
    }
    return 0;
}
public OnPlayerPickUpPickup( playerid, pickupid )
{
    if(pickupid == CheckPoint)
        {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
        }
    return 1;
}
Reply
#6

Maybe you're using a FilterScript which is conflicting this GameMode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)