cuervox123 Posted December 21, 2015 Share Posted December 21, 2015 alguien me podria ayudar a poner correctamente la funcion de S,aqui el error: server.lua Bad argument @ takeWeapon [Expected element at argument 1,got string 'Wiz_Khalifa' c: function quitarelarma() if guiGridListGetSelectedItem(gridlistap) ~= -1 and guiGridListGetSelectedItem(armagrid) ~= -1 then do local player = getPlayerFromName (guiGridListGetItemText(gridlistap, guiGridListGetSelectedItem(gridlistap), 1)) if player then guiSetText(LabelPlayer, getPlayerName(player)) local els = guiGetText(LabelPlayer) local id = getWeaponNameFromID (guiGridListGetItemText(armagrid, guiGridListGetSelectedItem(armagrid), 1)) triggerServerEvent ("Eliminararmaa", player, els, id) end end end end addEventHandler("onClientGUIClick", quitarla, quitarelarma) S: function eliminararma(player, id) takeWeapon( player, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) Link to comment
Sasu Posted December 21, 2015 Share Posted December 21, 2015 function eliminararma(pName, id) takeWeapon( source, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) Link to comment
Tomas Posted December 22, 2015 Share Posted December 22, 2015 function eliminararma(pName, id) takeWeapon( source, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) function eliminararma(pName, id) takeWeapon( client, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) <3 Link to comment
Sasu Posted December 22, 2015 Share Posted December 22, 2015 function eliminararma(pName, id) takeWeapon( source, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) function eliminararma(pName, id) takeWeapon( client, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) <3 Esa variable no es para el cliente que llamó el evento? Link to comment
Tomas Posted December 22, 2015 Share Posted December 22, 2015 function eliminararma(pName, id) takeWeapon( source, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) function eliminararma(pName, id) takeWeapon( client, id ) end addEvent("Eliminararmaa", true) addEventHandler ("Eliminararmaa", root, eliminararma) <3 Esa variable no es para el cliente que llamó el evento? Oh, my bad pensé que se quería sacar su arma, algo así como un inventario Link to comment
Recommended Posts