andrex123 Posted July 21, 2012 Posted July 21, 2012 ciudadano = createTeam ( "Ciudadanos", 255, 255, 255) taxistas = createTeam ("Taxistas", 255, 255, 0) function playerjoin() spawnPlayer ( source, 1481.1999511719, -1765.4000244141, 18.39999961853, 0, 26) fadeCamera(source, true) setCameraTarget(source, source) setPlayerTeam ( source, ciudadano) outputChatBox ( "Bienvenido!!", source, 0, 0, 255, true) outputChatBox ( "#0000FFPara llamar a un #FFFF00Taxi usa: #FFFFFF/llamartaxi", source, 0, 0, 0, true) outputChatBox ( "#0000FFSi nesecitas ayuda usa /ayuda", source, 0, 0, 0, true) end addEventHandler ("onPlayerJoin", getRootElement(), playerjoin) function llamadataxi (playerSource, thePlayer) local taxistasonline = getPlayersInTeam ( taxistas) outputChatBox("#FFFF00[Taxistas] Hemos recivido tu llamada "..getPlayerName(playerSource).." Porfavor espera que enviamos a un taxista ", playerSource, 0, 0, 0, true) outputChatBox("#FFFF00[Taxistas] Un cliente ( "..getPlayerName(thePlayer).." )solicita nuesto servicio", taxistasonline, 0, 0, 0, true) end addCommandHandler ("llamartaxi", llamadataxi) el badargument se produce aki: outputChatBox("#FFFF00[Taxistas] Un cliente ( "..getPlayerName(playerSource).." )solicita nuesto servicio", taxistasonline, 0, 0, 0, true) en el getPlayerName(playerSource) Porque se produce este "error" que ise mal?
Alexs Posted July 21, 2012 Posted July 21, 2012 outputChatBox("#FFFF00[Taxistas] Un cliente "..getPlayerName(playerSource).." solicita nuesto servicio", taxistasonline, 0, 0, 0, true) Developer @ MYVAL
Castillo Posted July 21, 2012 Posted July 21, 2012 Ademas tenes otro problema, getPlayersInTeam es una tabla, no un elemento, tenes que usar un for-loop y enviar el mensaje a cada jugador. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 21, 2012 Posted July 21, 2012 for index, player in ipairs ( getPlayersInTeam ( taxistas ) ) do -- Tu codigo para enviar el mensaje. end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 22, 2012 Posted July 22, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts