-
Posts
4,008 -
Joined
-
Last visited
-
Days Won
184
Everything posted by Lord Henry
-
Quem disse que ela é server-side?
-
Não entendi nada deste script, nem sua utilidade.
-
Você provavelmente está criando eles server-side. Ou então usando triggerClientEvent sem especificar pra qual client, ativando em todos eles.
-
Provavelmente o erro está no seu painel de login. Procure no script client essa linha: addEvent ("hideLoginWindow") E coloque um true no segundo argumento. addEvent ("hideLoginWindow", true) Se tiver um false no segundo argumento, substitua o false pelo true.
-
attempt to concatenate global 'text' (a nil value)
Lord Henry replied to Marcelo.S's topic in Programação em Lua
Troque a linha inteira do outputServerLog por isso: outputServerLog (getPlayerName(player)..": Limpou o chat!")- 1 reply
-
- 1
-
-
Bad argument @ 'getElementData' e 'setVehicleLocked'
Lord Henry replied to DouglaS666's topic in Programação em Lua
function cl_RemoveVehicleOwner ( theVehicle ) if isElement (theVehicle) then local theOwner = getElementData ( theVehicle, "cl_vehicleowner" ) if ( theOwner ~= false ) then removeElementData ( theOwner, "cl_ownedvehicle" ) removeElementData ( theVehicle, "cl_vehicleowner" ) removeElementData ( theVehicle, "cl_vehiclelocked" ) removeElementData ( owned, "cl_enginestate" ) end setVehicleLocked ( theVehicle, false ) end end -
Impossível. Deve ter algum erro no /debugscript 3 Não faz sentido ele parar a execução, mesmo que as condições ali sejam falsas. Pelo menos não no código que mandei.
-
Deve-se encaminhar o problema para o pessoal do MTA. Resources nativos não devem ter esses pequenos problemas. No meu eu coloquei assim: setTimer (kickPlayer, 100, 1, player, string.gsub(getPlayerName (source), "#%x%x%x%x%x%x", ""), mdata) Sem erros.
-
Isso não existe. Vc deve fazer elseif em vez do else seguido de um if. function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) outputChatBox("comando /reparar executado!") if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) outputChatBox("@theUser: "..tostring(theUser)) outputChatBox("@mecanico.solicitation 1#: "..tostring(getElementData (theUser, "mecanico.solicitation"))) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) elseif isElement(BlipsMEC[theUser]) then outputChatBox("BlipsMEC[theUser] existe") destroyElement(BlipsMEC[theUser]) end damagedVehs[theUser] = veh outputChatBox("@damagedVehs[theUser]: "..tostring(damagedVehs[theUser])) setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox("@mecanico.solicitation 2#: "..tostring(getElementData (theUser, "mecanico.solicitation"))) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) mechTimer[thePlayer] = setTimer (function () if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay) Quais mensagens aparecem no chat?
-
Bom, eu colocaria alguns print pelo código para saber por onde ele está lendo e quais condições ele não está validando. Assim posso saber qual condição está com problema. function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then print ("01") if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else print ("02") local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else print ("03") damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) if isElement(BlipsMEC[theUser]) then print ("04") destroyElement (BlipsMEC[theUser]) BlipsMEC[theUser] = nil end mechTimer[thePlayer] = setTimer (function () if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay)
-
No caso do destroyElement. Não está funcionando pois provavelmente o source é outro.
-
Você anexou ao jogador que está executando o comando /marcar (thePlayer), use no usuário alvo (user), mas user é o nick dele, vc deve converter para o elemento jogador antes de usá-lo. local user = getPlayerFromPartialName (user) BlipsMEC[thePlayer] = createBlipAttachedTo (user, 0, 2, 0, 0, 250, 210)
-
Destrua o elemento do blip. E depois anule a variável dele.
-
Não edite o resource admin exceto se tiver certeza do que você está fazendo.
-
Deixa pra lá, vc acabou de arrumar.
-
Uma pergunta: Pq vc está citando ninguém em sua assinatura? É proposital isso? -------------------------- Referente ao post, use getPlayerFromName ou getPlayerFromPartialName (este é melhor, já que o nome não precisa ser inteiro e exato) para obter o jogador pelo nick. Depois use createBlipAttachedTo para criar um blip anexado ao jogador. A função deve ser chamada por um comando ativador (addCommandHandler) e os parâmetros de nick são informados na função, assim como mostra na Wiki do AddCommandHandler.
-
Então faça da segunda forma.
-
Tem 2 jeitos, ou vc passa o elemento do marker por um triggerClientEvent. Ou vc apenas seta a coordenada do texto no client, sem ser anexado ao marker.
-
dxDrawText ("Área dominada por: "..tostring (getElementData (theMarker, "theData")))
-
Use com um onClientRender e um getElementPosition (localPlayer)
-
Já tentou usar SetPedAimTarget?
-
Não consegui entender sua frase, está muito mal-formulada. Você quer que o PED atire nos players que invadirem a zona. O PED não pode se mover de sua posição, apenas rotacionar. O PED deve mirar e atirar nos players que invadirem. É isso?
-
Ele está dizendo que não existe o resource tactics ou que ele não está funcionando para ser usado.
-
Poste o script aqui para que possamos ver o que está errado. Se não quiser publicar o código, envie por Privado. Use a ferramenta <> do fórum para postar códigos.
