Go to any interior command?
#1

Could you tell me why this command doesnt work? I dont get any errors.
Код:
command(gotointeriorid, playerid, params[])
{
	new id, x, y, z;
	if(sscanf(params, "mksl", id, x, y, z))
	{
		if(Player[playerid][AdminLevel] >= 4)
	    {
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerInterior(playerid, id);
			SetPlayerPos(playerid, x, y, z);
		}
	}
}
Reply
#2

What is this "mksl"?
x, y, z, are float and interior id is integer
pawn Код:
CMD:gotointeriorid( playerid, params[ ] )
{
    if( Player[ playerid ][ AdminLevel ] < 4)
    {
        new
            id, x, y, z;

        if( sscanf( params, "ifff", id, x, y, z ) ) return SendClientMessage( playerid, -1, "Usage: /gotointeriorid <Interior ID> <X> <Y> <Z>" );
        SetPlayerVirtualWorld( playerid, 0 );
        SetPlayerInterior( playerid, id );
        SetPlayerPos( playerid, x, y, z );
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Dwane
Посмотреть сообщение
What is this "mksl"?
x, y, z, are float and interior id is integer
pawn Код:
CMD:gotointeriorid( playerid, params[ ] )
{
    if( Player[ playerid ][ AdminLevel ] < 4)
    {
        new
            id, x, y, z;

        if( sscanf( params, "ifff", id, x, y, z ) ) return SendClientMessage( playerid, -1, "Usage: /gotointeriorid <Interior ID> <X> <Y> <Z>" );
        SetPlayerVirtualWorld( playerid, 0 );
        SetPlayerInterior( playerid, id );
        SetPlayerPos( playerid, x, y, z );
    }
    return 1;
}
This kind of worked, everytime I tried going to any interior, it messed up my game and said "Please stay within the world boundaries. Have a fix?
I did:
/gotointeriorid 17 -25.884498 -185.868988 1003.546875
Reply
#4

Bump
Reply
#5

Check your script for https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds
Reply
#6

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
That didnt fix the problem. Anything else I could do?
Reply
#7

SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);

in the command before you set their position n stuff, see if that works
Reply
#8

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);

in the command before you set their position n stuff, see if that works
Nope, didnt work.
Reply
#9

Bump
Reply
#10

Dwanes code, slightly modified:
pawn Код:
CMD:gotointeriorid( playerid, params[ ] )
{
    if( Player[ playerid ][ AdminLevel ] < 4)
    {
        new id, Float:x, Float:y, Float:z;
        if( sscanf( params, "ifff", id, x, y, z ) ) return SendClientMessage( playerid, -1, "Usage: /gotointeriorid <Interior ID> <X> <Y> <Z>" );
    SetPlayerVirtualWorld( playerid, 0 );
    SetPlayerInterior( playerid, id );
    SetPlayerPos( playerid, x, y, z );
    }
    return 1;
}
parsing the "f" specifier with a Float:, does it work now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)