brunob22 Posted June 15, 2015 Posted June 15, 2015 serials = { {"01",2}, {"02",2} } function banotrotipo (player) for i , playerserial in ipairs(serials) do outputChatBox(tostring(playerserial[1])) local serialdoplayer = getPlayerSerial(source) local accountaplayer = getPlayerAccount(source) if (serialdoplayer == playerserial[1]) then if player then setElementData(player, "MAX_Slots", -1) outputChatBox(tostring(player)) end end end end --function punisao () --setElementData(source, "MAX_Slots", -1) --end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo,source) o erro que da e em setElementData(player, "MAX_Slots", -1) o resto esta funcionando so tirei o serial dali de cima para evitar coloka aki =)
neves768 Posted June 15, 2015 Posted June 15, 2015 serials = { {"01",2}, {"02",2} } function banotrotipo () for i , playerserial in ipairs(serials) do outputChatBox(tostring(playerserial[1])) local serialdoplayer = getPlayerSerial(source) local accountaplayer = getPlayerAccount(source) if (serialdoplayer == playerserial[1]) then if source then setElementData(source, "MAX_Slots", -1) outputChatBox(getPlayerName(source)) end end end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo,source)
brunob22 Posted June 15, 2015 Author Posted June 15, 2015 serials = { {"01",2}, {"02",2} } function banotrotipo () for i , playerserial in ipairs(serials) do outputChatBox(tostring(playerserial[1])) local serialdoplayer = getPlayerSerial(source) local accountaplayer = getPlayerAccount(source) if (serialdoplayer == playerserial[1]) then if source then setElementData(source, "MAX_Slots", -1) outputChatBox(getPlayerName(source)) end end end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo,source) nao da erro nenhum mais tb nao acontece nada ,, o setelementdata continua nao aplicando ..
n3wage Posted June 15, 2015 Posted June 15, 2015 serials = { {"SERIAL AQUI",2} } function banotrotipo ( ) for _, v in ipairs ( serials ) do if ( getPlayerSerial ( source ) == v[1] ) do setElementData( source, "MAX_Slots", -1 ) outputChatBox( tostring(source) ) end end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo) Ou: serials = { ["SERIAL AQUI"] = true } function banotrotipo ( ) if serials[getPlayerSerial ( source )] then setElementData( source, "MAX_Slots", -1 ) outputChatBox( tostring(source) ) end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo)
brunob22 Posted June 15, 2015 Author Posted June 15, 2015 serials = { {"SERIAL AQUI",2} } function banotrotipo ( ) for _, v in ipairs ( serials ) do if ( getPlayerSerial ( source ) == v[1] ) do setElementData( source, "MAX_Slots", -1 ) outputChatBox( tostring(source) ) end end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo) Ou: serials = { ["SERIAL AQUI"] = true } function banotrotipo ( ) if serials[getPlayerSerial ( source )] then setElementData( source, "MAX_Slots", -1 ) outputChatBox( tostring(source) ) end end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo) bom o seu primeiro retorno no chat userdata: 00005876 mais nao foi aplicado o setelement
neves768 Posted June 15, 2015 Posted June 15, 2015 Tente isto: serials = { ["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true, ["1D6F76CF8D7193792D13789849498452"] = true, } function aologar() local serial = serials[getPlayerSerial(source)] if serial == true then setElementData(source, "MAX_Slots", -1) outputChatBox(source.."; Nick:"..getPlayerName(source)) outputChatBox(tonumber(getElementData(source, "MAX_Slots"))) end end addEventHandler("onPlayerLogin",getRootElement(),aologar)
brunob22 Posted June 16, 2015 Author Posted June 16, 2015 alguem podera me ajudar? pq nenhum dos codigos funciono
Banex Posted June 16, 2015 Posted June 16, 2015 serials = { ["0116586626DD995B46B8B69F1A1B1BE3"] = true, } function onPlayerLogin() if serials[getPlayerSerial(source)] then setElementData(source, "MAX_Slots",-1) --outputDebugString(getElementData(source,"MAX_Slots")) end end addEventHandler("onPlayerLogin",root,onPlayerLogin)
n3wage Posted June 16, 2015 Posted June 16, 2015 Impossível, Todos os códigos aqui postados funcionam perfeitamente, tem certeza que é esse o nome da element data que você quer setar e que o código esta no lado do servidor?
brunob22 Posted June 18, 2015 Author Posted June 18, 2015 serials = { ["0116586626DD995B46B8B69F1A1B1BE3"] = true, } function onPlayerLogin() if serials[getPlayerSerial(source)] then setElementData(source, "MAX_Slots",-1) --outputDebugString(getElementData(source,"MAX_Slots")) end end addEventHandler("onPlayerLogin",root,onPlayerLogin) nao funciono amigo Impossível, Todos os códigos aqui postados funcionam perfeitamente, tem certeza que é esse o nome da element data que você quer setar e que o código esta no lado do servidor? sim ta em lado servidor.
#RooTs Posted June 18, 2015 Posted June 18, 2015 addEventHandler("onPlayerLogin",root,onPlayerLogin) deve estar testando depois de logado para testar. saia do servidor e logue nele novamente, e verifique para ver se o script está funcionando
brunob22 Posted June 18, 2015 Author Posted June 18, 2015 addEventHandler("onPlayerLogin",root,onPlayerLogin) deve estar testando depois de logado para testar. saia do servidor e logue nele novamente, e verifique para ver se o script está funcionando serio isso voce ta de brincadeira ou oque?
Banex Posted June 18, 2015 Posted June 18, 2015 Eu testei o código que eu postei aqui, e funcionou perfeitamente.
brunob22 Posted June 20, 2015 Author Posted June 20, 2015 serio isso voce ta de brincadeira ou oque? se não for isso então você é burro ok toma o meu report ai lindao =)
brunob22 Posted June 20, 2015 Author Posted June 20, 2015 Eu testei o código que eu postei aqui, e funcionou perfeitamente. oque ta aconteceu meu amigo eo seguinte.. nao da erro nem coisa do genero. e simplesmente nao acontece nada. entendeu?
brunob22 Posted June 20, 2015 Author Posted June 20, 2015 Eu testei o código que eu postei aqui, e funcionou perfeitamente. na minha opnião o codigo devia fica assim... serials = { ["0000000000000000000000000000000"] = true, } function onPlayerLogin() if serials[getPlayerSerial(source)] then setElementData(source, "MAX_Slots",-1) --outputDebugString(getElementData(source,"MAX_Slots")) outputChatBox("OK VOCE TA LOGADO") local slotsplayers = getElementData(source, "MAX_Slots") outputChatBox(slotsplayers) end end function delaytimefunction () setTimer(onPlayerLogin,2000,1) end addEventHandler("onPlayerLogin",root,delaytimefunction) mais eu to meio q apredendo ainda.. entao da erro na linha 6 q seria o getplayerserial
Banex Posted June 20, 2015 Posted June 20, 2015 Não há necessidade de um timer. Você esta trocando o serial que está na tabela pelo seu serial? Oque você está tentando criar? E poste seu meta.xml aqui.
brunob22 Posted June 21, 2015 Author Posted June 21, 2015 Não há necessidade de um timer. Você esta trocando o serial que está na tabela pelo seu serial? Oque você está tentando criar? E poste seu meta.xml aqui. sim to trocando o serial.. como falei acho que o timer resolve.. mais eu nao sei leva o source para a função q foi chamada pelo timer.
Banex Posted June 21, 2015 Posted June 21, 2015 Está funcionando perfeitamente para todo mundo aqui. Pode ser que outro resource esteja setando o elementData para outro valor.
brunob22 Posted June 21, 2015 Author Posted June 21, 2015 Está funcionando perfeitamente para todo mundo aqui. Pode ser que outro resource esteja setando o elementData para outro valor. por isso acho bom coloka o time entende? bom se quizer da uma olhada me add no skype la b2darkorbit
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now