Jump to content

"Badargument"


Recommended Posts

Posted
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?

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
for index, player in ipairs ( getPlayersInTeam ( taxistas ) ) do 
     -- Tu codigo para enviar el mensaje. 
end 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...