Franc[e]sco Posted January 4, 2008 Share Posted January 4, 2008 (edited) 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) Edited January 4, 2008 by Guest Link to comment
bzuco Posted January 4, 2008 Share Posted January 4, 2008 at server.lua add at the top local playerid = thePlayer Link to comment
BrokenGlass Posted January 4, 2008 Share Posted January 4, 2008 Ok well, i tried out the script and i got the same error, but after removing the random spawnpoints( i just set it to one spawnpoint) it worked good, but you need random spawnpoints, im just pointing that out from what i saw Link to comment
Franc[e]sco Posted January 4, 2008 Author Share Posted January 4, 2008 After a lot of debugging and a fresh install of the server i figured out that it doesnt read the array of the spawns form the map script so i moved it to the gamemode script but... now it doesn't call the onPlayerSpawn... also when i should "spawn" at 0 0 0 i only see the sky and i can't move... here's the code of the gamemode -- Simple DM - coded by Franc[e]sco --//--------------------------------------------------------------------------// local playerid = thePlayer local spawnPoints = 16 local 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} } --//--------------------------------------------------------------------------// function spawnThePlayer (playerid) outputDebugString("spawnThePlayer called") spawnPlayer(playerid, 0.0,0.0,5.0, 0, randInt(0, 10)) outputDebugString("spawnThePlayer: player spawned") fadeCamera(playerid, true) outputDebugString("spawnThePlayer: faded camera") end --//--------------------------------------------------------------------------// function onMapStartHandler (startedMap) outputDebugString("onMapStartHandler: called") local playersToSpawn = getElementsByType ("player") outputDebugString("onMapStartHandler: playersToSpawn setted (" .. playersToSpawn .. ").") for k,player in ipairs ( playersToSpawn ) do outputDebugString("onMapStartHandler: spawning player number" .. player) spawnThePlayer( player ) end outputDebugString("onMapStartHandler: spawned all players") end addEventHandler ( "onGamemodeMapStart", getRootElement (), onMapStartHandler ) --//--------------------------------------------------------------------------// function onPlayerConnect () outputDebugString("onPlayerConnect called") local playerName = getClientName(source) outputDebugString("onPlayerConnect: playerName setted (" .. playerName .. ").") outputChatBox("Welcome, " .. playerName .. ", this server is actually running Simple Deathmatch by Franc[e]sco", source) outputDebugString("onPlayerConnect: welcome message displayed") setTimer(spawnThePlayer, 1500, 1, source) outputDebugString("onPlayerConnect: setted timer to spawn the player") end addEventHandler("onPlayerJoin", getRootElement (), onPlayerConnect) --//--------------------------------------------------------------------------// function onPlayerSpawns (posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) outputDebugString("onPlayerSpawn called") playSoundFrontEnd(source, 16) outputDebugString("onPlayerSpawn: sound played") local effectivespawns = spawnPoints-1 outputDebugString("onPlayerSpawn: effectivespawns setted (" .. effectivespawns .. ").") local rand = randInt(0, effectivespawns) outputDebugString("onPlayerSpawn: random spawn picked - " .. rand) setElementPosition(source, rSpawnPoints[rand].x, rSpawnPoints[rand].y, rSpawnPoints[rand].z + 1) outputDebugString("onPlayerSpawn: player moved to the random spawn") setPlayerRotation(source, rSpawnPoints[rand].f) outputDebugString("onPlayerSpawn: player rotation setted") 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) outputDebugString("onPlayerSpawn: weapons given to the player") end addEventHandler ( "onPlayerSpawn", getRootElement(), onPlayerSpawns ) --//--------------------------------------------------------------------------// 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) --//--------------------------------------------------------------------------// no more errors, it just doesnt call onPlayerSpawn... i noticed that cause it doesnt display the debug messages for the onPlayerSpawn Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now