Вообще не срабатывает скрипт
<meta>
<info author="Sektor (c) Ivanov Vitaly" description="Testing mod..." version="1" type="gamemode" />
<include resource="spawnmanager" />
<include resource="freeroam" />
<file src="icons/zx.png"/>
<file src="m5.dff"/>
<file src="m5.txd"/>
<script src="main_s.lua"type="server"/>
<script src="main_c.lua"type="client"/>
</meta>
main_c.lua
------------------------
function fanFunction()
bindKey (source,"forwards","down",
function(player,key,state)
outputChatBox (getPlayerName (player) .. "#FFFF00 thinks Ransom is cool.",root,255,255,0,true)
end
)
end
addEventHandler ("onPlayerLogin",root,fanFunction)
function ReplaceObject ( )
txd = engineLoadTXD( "M5.txd" )
dff = engineLoadDFF( "M5.dff", 0 ) --modelid is everytime 0, when you replace no vehicle
engineImportTXD( txd, 356 )
engineReplaceModel( dff, 356 )-- replace the model at least
end
addEvent ( "replaceObj", true )
addEventHandler ( "replaceObj", root, ReplaceObject )
main_s.lua
function spawn(source)
setPedStat(source, 24, 999.0)
setPedStat(source, 21, 0.0)
setPedStat(source, 23, 0.0)
setPedStat(source, 27, 0.0)
setPedStat(source, 165, 10)
spawnPlayer(source, 0.0, 0.0, 0.0, 90.0, 1)
fadeCamera(source, true)
setCameraTarget(source, source)
showChat(source, true)
setElementPosition(source, 2316.1623, 49.6955, 26.482) --put v bomjatnik
--setElementModel(player, 0)
setElementFrozen(source, false)
end
function explosionOnSpawn(source)
setPedStat(source, 22, 0)
end
addEventHandler ( "onClientPlayerSpawn", root, explosionOnSpawn )
addEventHandler("onPlayerJoin", root,
function()
spawn(source)
end
)
function ReplaceCommand ( )
triggerClientEvent( "replaceObj", root, replaceObj )
end
addCommandHandler( "replace", ReplaceCommand )
-------------- если игрок вуриблся ----------------------
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawn, 1800, 1, source)
end
)