SA-MP Forums Archive
Go to any interior command? - 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: Go to any interior command? (/showthread.php?tid=313001)



Go to any interior command? - Nuke547 - 23.01.2012

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



Re: Go to any interior command? - Konstantinos - 23.01.2012

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



Re: Go to any interior command? - Nuke547 - 23.01.2012

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


Re: Go to any interior command? - Nuke547 - 24.01.2012

Bump


Re: Go to any interior command? - [ABK]Antonio - 24.01.2012

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


Re: Go to any interior command? - Nuke547 - 24.01.2012

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


Re: Go to any interior command? - [ABK]Antonio - 24.01.2012

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

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


Re: Go to any interior command? - Nuke547 - 24.01.2012

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.


Re: Go to any interior command? - Nuke547 - 24.01.2012

Bump


Re: Go to any interior command? - Babul - 24.01.2012

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?