UserToDelete Posted June 27, 2014 Share Posted June 27, 2014 (edited) function sps () local spw = math.random (1, #spawn ) spawnPlayer(source , unpack(spawn[spw])) setCameraTarget(source) fadeCamera(source,true) end function timersps () setTimer(sps,3500,1) end addEventHandler("onPlayerWasted",root,timersps) addEventHandler("onPlayerLogin",root,timersps) [2014-06-27 19:55:59] WARNING: vDscript\gamemode.lua:13: Bad argument @ 'spawnPlayer' [2014-06-27 19:55:59] WARNING: vDscript\gamemode.lua:14: Bad argument @ 'setCameraTarget' [2014-06-27 19:55:59] WARNING: vDscript\gamemode.lua:15: Bad argument @ 'fadeCamera' Esto pasó cuando el jugador murió despues de spawnear por primera vez, mediante mi comando "/kill" function kill (source,commandName) setElementHealth(source,0) end addCommandHandler("kill",kill) Edited June 27, 2014 by Guest Link to comment
MTA Team 0xCiBeR Posted June 27, 2014 MTA Team Share Posted June 27, 2014 · Hidden Hidden Eso es porque 'source' no esta definido, ya que trigeas la función desde un timer. Nota: Quiero pensar que tu tabla de posiciones esta bien, sino revisa eso también. Link to comment
UserToDelete Posted June 27, 2014 Author Share Posted June 27, 2014 Eso es porque 'source' no esta definido, ya que trigeas la función desde un timer.Nota: Quiero pensar que tu tabla de posiciones esta bien, sino revisa eso también. Me echarias una mano a definir source? function timersps2 (player) player = source setTimer (function () local spw = math.random (1, #spawn ) spawnPlayer(player , unpack(spawn[spw])) setCameraTarget(player) fadeCamera(player,true) end, 3500,1 ) end addEventHandler("onPlayerWasted",root,timersps2) addEventHandler("onPlayerLogin",root,timersps2) e probado a poner source en todos los sitios, y si, la tabla esta correcta ================================================================== = Multi Theft Auto: San Andreas v1.3.5 ================================================================== = Server name : Default MTA Server = Server IP address: = Server port : 22003 = = Log file : ..os/server/mods/deathmatch/logs/servidor.log = Maximum players : 32 = HTTP port : 22005 = Voice Chat : Disabled = Bandwidth saving : Medium ================================================================== [2014-06-27 22:04:29] Compacting accounts database 'internal.db' ... [2014-06-27 22:04:29] Resources: 1 loaded, 0 failed [2014-06-27 22:04:29] Compacting database 'registry.db' ... [2014-06-27 22:04:29] Starting resources.... [2014-06-27 22:04:29] Server started and is ready to accept connections! [2014-06-27 22:04:29] To stop the server, type 'shutdown' or press Ctrl-C [2014-06-27 22:04:29] Type 'help' for a list of commands. [2014-06-27 22:04:34] Querying MTA master server... success! (Auto detected IP:31.4.241.150) [2014-06-27 22:05:22] Server minclientversion is now 1.3.5-9.06367 [2014-06-27 22:05:22] CONNECT: #FFFFFF'~'V#666666eNaD connected (IP: 192.168.1.234 Serial: Version: 1.3.5-9.06531.0) [2014-06-27 22:05:29] JOIN: #FFFFFF'~'V#666666eNaD joined the game (IP: 192.168.1.234) [2014-06-27 22:05:29] Falta el archivo: 'nodes.xml' en vDscript [2014-06-27 22:06:43] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:06:43] Stopping vDscript [2014-06-27 22:06:43] New resource 'vDscript' loaded [2014-06-27 22:06:43] Resources: 1 loaded, 0 failed [2014-06-27 22:06:43] Starting vDscript [2014-06-27 22:06:43] vDscript build: 62 [2014-06-27 22:06:43] WARNING: vDscript\nodes\xmlNodes.lua:91: Bad argument @ 'xmlNodeGetValue' [2014-06-27 22:07:37] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:07:37] Stopping vDscript [2014-06-27 22:07:37] New resource 'vDscript' loaded [2014-06-27 22:07:37] Resources: 1 loaded, 0 failed [2014-06-27 22:07:37] Starting vDscript [2014-06-27 22:07:37] vDscript build: 63 [2014-06-27 22:07:54] QUIT: #FFFFFF'~'V#666666eNaD left the game [Quit] [2014-06-27 22:07:57] CONNECT: #FFFFFF'~'V#666666eNaD connected (IP: 192.168.1.234 Serial: Version: 1.3.5-9.06531.0) [2014-06-27 22:07:57] JOIN: #FFFFFF'~'V#666666eNaD joined the game (IP: 192.168.1.234) [2014-06-27 22:08:02] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:08:05] WARNING: vDscript\gamemode\gamemode.lua:13: Bad argument @ 'spawnPlayer' [2014-06-27 22:08:05] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'setCameraTarget' [2014-06-27 22:08:05] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'fadeCamera' [2014-06-27 22:08:34] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:08:34] Stopping vDscript [2014-06-27 22:08:34] New resource 'vDscript' loaded [2014-06-27 22:08:34] Resources: 1 loaded, 0 failed [2014-06-27 22:08:34] Starting vDscript [2014-06-27 22:08:34] vDscript build: 64 [2014-06-27 22:08:38] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:08:42] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:08:45] WARNING: vDscript\gamemode\gamemode.lua:13: Bad argument @ 'spawnPlayer' [2014-06-27 22:08:45] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'setCameraTarget' [2014-06-27 22:08:45] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'fadeCamera' [2014-06-27 22:09:25] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:09:29] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:09:29] Stopping vDscript [2014-06-27 22:09:29] New resource 'vDscript' loaded [2014-06-27 22:09:29] Resources: 1 loaded, 0 failed [2014-06-27 22:09:29] Starting vDscript [2014-06-27 22:09:29] vDscript build: 65 [2014-06-27 22:09:34] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:09:37] WARNING: vDscript\gamemode\gamemode.lua:13: Bad argument @ 'spawnPlayer' [2014-06-27 22:09:37] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'setCameraTarget' [2014-06-27 22:09:37] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'fadeCamera' [2014-06-27 22:10:17] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:10:17] Stopping vDscript [2014-06-27 22:10:17] New resource 'vDscript' loaded [2014-06-27 22:10:17] Resources: 1 loaded, 0 failed [2014-06-27 22:10:17] Starting vDscript [2014-06-27 22:10:17] SCRIPT ERROR: vDscript\gamemode\gamemode.lua:14: ')' expected (to close '(' at line 13) near 'setCameraTarget' [2014-06-27 22:10:17] ERROR: Loading script failed: vDscript\gamemode\gamemode.lua:14: ')' expected (to close '(' at line 13) near 'setCameraTarget' [2014-06-27 22:10:17] vDscript build: 66 [2014-06-27 22:11:45] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:11:45] Stopping vDscript [2014-06-27 22:11:45] New resource 'vDscript' loaded [2014-06-27 22:11:45] Resources: 1 loaded, 0 failed [2014-06-27 22:11:45] Starting vDscript [2014-06-27 22:11:45] vDscript build: 67 [2014-06-27 22:11:51] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:11:54] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:11:58] WARNING: vDscript\gamemode\gamemode.lua:13: Bad argument @ 'spawnPlayer' [2014-06-27 22:11:58] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'setCameraTarget' [2014-06-27 22:11:58] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'fadeCamera' [2014-06-27 22:14:05] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:14:05] Stopping vDscript [2014-06-27 22:14:05] New resource 'vDscript' loaded [2014-06-27 22:14:05] Resources: 1 loaded, 0 failed [2014-06-27 22:14:05] Starting vDscript [2014-06-27 22:14:05] vDscript build: 68 [2014-06-27 22:14:11] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:14:15] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:14:19] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'spawnPlayer' [2014-06-27 22:14:19] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'setCameraTarget' [2014-06-27 22:14:19] WARNING: vDscript\gamemode\gamemode.lua:16: Bad argument @ 'fadeCamera' [2014-06-27 22:14:38] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:14:38] Stopping vDscript [2014-06-27 22:14:38] New resource 'vDscript' loaded [2014-06-27 22:14:38] Resources: 1 loaded, 0 failed [2014-06-27 22:14:38] Starting vDscript [2014-06-27 22:14:38] vDscript build: 69 [2014-06-27 22:14:40] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:14:43] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:14:47] WARNING: vDscript\gamemode\gamemode.lua:14: Bad 'player' pointer @ 'spawnPlayer'(1) [2014-06-27 22:14:47] WARNING: vDscript\gamemode\gamemode.lua:15: Bad 'element' pointer @ 'setCameraTarget'(1) [2014-06-27 22:14:47] WARNING: vDscript\gamemode\gamemode.lua:16: Bad 'player' pointer @ 'fadeCamera'(1) [2014-06-27 22:16:56] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:16:56] Stopping vDscript [2014-06-27 22:16:56] New resource 'vDscript' loaded [2014-06-27 22:16:56] Resources: 1 loaded, 0 failed [2014-06-27 22:16:56] Starting vDscript [2014-06-27 22:16:56] vDscript build: 70 [2014-06-27 22:17:00] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:17:05] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:17:08] WARNING: vDscript\gamemode\gamemode.lua:14: Bad 'player' pointer @ 'spawnPlayer'(1) [2014-06-27 22:17:08] WARNING: vDscript\gamemode\gamemode.lua:15: Bad 'element' pointer @ 'setCameraTarget'(1) [2014-06-27 22:17:08] WARNING: vDscript\gamemode\gamemode.lua:16: Bad 'player' pointer @ 'fadeCamera'(1) [2014-06-27 22:17:23] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:17:23] Stopping vDscript [2014-06-27 22:17:23] New resource 'vDscript' loaded [2014-06-27 22:17:23] Resources: 1 loaded, 0 failed [2014-06-27 22:17:23] Starting vDscript [2014-06-27 22:17:23] vDscript build: 71 [2014-06-27 22:17:25] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:17:29] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:17:32] WARNING: vDscript\gamemode\gamemode.lua:14: Bad argument @ 'spawnPlayer' [2014-06-27 22:17:32] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'setCameraTarget' [2014-06-27 22:17:32] WARNING: vDscript\gamemode\gamemode.lua:16: Bad argument @ 'fadeCamera' [2014-06-27 22:18:32] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:18:32] Stopping vDscript [2014-06-27 22:18:32] New resource 'vDscript' loaded [2014-06-27 22:18:32] Resources: 1 loaded, 0 failed [2014-06-27 22:18:32] Starting vDscript [2014-06-27 22:18:32] vDscript build: 72 [2014-06-27 22:18:36] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:18:39] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) [2014-06-27 22:18:43] WARNING: vDscript\gamemode\gamemode.lua:15: Bad argument @ 'spawnPlayer' [2014-06-27 22:18:43] WARNING: vDscript\gamemode\gamemode.lua:16: Bad argument @ 'setCameraTarget' [2014-06-27 22:18:43] WARNING: vDscript\gamemode\gamemode.lua:17: Bad argument @ 'fadeCamera' [2014-06-27 22:19:38] Resource 'vDscript' changed while running, reloading and restarting [2014-06-27 22:19:38] Stopping vDscript [2014-06-27 22:19:38] New resource 'vDscript' loaded [2014-06-27 22:19:38] Resources: 1 loaded, 0 failed [2014-06-27 22:19:38] Starting vDscript [2014-06-27 22:19:38] vDscript build: 73 [2014-06-27 22:19:43] LOGOUT: #FFFFFF'~'V#666666eNaD logged out as 'venadHD' [2014-06-27 22:19:46] LOGIN: (Admin, Everyone) #FFFFFF'~'V#666666eNaD successfully logged in as 'venadHD' (IP: 192.168.1.234 Serial: ) Ya no se que mas probar, Por favor, ayudame Link to comment
UserToDelete Posted June 27, 2014 Author Share Posted June 27, 2014 Ahora por el arte de magia, funciona function timersps2 (player) player = source setTimer (function () local spw = math.random (1, #spawn ) spawnPlayer(player , unpack(spawn[spw])) setCameraTarget(player) fadeCamera(player,true) end, 3500,1 ) end Link to comment
Recommended Posts