castaño Posted April 18, 2014 Share Posted April 18, 2014 Hola estaba analisando un script y me encontre con un evento que ni en la wiki aparece informacion sobre el, el evento es: "onPlayerKillMessage", en realidad nececito saber como funciona este evento para realizar un nuevo scritp, si tienen algun enlace donde muestre informacion sobre este evento se los agradeceria, o si saben como funciona, les agradeceria que me los explicasen bien. Link to comment
Tomas Posted April 18, 2014 Share Posted April 18, 2014 ¿Te fijaste que el evento no esté con un trigger? addEvent ( "lalala", true ) addEventHandler ( "lalala", root, outputChatBox("Soy mas sexy que Alexs_Steel", getRootElement(), 255, 0 ,0 ) end ) Link to comment
castaño Posted April 18, 2014 Author Share Posted April 18, 2014 ¿Te fijaste que el evento no esté con un trigger? addEvent ( "lalala", true ) addEventHandler ( "lalala", root, outputChatBox("Soy mas sexy que Alexs_Steel", getRootElement(), 255, 0 ,0 ) end ) eso fue lo primero que mire, lo que me sorprendio es que es un evento propio del MTA que en la wiki no aparece. Link to comment
Tomas Posted April 18, 2014 Share Posted April 18, 2014 Si es un trigger ._. addEvent ( "onPlayerKillMessage" ) function eventTriggered ( source,killer,weapon,bodypart,suicide,usedVehicle ) local wr,wg,wb = getPlayerNametagColor ( source ) if getPlayerTeam ( source ) then wr,wg,wb = getTeamColor ( getPlayerTeam ( source ) ) end local kr,kg,kb = false,false,false if ( killer ) then kr,kg,kb = getPlayerNametagColor ( killer ) if getPlayerTeam ( killer ) then kr,kg,kb = getTeamColor ( getPlayerTeam ( killer ) ) end end if ( usedVehicle ) then weapon = usedVehicle end outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon ) -- local extra = "" if ( usedVehicle ) then extra = " (Vehicle)" end if ( killer ) then if suicide then local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself. ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself."..extra ) end else local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source)..". ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source).."."..extra ) end end else outputConsoleKillMessage ( "* "..getPlayerName(source).." died."..extra ) end -- end Link to comment
Recommended Posts