Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. Well, here is a video with something similar to what you want written by @Alexs_Steel Here is the link topic over at the spanish sub forum: https://forum.multitheftauto.com/viewtopic.php?f=146&t=78911
  2. If I'm not mistaken,callRemote uses port 80 to communicate with the web server. Hence the call works. Remember MTA SDK uses CURL. A workaround would be to just make calls whenever you need them.
  3. If you are talking about the bat(weapon) then you can't set it's alpha. You have to make a custom .txd file so it's transparent.
  4. It should work, though i'm not sure that's the function that uses when you spawn zombies randomly. You could use a timer, maybe when the conditional is passed, the zombie is not yet created.
  5. Yes...Exactly after the createPed function as stated before.
  6. That's because in that code you are setting the alpha to 255. If you wish to not see it, you should set it to 0.
  7. First of all, setPedSkin is deprecated. You should not use it as it might be removed. Secondly, you are missing the element argument. A correct syntax would be: setElementModel(player,getElementData(player,"skin"))
  8. You could use GetEventHandlers to know if the event is already handled and render it if necesary then use an event like onPlayerSpawn to trigger the check.
  9. Just add a line after the createPed function like this: if isElementInWater ( zomb ) then destroyElement( zomb ) end Remember to kill anything else that has to do with that ped.
  10. 1.) http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/ 2.) You should use explode function. Example: $str = "hi|how|are|you"; $delimiter = "|"; print_r(explode($delimiter,$str,4)); /*output: Array ( [0] => hi [1] => how [2] => are [3] => you )*/ Remember explode returns an array
  11. https://wiki.multitheftauto.com/wiki/Shader_examples#Texture_names
  12. And make sure you are setting everything as it should be. The example i gave you works, i tested it myself.
  13. Quizas estes utilizando otro resource con las mismas variables ya que no usas el local Saludos.
  14. Well, here is an example from a script i wrote to log chat messages to a file. Adapt it to your needs: --[[ * zGx - Zone Gaming Community 2014 * Programado por CiBeR * Todos los derechos reservados. * Prohibido su uso fuera del servidor Oficial zGx. Modulo: Server - Log Chat ]]-- function log_chat(message, messageType) if not fileExists ( "logs/log_chat.log" ) then fileCreate("logs/log_chat.log") end local log = fileOpen("logs/log_chat.log") local size = fileGetSize ( log ) local place = fileSetPos(log,size) local name = getPlayerName(source):gsub ( "#%x%x%x%x%x%x", "" ) local clan = getPlayerTeam(source)or"Ninguno" local clanName = getTeamName(clan)or"Ninguno" local fecha = getRealTime() local an = fecha.year+1900 local mes = fecha.month+1 local fec = ""..string.format("%02d", fecha.monthday).."/"..string.format("%02d", mes).."/"..an.." "..string.format("%02d", fecha.hour)..":"..string.format("%02d", fecha.minute)..":"..string.format("%02d", fecha.second) if messageType == 0 then fileWrite(log, "["..fec.."][CHAT: "..name.." Dijo: "..message.." |CLAN: "..clanName.." ]\n") fileClose(log) elseif messageType == 2 then fileWrite(log, "["..fec.."][TEAMCHAT: "..name.." Dijo: "..message.." |CLAN: "..clanName.." ]\n") fileClose(log) end end addEventHandler("onPlayerChat",root,log_chat)
  15. Sorry, i'm on the mobile. Try the code that @novo gave you.
  16. That's because every time you run the command you are creating a new file-. Use this: function createLogs(thePlayer, command, text) local time = getRealTime() dia = time.hour mes = time.month anio = time.year if not fileOpen (":"..getResourceName(getThisResource()).."/txt/plogs.txt") then local fileHandle = fileCreate(":"..getResourceName(getThisResource()).."/txt/plogs.txt") local fileread = fileOpen (":"..getResourceName(getThisResource()).."/txt/plogs.txt") else local fileread = fileOpen (":"..getResourceName(getThisResource()).."/txt/plogs.txt") end if fileread then fileWrite(fileread, "* ["..dia.."/"..mes.."/"..anio.."] nickname = '"..getPlayerName(thePlayer).."' text = '"..text.."' \n") fileClose(fileread) end end addCommandHandler("addtext", createLogs)
  17. No, the modification i made was that if it's not the drivers seat, it doesn't make the check, so any player can join the passenger seat even if they do not belong to the ACL. Also this has a wrong syntax: state = setVehicleDoorState ( vehicle, 255, 0, 0 )
  18. Just use the seat argument. vehicle1 = createVehicle ( 431 , 1080.7998046875, -1775.599609375, 13.60000038147, 0, 0, 270 ) vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ ) state = setVehicleDoorState ( vehicle, 255, 0, 0 ) setVehicleDamageProof ( vehicle, true ) setVehicleColor(vehicle1,191,76,0 , 27,27,27 ) function lockPrivate( player, seat, jacked ) if seat == 0 then local accName = getAccountName ( getPlayerAccount ( player ) ) if ( not isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Vasity Bus" ) ) ) then cancelEvent ( ) outputChatBox ( "This vehicle belongs to Vasity Bus Services", player, 255, 0, 0, false ) else outputChatBox ( "", player, 255, 0, 0, false ) end end end addEventHandler ( "onVehicleStartEnter", vehicle1, lockPrivate )
  19. It's in HTTP port you need to make the call. Make sure you can use the port on the webserver. <?php include("sdk/mta_sdk.php"); $user = "ENTERUSER"; $pass = "ENTERPASS"; $resource = "test"; $callFunction = "exportedFunction"; $message = "LINKIN"; $mtaServer = new mta("190.168.1.4", 22005,$user,$pass); $mtaServer->getResource($resource)->call($callFunction,$message); ?>
  20. No, estas logueando un index segun leo del script. Te dejo un ejemplo de un script que hice hace tiempo: --[[ * zGx - Zone Gaming Community 2014 * Programado por CiBeR * Todos los derechos reservados. * Prohibido su uso fuera del servidor Oficial zGx. Modulo: Server - Log Chat ]]-- function log_chat(message, messageType) local log = fileOpen("logs/log_chat.log") local size = fileGetSize ( log ) local place = fileSetPos(log,size) local name = getPlayerName(source):gsub ( "#%x%x%x%x%x%x", "" ) local clan = getPlayerTeam(source) if clan then local clanName = getTeamName(clan)or"Ninguno" end local fecha = getRealTime() local an = fecha.year+1900 local mes = fecha.month+1 local fec = ""..string.format("%02d", fecha.monthday).."/"..string.format("%02d", mes).."/"..an.." "..string.format("%02d", fecha.hour)..":"..string.format("%02d", fecha.minute)..":"..string.format("%02d", fecha.second) if messageType == 0 then fileWrite(log, "["..fec.."][CHAT: "..name.." Dijo: "..message.." |CLAN: "..clanName.." ]\n") fileClose(log) elseif messageType == 2 then fileWrite(log, "["..fec.."][TEAMCHAT: "..name.." Dijo: "..message.." |CLAN: "..clanName.." ]\n") fileClose(log) end end addEventHandler("onPlayerChat",root,log_chat) Para que funcione asi como esta, recorda que tenes que tener creado un archivo llamado log_chat.log dentro de la carpeta /logs/
×
×
  • Create New...