-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
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.
-
There's no such event, but i used onResourceStop to save them
-
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.
-
Well, that's what i found, let's see if someone else know something else.
-
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
-
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 )
-
setElementData(InfoRoot, "totalPlayers", totalPlayers) Had a typo in that line
-
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.
-
What is this? a way to steal resources without having to decompile them? since, we need to send the scripts to YOU.
-
Lol? what's that? you can't edit a compiled script.
-
I'm afraid that nobody will give the answer here, that suposing that there exists a decompiler.
-
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.
-
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.
-
That's right, it returns false, i've tryied many ways and nothing.
-
My bad, i put mapsTable and it's mapTable, copy the code again.
-
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.
-
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)
-
Post your WHOLE code here.
-
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.
-
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)
-
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 )
