Liberty Unleashed
Scripting => Script Help => Topic started by: GuenosNoLife on January 24, 2013, 10:02:39 pm
-
Hi, I have problem for teleport to go aeroport
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!
-
Hi, I have problem for teleport to go aeroport
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?
-
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
-
Hi, I have problem for teleport to go aeroport
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
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)
-
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)
:)
-
@SugarD Thank's for code
@Svenko Thank's for Function
Lock. :)
-
@SugarD Thank's for code
@Svenko Thank's for Function
I think you meant that the other way around. :)