-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeaa1ae
commit b40b0a7
Showing
3 changed files
with
64 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,74 @@ | ||
addCommandHandler("testveh", function(thePlayer, cmd, id) | ||
id = tonumber(id) | ||
if not id then | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>") | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>", thePlayer) | ||
end | ||
local x,y,z = getElementPosition(thePlayer) | ||
local rx,ry,rz = getElementRotation(thePlayer) | ||
local veh = createVehicle(id, x, y, z, rx, ry, rz) | ||
if not veh then | ||
return outputChatBox("Failed to create vehicle.") | ||
local element = createVehicle(id, x, y, z, rx, ry, rz) | ||
if not element then | ||
return outputChatBox("Failed to create vehicle.", thePlayer) | ||
end | ||
setElementDimension(veh, getElementDimension(thePlayer)) | ||
setElementInterior(veh, getElementInterior(thePlayer)) | ||
setElementDimension(element, getElementDimension(thePlayer)) | ||
setElementInterior(element, getElementInterior(thePlayer)) | ||
setElementPosition(thePlayer, x+2, y, z) | ||
outputChatBox("Vehicle created with ID "..id..".") | ||
outputChatBox("Vehicle created with ID "..id..".", thePlayer) | ||
end, false, false) | ||
|
||
addCommandHandler("testobj", function(thePlayer, cmd, id) | ||
id = tonumber(id) | ||
if not id then | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>") | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>", thePlayer) | ||
end | ||
local x,y,z = getElementPosition(thePlayer) | ||
local rx,ry,rz = getElementRotation(thePlayer) | ||
local veh = createObject(id, x, y, z, rx, ry, rz) | ||
if not veh then | ||
return outputChatBox("Failed to create object.") | ||
local element = createObject(id, x, y, z, rx, ry, rz) | ||
if not element then | ||
return outputChatBox("Failed to create object.", thePlayer) | ||
end | ||
setElementDimension(veh, getElementDimension(thePlayer)) | ||
setElementInterior(veh, getElementInterior(thePlayer)) | ||
setElementDimension(element, getElementDimension(thePlayer)) | ||
setElementInterior(element, getElementInterior(thePlayer)) | ||
setElementPosition(thePlayer, x+2, y, z) | ||
outputChatBox("Object created with ID "..id..".") | ||
outputChatBox("Object created with ID "..id..".", thePlayer) | ||
end, false, false) | ||
|
||
addCommandHandler("testped", function(thePlayer, cmd, id) | ||
id = tonumber(id) | ||
if not id then | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>") | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>", thePlayer) | ||
end | ||
local x,y,z = getElementPosition(thePlayer) | ||
local rx,ry,rz = getElementRotation(thePlayer) | ||
local veh = createPed(id, x, y, z, rz) | ||
if not veh then | ||
return outputChatBox("Failed to create ped.") | ||
local _,_,rz = getElementRotation(thePlayer) | ||
local element = createPed(id, x, y, z, rz) | ||
if not element then | ||
return outputChatBox("Failed to create ped.", thePlayer) | ||
end | ||
setElementDimension(veh, getElementDimension(thePlayer)) | ||
setElementInterior(veh, getElementInterior(thePlayer)) | ||
setElementDimension(element, getElementDimension(thePlayer)) | ||
setElementInterior(element, getElementInterior(thePlayer)) | ||
setElementPosition(thePlayer, x+2, y, z) | ||
outputChatBox("Ped created with ID "..id..".") | ||
outputChatBox("Ped created with ID "..id..".", thePlayer) | ||
end, false, false) | ||
|
||
addCommandHandler("testskin", function(thePlayer, cmd, id) | ||
id = tonumber(id) | ||
if not id then | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>") | ||
return outputChatBox("Syntax: /"..cmd.." <default or custom id>", thePlayer) | ||
end | ||
if not setElementModel(thePlayer, id) then | ||
return outputChatBox("Failed to set skin.") | ||
return outputChatBox("Failed to set skin.", thePlayer) | ||
end | ||
outputChatBox("Skin set to ID "..id..".", thePlayer) | ||
end, false, false) | ||
|
||
addCommandHandler("testspawn", function(thePlayer) | ||
local dataName = getCustomModelDataKey("player") | ||
local x,y,z = getElementPosition(thePlayer) | ||
local _, _, rz = getElementRotation(thePlayer) | ||
local customModel = tonumber(getElementData(thePlayer, dataName)) | ||
spawnPlayer(thePlayer, x,y,z, rz, getElementModelMTA(thePlayer), getElementInterior(thePlayer), getElementDimension(thePlayer)) | ||
setElementData(thePlayer, dataName, nil) | ||
if customModel then | ||
setElementData(thePlayer, dataName, customModel) | ||
end | ||
outputChatBox("Skin set to ID "..id..".") | ||
outputChatBox("Player spawned with skin "..( customModel or getElementModelMTA(thePlayer) )..".", thePlayer) | ||
end, false, false) |