LANS Posted March 5, 2013 Share Posted March 5, 2013 hola, quiero hacer un math.random para los skin de stealth pero no me funciona me dice "wrong number of a arguments" aqui el script function spyspawn(thisplayer) currentmap = call(getResourceFromName"mapmanager","getRunningGamemodeMap") local mapinterior = get(getResourceName(currentmap)..".#interior") if mapinterior == false then mapinterior = 0 end spyteamspawns = getElementByID("spyspawns") local spypoints if spyteamspawns then spypoints = getElementsByType ( "spawnpoint", spyteamspawns ) else spypoints = getElementsByType ( "spyspawn", mapRoot or getRootElement() ) end local random = math.random ( 1, table.getn ( spypoints ) ) local posX = getElementData(spypoints[random], "posX") local posY = getElementData(spypoints[random], "posY") local posZ = getElementData(spypoints[random], "posZ") local rot = getElementData(spypoints[random], "rot") or getElementData(spypoints[random], "rotZ") or 0 ---aqui--- spawnPlayer ( thisplayer, posX, posY, posZ, rot, math.random (163, 164, 165, 166), mapinterior ) setCameraTarget( thisplayer, thisplayer ) --setCameraMode ( thisplayer, "player" ) setElementData ( thisplayer, "waitingtospawn", "nope" ) getPlayerSpectatee[source] = nil triggerClientEvent(source,"showSpectateText",source,"",false) spectators[source] = nil giveWeapon ( thisplayer, 4, 1 ) setPedFightingStyle ( thisplayer, 6 ) end addEventHandler ( "dospyspawn", getRootElement(), spyspawn ) addEvent ( "givetheguns",true ) Link to comment
LANS Posted March 5, 2013 Author Share Posted March 5, 2013 te refieres a la consola? si es asi me dice el error que mencione arriba y que es en la linea 337 (la linea que dice "aqui") Link to comment
Renkon Posted March 6, 2013 Share Posted March 6, 2013 es math.random(163,166) no math.random(163,164,165,166) Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Que devuelve: "table.getn"? Me parece que mi pregunta fue muy obvia, te pregunto que es lo que la funcion "table.getn" devuelve. Link to comment
Castillo Posted March 6, 2013 Share Posted March 6, 2013 Me parece que mi pregunta fue muy obvia, te pregunto que es lo que la funcion "table.getn" devuelve. Link to comment
LANS Posted March 6, 2013 Author Share Posted March 6, 2013 utilice la solucion de renkon y me resulto gracias por la ayuda Link to comment
Recommended Posts