Anderl
Members-
Posts
2,266 -
Joined
-
Last visited
Everything posted by Anderl
-
No money = No scripters. None of us will work for server rights, at least me
-
SciTE from Lua for Windows tools.
-
Dúvida criação de server MTA!
Anderl replied to Gabriel_Domingues's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Você deve usar onPlayerQuit e onPlayerLogout pois o jogador não é "deslogado" automaticamente quando sai do servidor. -
Não é necessário fazer isso, Stanley. Você pode adicionar os recursos ao meta do seu gamemode com a tag include. Assim quando você inicia seu gamemode, todos os recursos anexados serão iniciados também. Veja um exemplo: "example2" /> -- SERVER LOGIN --> -- SCRIPTS --> -- LOGIN CLASS --> etc
-
Meu modo de organização dos recursos é um pouco diferente dos outros. Veja: Eu crio tipo um "módulo" que precisa ser iniciado para o servidor funcionar corretamente. Entende? Um recurso separado por pastas. Separo cada parte com a tag de comentário , daí eu começo programando: -- COMENTARIOS -- DECLARAÇÕES GLOBAIS ( EVENTOS, VARIAVEIS, ETC ) -- HANDLER onClientResourceStart onde inicio o script -- FUNÇÕES -- OUTRAS COISAS Além disso, eu uso a notação húngara, tipo: o prefixo fn em funções; i, n, ch, hwnd, wnd, sz, var, b, etc em variáveis; p em pointeiros; a em arrays ( tabelas ). É muito mais fácil de achar as funções, etc porque você apenas procura por fn e acha todas as funções no código.
-
When I started learning C++, I didn't know PHP yet and you don't need to know it. It is easy to learn how C++ works. But I will recommend you to start learning the basics and do simple things with what did you learn before. Then, learn other thing and do the same. It's the easier way to learn. Anything you do need, we are here to help you
-
Também os dois dizem "a meta" e não "o ficheiro meta". Odeio quando escrevem "a meta" -.-
-
https://wiki.multitheftauto.com/
-
You can do it all in server-side and trigger client event to call that function that "asks" if wanna destroy object from tableand triggering the answer to the server to delete / not delete the object. Do you understand?
-
Yes, but why would you do need same table on both sides?
-
"tableOnClient" is a pointer to the table. No, it does not get removed on server. Yes, it's like a clone.
-
Info Marker Script Doesnt Export To MYSQL Database
Anderl replied to micheal1230's topic in Scripting
You've put that function on your code, do you think we guess if functions are defined or not? -
Info Marker Script Doesnt Export To MYSQL Database
Anderl replied to micheal1230's topic in Scripting
local pInfo = createPickup ( -206.5537109375, 1132.1015625, 19.7421875, 3, 1239 ); -- create marker addEventHandler ( "onResourceStart", resourceRoot, function ( ) addEventHandler ( "onPickupHit", pInfo, fnShow ); -- add handler of event 'onPickupHit' to fn 'fnShow' addCommandHandler ( "createinfo", fnCreateInfo ); -- add command 'createinfo' to fn 'fnCreateInfo' end ) function fnShow ( pPlayer ) outputChatBox ( "Welcome to Fort Carson Roleplay Server!", pPlayer ); -- output on chat some text cancelEvent(); end function fnCreateInfo ( pPlayer, chCommand, ... ) if ( ... ) then if ( exports['global']:isPlayerAdmin ( pPlayer ) ) then local nX, nY, nZ = getElementPosition ( pPlayer ); local chText = table.concat ( { ... }, " " ); pInfoPickup = createPickup ( nX, nY, nZ, 3, 1239, 0.1 ); setElementData ( pInfoPickup, "Message", chText ); setElementData ( pInfoPickup, "Pos", nX .. nY .. nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer ); end end function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local position = getElementData ( pInfoPickup, "Pos" ); exports['mysql']:query_free ( "INSERT INTO `infopoints` ( pos, message ) VALUES ( '" .. exports.mysql:escape_string(position) .. "', '" .. exports.mysql:escape_string(message) .. "' )" ); end -
You can't use arc_ animation library with DX Text. You must create your own DX Text system and edit the library to work with your DX Text system.
-
There is no need for that anyway. It's good to have some sort of table of "instances" if you need to draw the objects in onClientRender, eg. to draw text, shapes, etc. Anyway, I didn't change only that thing in your code, check both codes
-
In my code, Edikosh998? setmetatable sets metatable of self and return the table ( in this case, the table that have the colors ). This table is like an instance.
-
Um recurso necessita apenas de um meta.
-
Just some fixes of your code, 50p: Color = { } Color.instances = { } Color.__index = Color; function Color:new ( r, g, b, a ) Color.instances[#Color.instances+1] = setmetatable( { r = r or 255, g = g or 255, b = b or 255, a = a or 255, hexColor = tocolor ( r, g, b, a ); }, self ); return Color.instances[#Color.instances]; end function Color:set ( r, g, b, a ) self.r = r; self.g = g; self.b = b; if ( a ) then self.a = a; end self.hexColor = tocolor ( self.r, self.g, self.b, self.a ); return true; end
-
Concordo com o Ninguem. Acho que você pode tentar fazer por você próprio pois desse jeito você vai aprender mais facilmente. Qualquer coisa, nós estamos aqui para ajudar
-
Acho melhor ele pagar para alguém fazer para ele pois tenho certeza que ele ainda não sabe usar as funções loadstring e muitas outras coisas ( sem ofença ).
-
Ninguém irá trabalhar num projecto assim de graça.
-
aCars = { } -- stuff local pPlayer = getPlayerName ( elem ); aCars['car_' .. pPlayer] = createVehicle ( 411, x, y, z ); --[[ How will be the table after insert: aCars = { ['car_playername'] = pointer to created vehicle; } ]]--
