1
Scripting MTA [Lua Center] / Re : [DISCUSSION](RP) Gestion de métier...
« le: 03 Février 2012, 08:42:37 »
Merci ;-)
Je vais commencer aujourd'hui...
Je vais commencer aujourd'hui...
Cette section vous permet de consulter les contributions (messages, sujets et fichiers joints) d'un utilisateur. Vous ne pourrez voir que les contributions des zones auxquelles vous avez accès.
function loadyann ()
local maVariable = getResourceFromName ( "mapyann" ) -- on récupère la ressource qui s'appelle mapyann dans maVariable
local success = startResource( maVariable ) -- on lance la ressource ET on récupère la valeur renvoyée par la fonction dans success
if ( success == true ) then
outputChatBox ( "! Map Yann [OK] !", getRootElement(), 0, 255, 0, true )
else
outputChatBox ( "! Map Yann [FAIL] !", getRootElement(), 255, 0, 0, true )
end
end
setTimer( loadyann, 1500, 1)
<meta>
<info author="CafeOLait" version="0.0.1" type="script" name="Fence Script" description="This script ad fences in the game." />
<script src="main.lua" type="server" />
<map src="yann/yann.map" />
</meta>
startResource
/resource
/a
/b
/script
/yann
/yann.map
/meta.xml
/meta.xml
/main.lua
/main.lua.old
[2012-01-30 00:21:46] WARNING: script\main.lua:33: Bad argument @ 'startResource'
gatea = createObject ( 969, 1397.1, 2701.6, 9.8, 0, 0, 270 )
gateb = createObject ( 969, 1397.1, 2693.6, 9.8, 0, 0, 270 )
gatec = createObject ( 987, 2294.6, 2503.2, 2.3, 0, 0, 274 )
gated = createObject ( 987, 2319.8, 2440.5, 2.3, 0, 0, 90 )
gateea = createObject ( 987, 2245.6, 2481.5, 14, 0, 0, 270 )
gateeb = createObject ( 987, 2245.6, 2469.5, 14, 0, 0, 270 )
gateec = createObject ( 987, 2245.6, 2457.5, 14, 0, 0, 270 )
gateed = createObject ( 987, 2245.6, 2445.5, 14, 0, 0, 270 )
arene = createObject ( 17018, -1417, 363, 25, 0, 0, 270 )
airport = createObject ( 987, -1549.8, -426, 5, 0, 0, 316 )
arene2 = createObject ( 3277, -1426.8, 368.4, 26.1, 0, 0, 0 )
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel
function ouvrirdepot(commandName, posX, posY, posZ)
moveObject ( gatea, 15000, 1397.1, 2689, 9.8 )
moveObject ( gateb, 15000, 1397.1, 2689, 9.8 )
end
addCommandHandler("od", ouvrirdepot)
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel
function fermerdepot(commandName, posX, posY, posZ)
moveObject ( gatea, 15000, 1397.1, 2701.6, 9.8 )
moveObject ( gateb, 15000, 1397.1, 2693.6, 9.8 )
end
addCommandHandler("fd", fermerdepot)
function ouvrirairport(commandName, posX, posY, posZ)
moveObject ( airport, 15000, -1557.5, -418, 5 )
end
addCommandHandler("oa", ouvrirairport)
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel
function fermerairport(commandName, posX, posY, posZ)
moveObject ( airport, 15000, -1549.8, -426, 5 )
end
addCommandHandler("fa", fermerairport)
function op(commandName, posX, posY, posZ)
moveObject ( gatec, 10000, 2294.6, 2503.2, 7 )
moveObject ( gated, 10000, 2319.8, 2440.5, 8 )
end
addCommandHandler("op", op)
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel
function fp(commandName, posX, posY, posZ)
moveObject ( gatec, 10000, 2294.6, 2503.2, 2.3 )
moveObject ( gated, 10000, 2319.8, 2440.5, 2.3 )
end
addCommandHandler("fp", fp)
function secure(commandName, posX, posY, posZ)
moveObject ( gateea, 10000, 2245.6, 2481.5, 9.8 )
moveObject ( gateeb, 10000, 2245.6, 2469.5, 9.8 )
moveObject ( gateec, 10000, 2245.6, 2457.5, 9.8 )
moveObject ( gateed, 10000, 2245.6, 2445.5, 9.8 )
end
addCommandHandler("secure", secure)
function unsecure(commandName, posX, posY, posZ)
moveObject ( gateea, 10000, 2245.6, 2481.5, 14 )
moveObject ( gateeb, 10000, 2245.6, 2469.5, 14 )
moveObject ( gateec, 10000, 2245.6, 2457.5, 14 )
moveObject ( gateed, 10000, 2245.6, 2445.5, 14 )
end
addCommandHandler("unsecure", unsecure)
function up(commandName, posX, posY, posZ)
moveObject ( arene, 30000, -1417, 363, 32 )
moveObject ( arene2, 30000, -1426.8, 368.4, 36.8 )
end
addCommandHandler("up", up)
function down(commandName, posX, posY, posZ)
moveObject ( arene, 30000, -1417, 363, 25 )
moveObject ( arene2, 30000, -1426.8, 368.4, 26.1 )
end
addCommandHandler("down", down)
/entrer01Il me met l'erreur: WARNING: script\main.lua:3: Bad argument @ 'setElementRotation'