Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You gotta put your maps/scripts/gamemodes into "resources" folder at server/mods/deathmatch directory, then start MTA server.exe, make sure that you have the required ports open.
  2. There's no such event, but i used onResourceStop to save them
  3. Thehookerkiller01, what do you mean by store it in Mysql? i don't know much of it, and i don't get why should it be in Mysql istead of XML + SQL. Btw, - The player who is added as friend haves to accept the other person first - I was already doing this. - Serial must not be visible - It's already hiden.
  4. Well, that's what i found, let's see if someone else know something else.
  5. I think here's what you looking for: https://wiki.multitheftauto.com/wiki/Useful_Functions The script: function isLeapYear(year) if year then year = math.floor(year) else year = getRealTime().year + 1900 end return ((year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0) end function getTimestamp(year, month, day, hour, minute, second) -- initiate variables local monthseconds = { 2678400, 2419200, 2678400, 2592000, 2678400, 2592000, 2678400, 2678400, 2592000, 2678400, 2592000, 2678400 } local timestamp = 0 local datetime = getRealTime() year, month, day = year or datetime.year + 1900, month or datetime.month + 1, day or datetime.monthday hour, minute, second = hour or datetime.hour, minute or datetime.minute, second or datetime.second -- calculate timestamp for i=1970, year-1 do timestamp = timestamp + (isLeapYear(i) and 31622400 or 31536000) end for i=1, month-1 do timestamp = timestamp + ((isLeapYear(year) and i == 2) and 2505600 or monthseconds[i]) end timestamp = timestamp + 86400 * (day - 1) + 3600 * hour + 60 * minute + second timestamp = timestamp - 3600 --GMT+1 compensation if datetime.isdst then timestamp = timestamp - 3600 end return timestamp end For me it returned: 1305222073
  6. Do you mean this? local realTime = getRealTime() date = string.format("%04d/%02d/%02d", realTime.year + 1900, realTime.month + 1, realTime.monthday ) time = string.format("%02d:%02d", realTime.hour, realTime.minute )
  7. Castillo

    Edit Race

    The only way to do this is via scripting, and you need to learn to do it. https://wiki.multitheftauto.com/wiki/Scr ... troduction
  8. setElementData(InfoRoot, "totalPlayers", totalPlayers) Had a typo in that line
  9. No idea, many ppl are like that, who know's, btw, i think it will be better to wait for a Program from you to compile. Good luck with it.
  10. What is this? a way to steal resources without having to decompile them? since, we need to send the scripts to YOU.
  11. Lol? what's that? you can't edit a compiled script.
  12. I'm afraid that nobody will give the answer here, that suposing that there exists a decompiler.
  13. local myteam = createTeam("mtasa.com") function getAlivePlayersInTeam(theTeam) local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do if getElementHealth(v) >= 1 then end end return players end With that function you can do getAlivePlayersInTeam(myteam) and it should return a table with the alive players in the desired team.
  14. No problem.
  15. There's a program called "SQLitebrowser" also (it's not the resource) You can download it here: http://sourceforge.net/projects/sqlitebrowser/ P.S: SQLitebrowser resource works fine for me, you gotta add it to acl.xml.
  16. That's right, it returns false, i've tryied many ways and nothing.
  17. lol, no problem
  18. My bad, i put mapsTable and it's mapTable, copy the code again.
  19. Castillo

    problem

    Maybe you want to take off 33% of health with every shot + the normal sniper damage? because with your code it's setting it to 33%. function killbysniper(attacker, attackerweapon, bodypart, loss) if(attackerweapon == 34) then setElementHealth(source, tonumber(getElementHealth(source))-33) end if(bodypart == 9) and(attackerweapon ==34) then setElementHealth(source, 0) end end addEventHandler("onPlayerDamage", getRootElement(), killbysniper) Try that.
  20. Hmmm, the truth is, in the topic i gave you, there isn't the full code to search as i can see, there are missing parts. Edit: Try this: mapTable = {} function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) table.insert(mapTable, {tostring(name)}) end addEvent("sendMaps", true ) addEventHandler( "sendMaps", getRootElement(), sendmaps ) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1, false ) function clearGridList() mapTable = {} guiGridListClear( mapGridList ) end addEvent( "clearGridList", true ) addEventHandler("clearGridList",getRootElement(),clearGridList) addEventHandler("onClientGUIChanged", SearchMaps, function () guiGridListClear ( mapGridList ) local text = guiGetText ( mapNameEdit ) if (text ~= "") then for i, v in ipairs (mapTable) do row = guiGridListAddRow(mapGridList) if ( string.find ( string.upper ( tostring(v[1]) ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(mapGridList, row, 1, tostring(v[1]), false, false) end end else for i, v in ipairs (mapTable) do row = guiGridListAddRow(mapGridList) guiGridListSetItemText(mapGridList, row, 1, tostring(v[1]), false, false) end end end)
  21. Post your WHOLE code here.
  22. Maybe you don't know how to search? viewtopic.php?f=91&t=33061&p=346697&hilit=map+search#p346697 I just searched for the word(s) "map search" and that came up.
  23. No problem.
  24. function zzz( player ) local team = getPlayerTeam(player) if team then local playerBlip = createBlipAttachedTo ( player, 22, 1, 255, 255, 0, 255 ) stophelp = setTimer ( fff, 10000, 1, playerBlip ) setElementVisibleTo ( playerBlip, getRootElement(), false) for i,v in pairs(getPlayersInTeam(team)) do setElementVisibleTo ( playerBlip, v, true) outputChatBox (getPlayerName (player) .. ":HELP ME Help Me !!!",v,255,255,0,true) end end end function fff(theblip) destroyElement (theblip) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), function () for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Z", "down", zzz ) end end) addEventHandler ( "onPlayerJoin", getRootElement(), function () bindKey ( source, "Z", "down", zzz ) end)
  25. Try this: cover = false function zzz( player ) local team = getPlayerTeam(player) if team then local playerBlip = createBlipAttachedTo ( player, 22, 1, 255, 255, 0, 255 ) stophelp = setTimer ( fff, 10000, 1, playerBlip ) setElementVisibleTo ( playerBlip, getRootElement(), false) for i,v in pairs(getPlayersInTeam(team)) do setElementVisibleTo ( playerBlip, v, true) outputChatBox (getPlayerName (player) .. ":HELP ME Help Me !!!",v,255,255,0,true) end end end function fff(theblip) destroyElement (theblip) end function bindKeys ( player, commandName ) if (cover == false)then cover = true bindKey ( player, "z", "down", zzz ) outputChatBox ( "**oN PRESS [z] to use**", player, 255, 255, 0 ) else cover = false unbindKey ( player, "z", "down", zzz ) outputChatBox ( "** OFF **", player, 255, 255, 0 ) end end addCommandHandler ( "hl", bindKeys )
×
×
  • Create New...