Author Topic: Problem teleport  (Read 2306 times)

GuenosNoLife

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +12/-14
    • View Profile
Problem teleport
« 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 :


Thank's all!
Little back... Maybe not maybe yes...

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 816
  • Karma: +37/-78
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Problem teleport
« Reply #1 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 :


Thank's all!

Is that under onPlayerCommand?

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 816
  • Karma: +37/-78
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Problem teleport
« Reply #2 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

GuenosNoLife

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +12/-14
    • View Profile
Re: Problem teleport
« Reply #3 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 :


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 :
Little back... Maybe not maybe yes...

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 816
  • Karma: +37/-78
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience

GuenosNoLife

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +12/-14
    • View Profile
Re: Problem teleport
« Reply #5 on: January 25, 2013, 06:13:13 am »
@SugarD Thank's for code
@Svenko Thank's for Function

Lock. :)
Little back... Maybe not maybe yes...

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 816
  • Karma: +37/-78
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Problem teleport
« Reply #6 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. :)

 

© Liberty Unleashed Team.