~P0W3R~ Posted April 29, 2012 Posted April 29, 2012 Como puedo hacer para que cuando muere un jugador no pierda ni las armas ni el skin
~Zeus~ Posted April 29, 2012 Posted April 29, 2012 Hay un resource en la comunidad creo, ahora te lo paso si lo encuentro Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2240 Creo que es ese, si me equivoco me lo dices
~P0W3R~ Posted April 29, 2012 Author Posted April 29, 2012 no no me funciono solo guardo el arma que tengo en la mano
~Zeus~ Posted April 29, 2012 Posted April 29, 2012 Lo que puedes hacer es quitar la funcion de /kill y asi solo se te quedara cuando mueras o cuando reconectes
iFoReX Posted April 29, 2012 Posted April 29, 2012 intenta con esto dime si no te funciona es que no estoy seguro que si es tonumber o tostring addEventHandler("onPlayerWasted", getRootElement(), function() getSkin = getElementModel( source ) getArmas = getPedWeapon( source ) getAmmo = getPedTotalAmmo( source ) end ) addEventHandler("onPlayerSpawn", getRootElement(), function() setElementModel( source, tonumber(getSkin) ) giveWeapon( source, tonumber(getArmas), tonumber(getAmmo) ) end )
Castillo Posted April 29, 2012 Posted April 29, 2012 intenta con esto dime si no te funciona es que no estoy seguro que si es tonumber o tostring addEventHandler("onPlayerWasted", getRootElement(), function() getSkin = getElementModel( source ) getArmas = getPedWeapon( source ) getAmmo = getPedTotalAmmo( source ) end ) addEventHandler("onPlayerSpawn", getRootElement(), function() setElementModel( source, tonumber(getSkin) ) giveWeapon( source, tonumber(getArmas), tonumber(getAmmo) ) end ) Eso no tiene sentido, son variables globales en un script server side, ademas, solo estas obteniendo un arma. local tempData = { } addEventHandler ( "onPlayerWasted", getRootElement(), function ( ) tempData [ source ] = { weapons = getWeaponsTable ( source ), skin = getElementModel ( source ) } end ) addEventHandler ( "onPlayerSpawn", getRootElement(), function ( ) if ( tempData [ source ] ) then setElementModel ( source, tempData [ source ].skin ) for weapon, ammo in pairs ( tempData [ source ].weapons ) do giveWeapon ( source, weapon, ammo, true ) end end end ) function getWeaponsTable ( thePlayer ) local weapons = { } local hasAnyWeapon = false for slot = 0, 12 do local weapon = getPedWeapon ( thePlayer, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( thePlayer, slot ) if ( ammo > 0 ) then weapons [ weapon ] = ammo hasAnyWeapon = true end end end if ( hasAnyWeapon ) then return weapons end end
~P0W3R~ Posted April 29, 2012 Author Posted April 29, 2012 Gracias solid falto los skin pero igual muchisisismas gracias
Recommended Posts