Saltar al contenido
  • Global

    Global

    Chatroom Rules

    • NO SE DA SOPORTE EN CHATBOX
    • NO SPAM
    • NO FLOOD

Publicaciones recomendadas

  • Usuario
Publicado

hola tengo una duda :33 este es mi selector de skin quiero ponerlo que cuando ya alguien aiga elejido no le aparesca mas me explico ya seleccione el skin pero cuando vuelvo entrar en el server me aparace la opcion de nuevo para selecionar el skin me ayudaria este es el archivo lua

 

StartMoney = 800
CashForKill = 50
PayNSprayCost = 300
playerSkin = {}
Garages = {0,1,2,3,4,5,6,7,8,9,10,
11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47,48,49}
function SpawnPlayer(thePlayer,skin,r,g,b)
spawnPlayer ( thePlayer, -1951,270,41, 90.0, skin )
setCameraTarget (source, source)
createBlipAttachedTo(source,0,2,r,g,b)
setPlayerMoney(thePlayer,StartMoney)
playerSkin[thePlayer] = {skin,r,g,b}
setElementData(thePlayer,"Score",0)
setPlayerNametagShowing ( thePlayer, false)
end
addEvent( "onClientWantsToSpawn", true )
addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer )
addEventHandler ( "onPlayerQuit", getRootElement(),
function()
local attachedElements = getAttachedElements ( source )
if ( attachedElements ) then
for k,v in ipairs ( attachedElements ) do
if ( getElementType ( v ) == "blip" ) then
destroyElement(v)
else
end
end
end
end)
function PlayerDied(ammo,killer)
if killer and getElementType ( killer ) == "player" then
setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill)
local Score = getElementData(killer,"Score")
setElementData(killer,"Score",Score+1)
end
setTimer(PlayerRespawn,1000,1,source)
end
addEventHandler("onPlayerWasted",getRootElement(),PlayerDied)
function PlayerRespawn(diedPlayer)
if not diedPlayer then else
toggleAllControls(diedPlayer,true)
setPlayerMoney(diedPlayer,StartMoney)
spawnPlayer ( diedPlayer, -1951,270,41, 90.0,playerSkin[diedPlayer][1])
setCameraTarget (diedPlayer, diedPlayer)
end
end
function FixPlayerVehicle(hitElement,number)
local money = getPlayerMoney(hitElement)
if money < PayNSprayCost then
outputChatBox("*PM: Usted no tiene suficiente dinero",hitElement,170,0,0,true)
else
if getPedOccupiedVehicle(hitElement) then
local vehicle = getPedOccupiedVehicle(hitElement)
fixVehicle(vehicle)
playSoundFrontEnd(hitElement,16)
toggleAllControls(hitElement,false)
setPlayerMoney(hitElement,money-PayNSprayCost)
local vehicle = getPedOccupiedVehicle(hitElement)
setElementFrozen(vehicle,true)
setTimer(function()
toggleAllControls(hitElement,true)
setCameraTarget (hitElement, hitElement)
setElementFrozen(vehicle,false)
end,2500,1)
if number == 1 then
setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098)
elseif number == 2 then
setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581)
elseif number == 3 then
setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875)
else
end
end
end
end
addEvent( "onBoughtWeapon", true )
addEventHandler( "onBoughtWeapon", getRootElement(),
function(thePlayer,id,cash)
setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash)
if id == 500 then
setPedArmor ( thePlayer, 100 )
else
giveWeapon ( thePlayer, id, 120 )
end
end)
addEvent( "onBoughtBurger", true )
addEventHandler( "onBoughtBurger", getRootElement(),
function(thePlayer,cash)
setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash)
setElementHealth(thePlayer,getElementHealth(thePlayer)+cash)
if getElementHealth > 100 then
setElementHealth(thePlayer,100)
end
end)
  • Usuario
Publicado

ya arregle ese problema pero me surgio otro cuando muero y respanea a su lugar de muerte le cambia el skin como arreglo eso ?

 

 

function PlayerRespawn(diedPlayer)
if not diedPlayer then else
toggleAllControls(diedPlayer,true)
setPlayerMoney(diedPlayer,StartMoney)
spawnPlayer ( diedPlayer, -1952,271,41, 355.4488525390,playerSkin[diedPlayer][1])
setCameraTarget (diedPlayer, diedPlayer)
sera ese el codigo con el cual puedo cambiar eso y si lo es diganme como gracias por la ayuda :3
  • Ex-Staff
Publicado

Perdón por no responder anteriormente xd.

Prueba con esto:

addEventHandler("onPlayerWasted",root,function()
skin = getElementModel(source)
spawnPlayer(source,-1952,271,41, 355.4488525390,skin) 
setCameraTarget(source,source)
end)
  • Usuario
Publicado (editado)

ya vi cual es el problema el recurso de spanw que tengo tiene la funcion de cuando spane usa skin aletorio pero ya lo arregle gracias saxi :33

Editado por Therichter
  • Usuario
Publicado (editado)

hola saxi tengo otro problema cuando muere el player se le trasporta para el hospital de los santo pór que sera

function PlayerDied(ammo,killer)
if killer and getElementType ( killer ) == "player" then
local Score = getElementData(killer,"Score")
setElementData(killer,"Score",Score+1)
end
setTimer(PlayerRespawn,1000,1,source)
end
addEventHandler("onPlayerWasted",getRootElement(),PlayerDied)
function PlayerRespawn(diedPlayer)
if not diedPlayer then else
toggleAllControls(diedPlayer,true)
spawnPlayer ( diedPlayer, -1952,271,41, 355.4488525390,playerSkin[diedPlayer][1])
setCameraTarget (diedPlayer, diedPlayer)
que tengo ayi malo o que me falta ??

 

EDIT:

Usa [lua]codigo[/lua] para leer correctamente el codigo.
Editado por Therichter
  • Usuario
Publicado (editado)

ok gracias stark pero nesecito ayuda con eso

 


function PlayerDied(ammo,killer)

if killer and getElementType ( killer ) == "player" then

local Score = getElementData(killer,"Score")

setElementData(killer,"Score",Score+1)

end

setTimer(PlayerRespawn,1000,1,source)

end

addEventHandler("onPlayerWasted",getRootElement(),PlayerDied)

 

function PlayerRespawn(diedPlayer)

if not diedPlayer then else

toggleAllControls(diedPlayer,true)

spawnPlayer ( diedPlayer, -1952,271,41, 355.4488525390,playerSkin[diedPlayer][1])

setCameraTarget (diedPlayer, diedPlayer)

Editado por Therichter
Invitado
Este tema está cerrado a nuevas respuestas.
  • Explorando recientemente   0 miembros

    • No hay usuarios registrados viendo esta página.
×
×
  • Crear nuevo...