Old 03-28-2009   #1
[LCK]G0LdzEr0
Registered User
 
Join Date: Mar 2009
Location: Poland, Częstochowa
Posts: 13
[LCK]G0LdzEr0 is an unknown quantity at this point
/goto Command Help

Can anyone write there script for "/goto" command? I'm newbie in lua scripting...

edit: OK rappo

Last edited by [LCK]G0LdzEr0; 03-28-2009 at 02:05 PM..
[LCK]G0LdzEr0 is offline   Reply With Quote
Old 03-28-2009   #2
rappo
Professional Dumbass
 
rappo's Avatar
 
Join Date: Aug 2003
Location: Los Angeles
Posts: 6,862
rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.
G0ldzEr0, please keep topics to their original discussion. If you want to ask your own question about something unrelated, please make your own topic in the forum. I moved this post to its own thread because it is unrelated to tuntis's suggestions.
rappo is offline   Reply With Quote
Old 03-28-2009   #3
tuntis
tuntis.net
 
Join Date: Jan 2009
Location: Finland
Posts: 31
tuntis is on a distinguished roadtuntis is on a distinguished roadtuntis is on a distinguished road
Code:
function Teleport(PlayerID,Other)
	local X, Y, Z, Interior
	if Other == nil then 
		X, Y, Z = getPlayerPos(PlayerID) 
		Interior = getPlayerInterior(PlayerID)
	else 
		X, Y, Z = getPlayerPos(Other)
		Interior = getPlayerInterior(Other)
	end
	if isPlayerInAnyVehicle(PlayerID) == 0 then
		setPlayerPos(PlayerID,X,Y,Z)
	else
        setVehiclePos(getPlayerVehicleID(PlayerID),X,Y,Z)
	end
	setPlayerInterior(PlayerID,Interior)
end

addCommand("goto","Teleport")
From an early test server script, most likely the same that's still running on Ankeborg's.
tuntis is offline   Reply With Quote
Old 03-28-2009   #4
Relax
Public Enemy
Newbie Member
 
Relax's Avatar
 
Join Date: Mar 2009
Location: CA, Beverly Hills
Posts: 1
Relax is an unknown quantity at this point
I think so will be more rightly

Code:
function Teleport(PlayerID,TargetID)
	if isPlayerConnected(TargetID) == 0 then outputChatBox(PlayerID,"Error: That player is not connected.",255,0,0,255) return end
	if strval(TargetID) == strval(PlayerID) then outputChatBox(PlayerID,"Error: You can not send this command for himself.",255,0,0,255) return end
	local X, Y, Z, Interior
	if TargetID == nil then 
		X, Y, Z = getPlayerPos(PlayerID) 
		Interior = getPlayerInterior(PlayerID)
	else 
		X, Y, Z = getPlayerPos(TargetID)
		Interior = getPlayerInterior(TargetID)
	end
	if isPlayerInAnyVehicle(PlayerID) == 0 then
		setPlayerPos(PlayerID,X,Y,Z)
	else
        setVehiclePos(getPlayerVehicleID(PlayerID),X,Y,Z)
	end
	setPlayerInterior(PlayerID,Interior)
end

addCommand("goto","Teleport")

Last edited by Relax; 03-28-2009 at 02:46 PM..
Relax is offline   Reply With Quote
Old 03-28-2009   #5
[LCK]G0LdzEr0
Registered User
 
Join Date: Mar 2009
Location: Poland, Częstochowa
Posts: 13
[LCK]G0LdzEr0 is an unknown quantity at this point
Thanks a lot guys
[LCK]G0LdzEr0 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -6. The time now is 03:58 PM.