Jump to content

Franc[e]sco

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by Franc[e]sco

  1. Ok, this time as some in the forums suggested i moved the objects from the lua script to the .map n fixed some errors... when i join after the loading screens it says fatal error and the server's log is: [20:26:22] CONNECT: Franc[e]sco connected (IP: CENSORED) [20:26:32] JOIN: Franc[e]sco joined the game (IP: CENSORED) [20:26:32] QUIT: Franc[e]sco left the game [Quit] [20:26:32] ERROR: Invalid element specified. [20:26:34] WARNING: server.lua: Bad 'player' pointer @ 'spawnPlayer'(1) - Line: 4 [20:26:34] WARNING: server.lua: Bad 'player' pointer @ 'fadeCamera'(1) - Line: 5 [*]simpledm.zip [*]-- server.lua -- Simple DM - coded by Franc[e]sco --//--------------------------------------------------------------------------// function spawnThePlayer (playerid) spawnPlayer(playerid, 0.0,0.0,5.0) fadeCamera(playerid, true) end --//--------------------------------------------------------------------------// function onMapStartHandler (startedMap) local playersToSpawn = getElementsByType ("player") for k,player in ipairs ( playersToSpawn ) do spawnThePlayer( player ) end end addEventHandler ( "onGamemodeMapStart", getRootElement (), onMapStartHandler ) --//--------------------------------------------------------------------------// function onPlayerConnect () local playerName = getClientName(source) outputChatBox("Welcome, " .. playerName .. ", this server is actually running Simple Deathmatch by Franc[e]sco", source) setTimer(spawnThePlayer, 1500, 1, source) end addEventHandler("onPlayerJoin", getRootElement (), onPlayerConnect) --//--------------------------------------------------------------------------// function onPlayerDeath (ammo, attacker, weapon, bodypart) outputChatBox("You died! Please wait 10 seconds to respawn", source) setTimer(spawnThePlayer, 10000, 1, source) end addEventHandler("onPlayerWasted", getRootElement (), onPlayerDeath) --//--------------------------------------------------------------------------// function OnPlayerSpawn (posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) playSoundFrontEnd(source, 16) local effectivespawns = spawnPoints-1 local rand = randInt(0, effectivespawns) setElementPosition(source, rSpawnPoints[rand].x, rSpawnPoints[rand].y, rSpawnPoints[rand].z + 1) setPlayerRotation(source, rSpawnPoints[rand].f) giveWeapon(source, rSpawnPoints[rand].fist, 1) giveWeapon(source, rSpawnPoints[rand].melee, 1) giveWeapon(source, rSpawnPoints[rand].handgun, 200) giveWeapon(source, rSpawnPoints[rand].shotgun, 20) giveWeapon(source, rSpawnPoints[rand].smgun, 5000) giveWeapon(source, rSpawnPoints[rand].mgun, 5000) giveWeapon(source, rSpawnPoints[rand].rifle, 15) giveWeapon(source, rSpawnPoints[rand].heavy, 5) giveWeapon(source, rSpawnPoints[rand].projectile, 5) giveWeapon(source, rSpawnPoints[rand].special1, 30) giveWeapon(source, rSpawnPoints[rand].gift, 1) giveWeapon(source, rSpawnPoints[rand].special2, 1) giveWeapon(source, rSpawnPoints[rand].detonator, 1) end addEventHandler ( "onPlayerSpawn", getRootElement(), OnPlayerSpawn ) --//--------------------------------------------------------------------------// [*]bloodybox.zip [*]-- bloodybox.map <map mod="deathmatch" version="1.0"> <meta> <author>Franc[e]sco</author> <version>0.1</version> <name>Bloody box</name> <description>Crazy deathmatch</description> </meta> <object name="object0" model="3983" posX="3404.731201" posY="-1526.936523" posZ="23.624731" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object5" model="3983" posX="3387.905518" posY="-1527.186768" posZ="32.624733" rotX="0.0000" rotY="90.2409" rotZ="0.0000" /> <object name="object5" model="3983" posX="3420.326904" posY="-1521.111694" posZ="32.624733" rotX="0.0000" rotY="90.2409" rotZ="182.0965" /> <object name="object5" model="3983" posX="3408.901611" posY="-1503.010376" posZ="32.624733" rotX="0.0000" rotY="91.1003" rotZ="272.3375" /> <object name="object5" model="3983" posX="3408.926514" posY="-1547.310669" posZ="32.624733" rotX="0.0000" rotY="91.1003" rotZ="90.2409" /> <object name="object5" model="3983" posX="3404.731201" posY="-1526.936523" posZ="51.374733" rotX="0.0000" rotY="180.4820" rotZ="0.0000" /> <object name="object6" model="3983" posX="3404.731201" posY="-1542.187012" posZ="40.549725" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object7" model="3983" posX="3404.955322" posY="-1541.737305" posZ="36.499649" rotX="0.0000" rotY="180.4820" rotZ="0.0000" /> <object name="object8" model="3399" posX="3411.878662" posY="-1503.062012" posZ="24.215816" rotX="0.0000" rotY="0.0000" rotZ="188.6717" /> <object name="object9" model="3399" posX="3400.371826" posY="-1504.812500" posZ="28.765804" rotX="0.0000" rotY="0.0000" rotZ="188.6717" /> <object name="object50" model="3399" posX="3400.294189" posY="-1507.640747" posZ="32.965858" rotX="0.0000" rotY="0.0000" rotZ="0.5587" /> <object name="object51" model="969" posX="3391.658691" posY="-1500.882324" posZ="31.092058" rotX="266.3214" rotY="3.4377" rotZ="282.9689" /> <object name="object52" model="3399" posX="3409.544189" posY="-1507.640747" posZ="36.240875" rotX="0.0000" rotX="0.0000" rotZ="0.5587" /> <object name="object53" model="969" posX="3414.442871" posY="-1507.829468" posZ="38.517120" rotX="266.3214" rotX="0.0000" rotZ="270.0000" /> <object name="object54" model="925" posX="3420.059814" posY="-1540.482178" posZ="22.689754" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object55" model="925" posX="3415.954346" posY="-1537.199219" posZ="22.663198" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object56" model="925" posX="3406.375977" posY="-1536.315063" posZ="22.663198" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object57" model="925" posX="3401.902100" posY="-1534.704834" posZ="22.705301" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object58" model="925" posX="3401.406494" posY="-1525.278442" posZ="22.742367" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object59" model="925" posX="3403.253418" posY="-1523.866577" posZ="22.720238" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object50" model="925" posX="3394.223145" posY="-1514.075562" posZ="22.904266" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object51" model="944" posX="3413.396973" posY="-1526.512817" posZ="22.486080" rotX="0.0000" rotY="0.0000" rotZ="33.7500" /> <object name="object52" model="944" posX="3405.102539" posY="-1517.788452" posZ="22.535776" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object53" model="944" posX="3411.190430" posY="-1512.399536" posZ="22.486080" rotX="0.0000" rotY="0.0000" rotZ="22.5000" /> <object name="object54" model="931" posX="3411.395264" posY="-1548.199219" posZ="22.677711" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object55" model="931" posX="3411.469238" posY="-1543.873779" posZ="22.663198" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object56" model="931" posX="3411.449707" posY="-1545.996338" posZ="22.665375" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object57" model="931" posX="3393.603271" posY="-1548.425537" posZ="22.683208" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object58" model="931" posX="3393.624268" posY="-1543.861694" posZ="22.694653" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object59" model="931" posX="3393.605713" posY="-1546.098633" posZ="22.693037" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object50" model="931" posX="3392.800293" posY="-1526.011597" posZ="22.864033" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object51" model="931" posX="3390.443359" posY="-1531.249023" posZ="22.881367" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object52" model="931" posX="3392.669922" posY="-1527.212036" posZ="22.869278" rotX="0.0000" rotY="0.0000" rotZ="90.0000" /> <object name="object53" model="1685" posX="3396.818848" posY="-1501.971680" posZ="22.451813" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object54" model="1685" posX="3396.824707" posY="-1502.770630" posZ="22.478695" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object55" model="1685" posX="3396.857422" posY="-1502.978760" posZ="22.480766" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object56" model="1685" posX="3396.781982" posY="-1503.509644" posZ="22.487837" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object57" model="1685" posX="3396.928223" posY="-1503.794189" posZ="22.489529" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object58" model="1685" posX="3396.919922" posY="-1504.314209" posZ="22.495720" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object59" model="1685" posX="3396.972168" posY="-1509.989990" posZ="39.314728" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object50" model="1685" posX="3396.887207" posY="-1510.801270" posZ="39.300499" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object51" model="1685" posX="3396.930420" posY="-1512.523071" posZ="39.306656" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object52" model="1685" posX="3412.490723" posY="-1509.977539" posZ="39.330223" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object53" model="1685" posX="3412.512207" posY="-1511.089355" posZ="39.326435" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object54" model="1685" posX="3412.515625" posY="-1512.690552" posZ="39.321869" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object55" model="1685" posX="3398.325684" posY="-1547.600708" posZ="39.596134" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object56" model="1685" posX="3398.283691" posY="-1546.101807" posZ="39.388889" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object57" model="1685" posX="3398.431396" posY="-1544.215088" posZ="39.399426" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object58" model="1685" posX="3414.454590" posY="-1546.656494" posZ="39.276287" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object59" model="1685" posX="3414.440186" posY="-1548.381226" posZ="39.276287" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object50" model="1685" posX="3414.484131" posY="-1544.940674" posZ="39.276287" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object51" model="2567" posX="3396.681641" posY="-1533.894531" posZ="40.630146" rotX="0.0000" rotY="0.0000" rotZ="33.7500" /> <object name="object52" model="2567" posX="3409.271240" posY="-1534.916748" posZ="40.453888" rotX="0.0000" rotY="0.0000" rotZ="348.7500" /> <object name="object53" model="2567" posX="3412.967041" posY="-1522.562744" posZ="40.453888" rotX="0.0000" rotY="0.0000" rotZ="11.2500" /> <object name="object54" model="2567" posX="3393.853516" posY="-1520.749268" posZ="40.646645" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object55" model="944" posX="3403.388672" posY="-1529.018799" posZ="39.502983" rotX="0.0000" rotY="0.0000" rotZ="0.0000" /> <object name="object56" model="944" posX="3390.986084" posY="-1537.586670" posZ="39.653366" rotX="0.0000" rotY="0.0000" rotZ="348.7500" /> <object name="object57" model="944" posX="3418.504395" posY="-1525.017090" posZ="39.411076" rotX="0.0000" rotY="0.0000" rotZ="348.7500" /> <object name="object58" model="944" posX="3394.825439" posY="-1509.170898" posZ="31.884966" rotX="0.0000" rotY="0.0000" rotZ="6.7982" /> </map> [*]-- script.lua function mapLoad(name) spawnPoints = 16 rSpawnPoints = { {x=3421.267090, y=-1546.364136, z=39.248020, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3407.545898, y=-1546.580078, z=39.186665, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.096191, y=-1547.516724, z=39.454590, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3420.681641, y=-1510.488159, z=39.239620, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3404.905029, y=-1511.002686, z=39.237484, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.964844, y=-1510.464355, z=39.271309, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3419.712402, y=-1502.146362, z=22.285946, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3405.734131, y=-1503.052856, z=22.277327, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.575195, y=-1503.615845, z=22.485300, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3386.568115, y=-1546.704590, z=22.263044, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3399.408203, y=-1546.596802, z=22.269600, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3421.499512, y=-1547.485474, z=22.283976, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3393.754883, y=-1505.973511, z=31.660557, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3400.283936, y=-1507.614502, z=33.657486, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3400.341064, y=-1504.529297, z=29.457432, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3406.293213, y=-1507.656006, z=35.860611, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0} } end --//--------------------------------------------------------------------------// addEventHandler("onResourceStart", getRootElement(), mapLoad)
  2. Yea i know it's slower but i'll keep it as a script cause its faster to write... btw could u explain why it doesnt work?
  3. I tryed to improve your random spawn system and implement it in my gamemode but i dunno whats wrong... when i join the game i get fatal error, and when i go back to the server's window it says: Here's the gamemode code: -- Simple DM - coded by Franc[e]sco --//--------------------------------------------------------------------------// function spawnThePlayer (thePlayer) spawnPlayer(thePlayer, 0.0,0.0,5.0) fadeCamera(thePlayer, true) end --//--------------------------------------------------------------------------// function onMapStartHandler ( startedMap ) local playersToSpawn = getElementsByType ("player") for k,player in ipairs ( playersToSpawn ) do spawnThePlayer( player ) end end addEventHandler ( "onGamemodeMapStart", getRootElement (), onMapStartHandler ) --//--------------------------------------------------------------------------// function onPlayerConnect (thePlayer) local playerName = getClientName(source) outputChatBox("Welcome, " .. playerName .. ", this server is actually running Simple Deathmatch by Franc[e]sco", source) setTimer(spawnThePlayer, 1500, 1, source) end addEventHandler("onPlayerJoin", getRootElement (), onPlayerConnect) --//--------------------------------------------------------------------------// function onPlayerDeath (ammo, attacker, weapon, bodypart) outputChatBox("You died! Please wait 10 seconds to respawn", source) setTimer(spawnThePlayer, 10000, 1, source) end addEventHandler("onPlayerWasted", getRootElement (), onPlayerDeath) --//--------------------------------------------------------------------------// function OnPlayerSpawn (posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) playSoundFrontEnd(source, 16) local effectivespawns = spawnPoints-1 local rand = randInt(0, effectivespawns) setElementPosition(source, rSpawnPoints[rand].x, rSpawnPoints[rand].y, rSpawnPoints[rand].z + 1) setPlayerRotation(source, rSpawnPoints[rand].f) giveWeapon(source, rSpawnPoints[rand].fist, 1) giveWeapon(source, rSpawnPoints[rand].melee, 1) giveWeapon(source, rSpawnPoints[rand].handgun, 200) giveWeapon(source, rSpawnPoints[rand].shotgun, 20) giveWeapon(source, rSpawnPoints[rand].smgun, 5000) giveWeapon(source, rSpawnPoints[rand].mgun, 5000) giveWeapon(source, rSpawnPoints[rand].rifle, 15) giveWeapon(source, rSpawnPoints[rand].heavy, 5) giveWeapon(source, rSpawnPoints[rand].projectile, 5) giveWeapon(source, rSpawnPoints[rand].special1, 30) giveWeapon(source, rSpawnPoints[rand].gift, 1) giveWeapon(source, rSpawnPoints[rand].special2, 1) giveWeapon(source, rSpawnPoints[rand].detonator, 1) end addEventHandler ( "onPlayerSpawn", getRootElement(), OnPlayerSpawn ) --//--------------------------------------------------------------------------// and here's the map code (only a lua scrpt, no .map) function mapLoad(name) createObject(3983, 3404.731201, -1526.936523, 23.624731, 0.0000, 0.0000, 0.0000) createObject(3983, 3387.905518, -1527.186768, 32.624733, 0.0000, 90.2409, 0.0000) createObject(3983, 3420.326904, -1521.111694, 32.624733, 0.0000, 90.2409, 182.0965) createObject(3983, 3408.901611, -1503.010376, 32.624733, 0.0000, 91.1003, 272.3375) createObject(3983, 3408.926514, -1547.310669, 32.624733, 0.0000, 91.1003, 90.2409) createObject(3983, 3404.731201, -1526.936523, 51.374733, 0.0000, 180.4820, 0.0000) createObject(3983, 3404.731201, -1542.187012, 40.549725, 0.0000, 0.0000, 0.0000) createObject(3983, 3404.955322, -1541.737305, 36.499649, 0.0000, 180.4820, 0.0000) createObject(3399, 3411.878662, -1503.062012, 24.215816, 0.0000, 0.0000, 188.6717) createObject(3399, 3400.371826, -1504.812500, 28.765804, 0.0000, 0.0000, 188.6717) createObject(3399, 3400.294189, -1507.640747, 32.965858, 0.0000, 0.0000, 0.5587) createObject(969, 3391.658691, -1500.882324, 31.092058, 266.3214, 3.4377, 282.9689) createObject(3399, 3409.544189, -1507.640747, 36.240875, 0.0000, 0.0000, 0.5587) createObject(969, 3414.442871, -1507.829468, 38.517120, 266.3214, 0.0000, 270.0000) createObject(925, 3420.059814, -1540.482178, 22.689754, 0.0000, 0.0000, 0.0000) createObject(925, 3415.954346, -1537.199219, 22.663198, 0.0000, 0.0000, 0.0000) createObject(925, 3406.375977, -1536.315063, 22.663198, 0.0000, 0.0000, 0.0000) createObject(925, 3401.902100, -1534.704834, 22.705301, 0.0000, 0.0000, 0.0000) createObject(925, 3401.406494, -1525.278442, 22.742367, 0.0000, 0.0000, 0.0000) createObject(925, 3403.253418, -1523.866577, 22.720238, 0.0000, 0.0000, 0.0000) createObject(925, 3394.223145, -1514.075562, 22.904266, 0.0000, 0.0000, 0.0000) createObject(944, 3413.396973, -1526.512817, 22.486080, 0.0000, 0.0000, 33.7500) createObject(944, 3405.102539, -1517.788452, 22.535776, 0.0000, 0.0000, 0.0000) createObject(944, 3411.190430, -1512.399536, 22.486080, 0.0000, 0.0000, 22.5000) createObject(931, 3411.395264, -1548.199219, 22.677711, 0.0000, 0.0000, 90.0000) createObject(931, 3411.469238, -1543.873779, 22.663198, 0.0000, 0.0000, 90.0000) createObject(931, 3411.449707, -1545.996338, 22.665375, 0.0000, 0.0000, 90.0000) createObject(931, 3393.603271, -1548.425537, 22.683208, 0.0000, 0.0000, 90.0000) createObject(931, 3393.624268, -1543.861694, 22.694653, 0.0000, 0.0000, 90.0000) createObject(931, 3393.605713, -1546.098633, 22.693037, 0.0000, 0.0000, 90.0000) createObject(931, 3392.800293, -1526.011597, 22.864033, 0.0000, 0.0000, 90.0000) createObject(931, 3390.443359, -1531.249023, 22.881367, 0.0000, 0.0000, 90.0000) createObject(931, 3392.669922, -1527.212036, 22.869278, 0.0000, 0.0000, 90.0000) createObject(1685, 3396.818848, -1501.971680, 22.451813, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.824707, -1502.770630, 22.478695, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.857422, -1502.978760, 22.480766, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.781982, -1503.509644, 22.487837, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.928223, -1503.794189, 22.489529, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.919922, -1504.314209, 22.495720, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.972168, -1509.989990, 39.314728, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.887207, -1510.801270, 39.300499, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.930420, -1512.523071, 39.306656, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.490723, -1509.977539, 39.330223, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.512207, -1511.089355, 39.326435, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.515625, -1512.690552, 39.321869, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.325684, -1547.600708, 39.596134, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.283691, -1546.101807, 39.388889, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.431396, -1544.215088, 39.399426, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.454590, -1546.656494, 39.276287, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.440186, -1548.381226, 39.276287, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.484131, -1544.940674, 39.276287, 0.0000, 0.0000, 0.0000) createObject(2567, 3396.681641, -1533.894531, 40.630146, 0.0000, 0.0000, 33.7500) createObject(2567, 3409.271240, -1534.916748, 40.453888, 0.0000, 0.0000, 348.7500) createObject(2567, 3412.967041, -1522.562744, 40.453888, 0.0000, 0.0000, 11.2500) createObject(2567, 3393.853516, -1520.749268, 40.646645, 0.0000, 0.0000, 0.0000) createObject(944, 3403.388672, -1529.018799, 39.502983, 0.0000, 0.0000, 0.0000) createObject(944, 3390.986084, -1537.586670, 39.653366, 0.0000, 0.0000, 348.7500) createObject(944, 3418.504395, -1525.017090, 39.411076, 0.0000, 0.0000, 348.7500) createObject(944, 3394.825439, -1509.170898, 31.884966, 0.0000, 0.0000, 6.7982) spawnPoints = 16 rSpawnPoints = { {x=3421.267090, y=-1546.364136, z=39.248020, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3407.545898, y=-1546.580078, z=39.186665, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.096191, y=-1547.516724, z=39.454590, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3420.681641, y=-1510.488159, z=39.239620, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3404.905029, y=-1511.002686, z=39.237484, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.964844, y=-1510.464355, z=39.271309, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3419.712402, y=-1502.146362, z=22.285946, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3405.734131, y=-1503.052856, z=22.277327, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3387.575195, y=-1503.615845, z=22.485300, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3386.568115, y=-1546.704590, z=22.263044, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3399.408203, y=-1546.596802, z=22.269600, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3421.499512, y=-1547.485474, z=22.283976, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3393.754883, y=-1505.973511, z=31.660557, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3400.283936, y=-1507.614502, z=33.657486, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3400.341064, y=-1504.529297, z=29.457432, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0}, {x=3406.293213, y=-1507.656006, z=35.860611, f=0, fist=0, melee=0, handgun=24, shotgun=0, smgun=29, mgun=30, rifle=0, heavy=0, projectile=0, special1=0, gift=0, special2=0, detonator=0} } end --//--------------------------------------------------------------------------// addEventHandler("onResourceStart", getRootElement(), mapLoad) it's strange... i'm quite sure the variables are passed well but it doesnt work è_é
  4. btw thanks for the code, i was thinking about that too but its not the problem sinche new it says fatal error when i join... it gives an error on the call funtion it says something like "check it exists" maybe if i use a call i should add something in the meta? EDIT: i solved exporting the getRandomPlayerSpawn but i still got the fatal error in the client when i connect and the server says nothing: EDIT2: i noticed the spawnPlayer is a MTA DM function so i renamed it to spawnThePlayer but it still gives fatal error EDIT3: i debugged the spawnThePlayer like this: function spawnThePlayer (thePlayer) outputDebugString("spawnThePlayer: spawnThePayer called successfully") local playerSpawnPoint = {} playerSpawnPoint = call(getResourceFromName("spawnmanager"), "getRandomSpawnpoint") if(playerSpawnPoint == true) then outputDebugString("spawnThePlayer: player's spawnpoint stored") else outputDebugString("spawnThePlayer: playerSpawnPoint has errors") end call(getResourceFromName("spawnmanager"), "spawnPlayerAtSpawnpoint", thePlayer, playerSpawnPoint) outputDebugString("spawnThePlayer: player spawned successfully") fadeCamera(thePlayer, true) outputDebugString("spawnThePlayer: camera faded") end and it says playerSpawnPoint has errors
  5. I just watched closer the code and fixed many errors: -- Simple DM - coded by Franc[e]sco players = getElementsByType ( "player" ) root = getRootElement () function spawnPlayer (thePlayer) local playerSpawnPoint = call(getResourceFromName("spawnmanager"), "getRandomSpawnpoint") call(getResourceFromName("spawnmanager"), "spawnPlayerAtSpawnpoint", thePlayer, playerSpawnPoint) fadeCamera(thePlayer, true) end function onPlayerJoin () local playerName = getClientName(source) outputChatBox("Welcome, " .. playerName .. ", this server is actually running Simple Deathmatch by Franc[e]sco", source) spawnPlayer(source) end addEventHandler("onPlayerJoin", root, onPlayerJoin) function onPlayerDeath () outputChatBox("You died! Please wait 10 seconds to respawn", source) setTimer(spawnPlayer, 10000, 1, source) end addEventHandler("onPlayerWasted", root, onPlayerDeath) now there's another problem... when i try to connect it says fatal error and when i check the server it says theres a error with the call function
  6. A simple command layout function myCommand(thePlayer, commandName --[[You can add more variables here]]) -- do something end addCommandHandler("mycommand", broadcastMessage)
  7. Ok, i'm making my 1st gamemode, a very simple deathmatch just to learn some LUA, and here's the problem: as i join the server -> /votemode -> simpledm (my gamemode) it says started simple dm, then started bloodybox (the gamemode's map) and then black screen instead of spawn... Here's the source: • simpledm.zip |-- meta.xml <meta> <info author="Franc[e]sco" description="Simple Deathmatch" type="gamemode" /> <script src="server.lua" /> </meta> |-- server.lua -- Simple DM - coded by Franc[e]sco players = getElementsByType ( "player" ) root = getRootElement () function spawnPlayer (thePlayer) local playerSpawnPoint = call (getResourceFromName("spawnmanager"),"getRandomSpawnpoint") call (getResourceFromName("spawnmanager"),"spawnPlayerAtSpawnpoint",thePlayer,playerSpawnPoint) fadeCamera ( source, true ) end function onPlayerJoin () playerName = getClientName(source) outputChatBox("Welcome, " .. playerName .. ", this server is actually running Simple Deathmatch by Franc[e]sco", source) spawnPlayer(source) end addEventHandler("onPlayerJoin", root, onPlayerJoin) function onPlayerDeath () outputChatBox("You died! Please wait 10 seconds to respawn", source) setTimer(spawnPlayer, 10000, 1, source) end addEventHandler("onPlayerWasted", root, onPlayerDeath) • bloodybox.zip |-- meta.xml <meta> <info author="Franc[e]sco" description="A small map for extreme deathmatches" type="map" gamemodes="simpledm" /> <map src="bloodybox.map" /> <script src="script.lua" /> </meta> |-- bloodybox.map <map mod="deathmatch" version="1.0"> <meta> <author>Franc[e]sco</author> <version>0.1</version> <name>Bloody box</name> <description>Crazy deathmatch</description> </meta> <spawnpoint posX="3421.267090" posY="-1546.364136" posZ="39.248020" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3407.545898" posY="-1546.580078" posZ="39.186665" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3387.096191" posY="-1547.516724" posZ="39.454590" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3420.681641" posY="-1510.488159" posZ="39.239620" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3404.905029" posY="-1511.002686" posZ="39.237484" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3387.964844" posY="-1510.464355" posZ="39.271309" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3419.712402" posY="-1502.146362" posZ="22.285946" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3405.734131" posY="-1503.052856" posZ="22.277327" rot="0" skin="0" interior="0" dimension="0" /> <spawnpoint posX="3387.575195" posY="-1503.615845" posZ="22.485300" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3386.568115" posY="-1546.704590" posZ="22.263044" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3399.408203" posY="-1546.596802" posZ="22.269600" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3421.499512" posY="-1547.485474" posZ="22.283976" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3393.754883" posY="-1505.973511" posZ="31.660557" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3400.283936" posY="-1507.614502" posZ="33.657486" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3400.341064" posY="-1504.529297" posZ="29.457432" rot="0" skin="286" interior="0" dimension="0" /> <spawnpoint posX="3406.293213" posY="-1507.656006" posZ="35.860611" rot="0" skin="286" interior="0" dimension="0" /> </map> |-- script.lua function mapLoad(name) createObject(3983, 3404.731201, -1526.936523, 23.624731, 0.0000, 0.0000, 0.0000) createObject(3983, 3387.905518, -1527.186768, 32.624733, 0.0000, 90.2409, 0.0000) createObject(3983, 3420.326904, -1521.111694, 32.624733, 0.0000, 90.2409, 182.0965) createObject(3983, 3408.901611, -1503.010376, 32.624733, 0.0000, 91.1003, 272.3375) createObject(3983, 3408.926514, -1547.310669, 32.624733, 0.0000, 91.1003, 90.2409) createObject(3983, 3404.731201, -1526.936523, 51.374733, 0.0000, 180.4820, 0.0000) createObject(3983, 3404.731201, -1542.187012, 40.549725, 0.0000, 0.0000, 0.0000) createObject(3983, 3404.955322, -1541.737305, 36.499649, 0.0000, 180.4820, 0.0000) createObject(3399, 3411.878662, -1503.062012, 24.215816, 0.0000, 0.0000, 188.6717) createObject(3399, 3400.371826, -1504.812500, 28.765804, 0.0000, 0.0000, 188.6717) createObject(3399, 3400.294189, -1507.640747, 32.965858, 0.0000, 0.0000, 0.5587) createObject(969, 3391.658691, -1500.882324, 31.092058, 266.3214, 3.4377, 282.9689) createObject(3399, 3409.544189, -1507.640747, 36.240875, 0.0000, 0.0000, 0.5587) createObject(969, 3414.442871, -1507.829468, 38.517120, 266.3214, 0.0000, 270.0000) createObject(925, 3420.059814, -1540.482178, 22.689754, 0.0000, 0.0000, 0.0000) createObject(925, 3415.954346, -1537.199219, 22.663198, 0.0000, 0.0000, 0.0000) createObject(925, 3406.375977, -1536.315063, 22.663198, 0.0000, 0.0000, 0.0000) createObject(925, 3401.902100, -1534.704834, 22.705301, 0.0000, 0.0000, 0.0000) createObject(925, 3401.406494, -1525.278442, 22.742367, 0.0000, 0.0000, 0.0000) createObject(925, 3403.253418, -1523.866577, 22.720238, 0.0000, 0.0000, 0.0000) createObject(925, 3394.223145, -1514.075562, 22.904266, 0.0000, 0.0000, 0.0000) createObject(944, 3413.396973, -1526.512817, 22.486080, 0.0000, 0.0000, 33.7500) createObject(944, 3405.102539, -1517.788452, 22.535776, 0.0000, 0.0000, 0.0000) createObject(944, 3411.190430, -1512.399536, 22.486080, 0.0000, 0.0000, 22.5000) createObject(931, 3411.395264, -1548.199219, 22.677711, 0.0000, 0.0000, 90.0000) createObject(931, 3411.469238, -1543.873779, 22.663198, 0.0000, 0.0000, 90.0000) createObject(931, 3411.449707, -1545.996338, 22.665375, 0.0000, 0.0000, 90.0000) createObject(931, 3393.603271, -1548.425537, 22.683208, 0.0000, 0.0000, 90.0000) createObject(931, 3393.624268, -1543.861694, 22.694653, 0.0000, 0.0000, 90.0000) createObject(931, 3393.605713, -1546.098633, 22.693037, 0.0000, 0.0000, 90.0000) createObject(931, 3392.800293, -1526.011597, 22.864033, 0.0000, 0.0000, 90.0000) createObject(931, 3390.443359, -1531.249023, 22.881367, 0.0000, 0.0000, 90.0000) createObject(931, 3392.669922, -1527.212036, 22.869278, 0.0000, 0.0000, 90.0000) createObject(1685, 3396.818848, -1501.971680, 22.451813, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.824707, -1502.770630, 22.478695, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.857422, -1502.978760, 22.480766, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.781982, -1503.509644, 22.487837, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.928223, -1503.794189, 22.489529, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.919922, -1504.314209, 22.495720, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.972168, -1509.989990, 39.314728, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.887207, -1510.801270, 39.300499, 0.0000, 0.0000, 0.0000) createObject(1685, 3396.930420, -1512.523071, 39.306656, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.490723, -1509.977539, 39.330223, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.512207, -1511.089355, 39.326435, 0.0000, 0.0000, 0.0000) createObject(1685, 3412.515625, -1512.690552, 39.321869, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.325684, -1547.600708, 39.596134, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.283691, -1546.101807, 39.388889, 0.0000, 0.0000, 0.0000) createObject(1685, 3398.431396, -1544.215088, 39.399426, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.454590, -1546.656494, 39.276287, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.440186, -1548.381226, 39.276287, 0.0000, 0.0000, 0.0000) createObject(1685, 3414.484131, -1544.940674, 39.276287, 0.0000, 0.0000, 0.0000) createObject(2567, 3396.681641, -1533.894531, 40.630146, 0.0000, 0.0000, 33.7500) createObject(2567, 3409.271240, -1534.916748, 40.453888, 0.0000, 0.0000, 348.7500) createObject(2567, 3412.967041, -1522.562744, 40.453888, 0.0000, 0.0000, 11.2500) createObject(2567, 3393.853516, -1520.749268, 40.646645, 0.0000, 0.0000, 0.0000) createObject(944, 3403.388672, -1529.018799, 39.502983, 0.0000, 0.0000, 0.0000) createObject(944, 3390.986084, -1537.586670, 39.653366, 0.0000, 0.0000, 348.7500) createObject(944, 3418.504395, -1525.017090, 39.411076, 0.0000, 0.0000, 348.7500) createObject(944, 3394.825439, -1509.170898, 31.884966, 0.0000, 0.0000, 6.7982) end --//--------------------------------------------------------------------------// addEventHandler("onResourceStart", getRootElement(), mapLoad) sorry for my english. ps: yeah i had to create objects with a lua script because converting the objects from mta race to mta DM was too long so i converted the objects to pawn and then removed the ";" and replaced CreateObject with createObject
  8. I thik u have to pm the admins like i did... i wana help too and i'm witing for the admin's reply
  9. O_O i'm l'ke wtf... this video amazed me! Extreme stunts!
  10. Hmmm i agree with you but the MTA team can't release an uncomplete version....
  11. Ah.. err... sorry... i'll PM
  12. Hey there, i'm Franc[e]sco, i'm italian and my english is quite good... i saw the last news on the website, and i think that i'm good enough to become a scripter for the gamemodes for the public beta... i followed all the tutorials and i quite understood how LUA works... but there are only secondary functions.... so i don't know how is coded a complete gamemode since i don't have the full packet
×
×
  • Create New...