Re-Bonsoir :-[
Voila, je peaufine un peu mon script de barrières, mais afin d'avoir des objets,
je dois charger un fichier *.map.
J'ai -en regardant un peux le wiki- trouvé la fonction
startResource
Voici mon arborescence
(/script est la base de mon script ::) )
(/yann est la resource à lancer)
/resource
/a
/b
/script
/yann
/yann.map
/meta.xml
/meta.xml
/main.lua
/main.lua.old
Voici mon script pour le moment
[spoiler]
function a (a)
outputChatBox ( "\n", getRootElement(), 255, 125, 0, true )
outputChatBox ( "Lancement des Scripts", getRootElement(), 255, 125, 0, true )
end
setTimer ( a, 50, 1)
function barrieres ( script)
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 )
outputChatBox ( "! Script Barriere [WAIT] !", getRootElement(), 0, 230, 255, true )
end
setTimer ( barrieres, 500, 1)
function b (b)
if ( barrieres) then
outputChatBox ( "! Script Barriere [OK] !", getRootElement(), 0, 255, 0, true )
else
outputChatBox ( "! Script Barriere [FAIL] !", getRootElement(), 255, 0, 0, true )
end
end
setTimer ( b, 1000, 1)
function loadMapFile ( filename )
startResource ( yann)
end
setTimer ( loadMapFile, 1500, 1)
function c (c)
if ( LoadMapFile) then
outputChatBox ( "! Map Yann [OK] !", getRootElement(), 0, 255, 0, true )
else
outputChatBox ( "! Map Yann [FAIL] !", getRootElement(), 255, 0, 0, true )
end
endsetTimer ( c, 2000, 1)
[/spoiler]
Donc mon problème est que j'obtien ce message d'erreur:
[2012-01-30 00:21:46] WARNING: script\main.lua:33: Bad argument @ 'startResource'
(J'ai mit la source du problème en rouge)
Et j'aimerais savoir, si vous ne sauriez pas me donner un petit
coup de patte...
Merci beaucoup pour votre aide...
CafeOLait