Liberty Unleashed

Scripting => Script Help => Topic started by: GuenosNoLife on January 24, 2013, 10:02:39 pm

Title: Problem teleport
Post by: GuenosNoLife on January 24, 2013, 10:02:39 pm
Hi, I have problem for teleport to go aeroport

Quote
if( cmd == "aeroport" )
{
       player.Pos = Vector( -1498.3, -915.4, 11.11 );
}


I use a location with "mypos", Screen ERROR :
(http://bildberg.eu/495UJHN8.png)

Thank's all!
Title: Re: Problem teleport
Post by: SugarD on January 24, 2013, 10:08:44 pm
Hi, I have problem for teleport to go aeroport

Quote
if( cmd == "aeroport" )
{
       player.Pos = Vector( -1498.3, -915.4, 11.11 );
}


I use a location with "mypos", Screen ERROR :
([url]http://bildberg.eu/495UJHN8.png[/url])

Thank's all!

Is that under onPlayerCommand?
Title: Re: Problem teleport
Post by: SugarD on January 24, 2013, 10:11:47 pm
Code: [Select]
if ( szCommand == "airport" )
{
if ( pPlayer.Spawned )
{
if ( !szParams )
{
local v = pPlayer.Pos;
v.x = -1566;
v.y = -951;
v.z = 11;
pPlayer.Pos = v;
        MessagePlayer( "*PM* You teleported to: /" + szCommand, pPlayer, Colour( 0, 255, 0 ) );
}
else MessagePlayer( "*PM* Error: Argument is not needed for this command", pPlayer, Colour( 255, 0, 0 ) );
}
else MessagePlayer( "*PM* Error: You are not spawned. Press CTRL to spawn", pPlayer, Colour( 255, 0, 0 ) );
}
This is the one used on lolmortuary so please just change messages. :)
I see you learned Squirrel from the IV:MP tutorial. :D
Title: Re: Problem teleport
Post by: GuenosNoLife on January 24, 2013, 10:18:33 pm
Hi, I have problem for teleport to go aeroport

Quote
if( cmd == "aeroport" )
{
       player.Pos = Vector( -1498.3, -915.4, 11.11 );
}


I use a location with "mypos", Screen ERROR :
([url]http://bildberg.eu/495UJHN8.png[/url])

Thank's all!

Is that under onPlayerCommand?


Oh I forgot a function! I'm stupid lol

Code: [Select]
if ( szCommand == "airport" )
{
if ( pPlayer.Spawned )
{
if ( !szParams )
{
local v = pPlayer.Pos;
v.x = -1566;
v.y = -951;
v.z = 11;
pPlayer.Pos = v;
        MessagePlayer( "*PM* You teleported to: /" + szCommand, pPlayer, Colour( 0, 255, 0 ) );
}
else MessagePlayer( "*PM* Error: Argument is not needed for this command", pPlayer, Colour( 255, 0, 0 ) );
}
else MessagePlayer( "*PM* Error: You are not spawned. Press CTRL to spawn", pPlayer, Colour( 255, 0, 0 ) );
}
This is the one used on lolmortuary so please just change messages. :)

Thank's but what is function ? I write : function onPlayerCommand( player, cmd )

Server say error :
(http://bildberg.eu/FfZ7mbts.png)
Title: Re: Problem teleport
Post by: SugarD on January 24, 2013, 10:19:28 pm
What tutorial?

http://wiki.iv-multiplayer.com/wiki/index.php?title=Scripting_Tutorials (http://wiki.iv-multiplayer.com/wiki/index.php?title=Scripting_Tutorials)

They use "szCommand" too. :)

Thank's but what is function ? I write : function onPlayerCommand( player, cmd )

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Events/Player/onPlayerCommand (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Events/Player/onPlayerCommand)

:)
Title: Re: Problem teleport
Post by: GuenosNoLife on January 25, 2013, 06:13:13 am
@SugarD Thank's for code
@Svenko Thank's for Function

Lock. :)
Title: Re: Problem teleport
Post by: SugarD on January 25, 2013, 06:35:08 am
@SugarD Thank's for code
@Svenko Thank's for Function
I think you meant that the other way around. :)