-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You can't use "-" in a function name: Respawn-function1() Should be: Respawnfunction1()
-
You're welcome.
-
You can try one of these: exports.votemanager:voteMap ( resource1, resource2 ) exports.votemanager:startPoll ( poll )
-
What do you mean? you can replace aircrafts and boats with this resource.
-
Go to "race/race_server.lua" and search for: exports.scoreboard:addScoreboardColumn('checkpoint') Then remove it or comment it out with: -- --exports.scoreboard:addScoreboardColumn('checkpoint')
-
setVehicleColor ( abcvehicle, 0, 0, 0, 0, 0, 0 )
-
I already sent a PM, but still. Happy Birthday! enjoy it as you deserve it .
-
1: https://wiki.multitheftauto.com/wiki/CountPlayersInTeam 2: You can make a table with words, and every time a chat mesage is sent ( onPlayerChat ) you check if the word is on the table.
-
addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) local x, y, z = getElementPosition ( source ) local lx, ly, lz = getElementPosition ( localPlayer ) local distance = getDistanceBetweenPoints3D ( x, y, z, lx, ly, lz ) outputChatBox ( getPlayerName ( source ) .." fired a weapon at distance: ".. distance ) end ) Test that, I don't know if it'll work.
-
I think that you can use the weapon fire event plus the function to calculate the distance. onClientPlayerWeaponFire getDistanceBetweenPoints3D
-
function update() for k, v in ipairs(getElementsByType('player')) do local money = getPlayerMoney(v) setElementData(v,"Money",money ) end for g, v in ipairs(getElementsByType('player')) do local gang = getElementData(v,"spawnedAs") or "N/A" setElementData(v,"Class",gang ) end end setTimer(update, 100, 0) That function is really inefficient, reasons: 1: You are looping twice, that's not required, you can use the same loop for both. 2: You are using a 100 ms timer, that's not efficient at all. About your problem, where's the login part?
-
Maybe it only works with running resources? Edit: I tried it with a stopped map, returned false, then started the map, and worked.
-
Are you sure that 'theMap' is a resource element?
-
function toggleVisible ( ) guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) end bindKey( "F1", "down", toggleVisible) Tenias un 'end' de mas.
-
addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) if ( msgType == 0 ) then local Tag = getPlayerNametagText ( source ) local Team = getPlayerTeam ( source ) local teamName = ( Team and getTeamName ( Team ) or "" ) outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) cancelEvent ( true ) end end )
-
Yeah, I noticed about some typos and fixed them, copy my code again, Pres.
-
addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) if ( msgType == 0 ) then local Tag = getPlayerNametagText ( source ) local Team = getPlayerTeam ( source ) local teamName = ( Team and getTeamName ( Team ) or "Prestege" ) outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) cancelEvent ( true ) end end ) Errors: 1: 'thePlayer' is not defined. 2: 'getPlayerTeam' returns a team element, not it's name. 3: The string at 'outputChatBox' was wrong.
-
outputChatBox ( "#EE0000 Only army members can drive this car!", thePlayer, 255, 255, 255, true ) I said on the last argument, not a comma and 'true' on the string
-
Yes, that's used to connect both to a own SQLite file or a MySQL server.
-
Well, that's different, you must use the MySQL functions for that.
-
It should only insert once for each map and nick.
-
addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS votes (nick TEXT, map TEXT, vote TEXT)" ) end ) function vote ( p, command, vote ) local nick = getPlayerNametagText ( p ) local mapName = getResourceName ( exports [ "mapmanager" ]:getRunningGamemodeMap ( ) ) local check = executeSQLSelect ( "votes", "*", "nick = '".. tostring ( nick ) .."' AND map = '".. mapName .."'" ) if ( type ( check ) == "table" and #check == 0 ) or not check then executeSQLQuery ( "INSERT INTO votes VALUES (?,?,?)", nick, mapName, vote ) end end addCommandHandler ( "vote", vote ) Try that.
