Javier Posted June 9, 2013 Posted June 9, 2013 Hola amigos, hice un spawn player para cuando muere se spawneara en cualquier coordenada de una tabla. Pero cuando el player muere en la consola sale @bad argument at spawnPlayer local spawns = { { 40, 80, 5 }; { 1921, -1792, 13 }; { 2000, -2041, 13 }; } function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) if not( isGuestAccount (getPlayerAccount(source)) ) then local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) fadeCamera (source, false) setTimer (spawnPlayer, 3000, 1, source, unpack(spawns [ math.random (#spawns) ] ),playerSkin, getPlayerTeam(source)) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 3000, 1, source, true) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
Plate Posted June 10, 2013 Posted June 10, 2013 local spawns = { { 40, 80, 5 }; { 1921, -1792, 13 }; { 2000, -2041, 13 }; } function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) if not( isGuestAccount (getPlayerAccount(source)) ) then local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) fadeCamera (source, false) local random = math.random ( #spawns ) local x, y, z = unpack ( spawns [ random ] ) setTimer (spawnPlayer, 3000, 1, source,x, y, z ,playerSkin, getPlayerTeam(source)) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 3000, 1, source, true) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
Recommended Posts