Jump to content

micheal1230

Members
  • Posts

    390
  • Joined

  • Last visited

Everything posted by micheal1230

  1. Well The Script From The Wiki Gives Me A Bad Arg. @ setPlayerTeam addEvent("balance",true) function balanceTeams ( thePlayer ) --get the team pointers from their names local rEdTeam = getTeamFromName ( "Red Team" ) local blUeTeam = getTeamFromName ( "Blue Team" ) --count the number of players in each team, and store them local rEdCount = countPlayersInTeam ( rEdTeam ) local blUeCount = countPlayersInTeam ( blUeTeam ) if rEdCount == blUeCount then --if the teams are equal setPlayerTeam ( thePlayer , rEdTeam ) --place the player in grove elseif rEdCount > blUeCount then --if there are more in grove setPlayerTeam ( thePlayer , blUeTeam ) --place him in ballas elseif rEdCount < blUeCount then --if there are more in ballas setPlayerTeam ( thePlayer , rEdTeam ) --place him in grove. end end addEventHandler("balance",root, balanceTeams) setTimer( balanceTeams, 180000, 100000000 ) addEvent("balance1",true) function balanceTeamsChat ( ) outputChatBox("Balancing Teams.", root) end setTimer( balanceTeamsChat, 180000, 100000000 ) addEventHandler("balance1",root, balanceTeamsChat)
  2. addCommandHandler("noteam", function(thePlayer) outputChatBox("All Players is now without team.",thePlayer) for _, player in ipairs(getElementsByType("player")) do setPlayerTeam(player, nil) end end) how can i set the teams to be fair like auto assign how can i check if the teams are equal
  3. in here your function what i put??? i want to set a map writing /buymap function command (user) setNextMap ("mapName")--here your function... outputChatBox ("(player) Buy ('mapName') price 3000 ",getRootElement(),255,255,255,true) takePlayerMoney ( user, 3000 ) end addCommandHandler ( "buymap", command )
  4. 2 argument should be team element NOT STRING! Read wiki please! Thanks How Can I Set The Whole Server To No Team When i type a command?
  5. Mate Dont Make Useless Comments And These Are All About Different Things Not The Same Thing
  6. Well There Is No Errors But When i Join The Team It Does'nt Say There Is 1 Player On The Team Client: addEvent("tdmstart", true) addEventHandler("tdmstart",root, function() addEventHandler("onClientRender", root, drawthetext) end) function drawthetext() local redteamname = getTeamFromName("Red Team") local blueteamname = getTeamFromName("Blue Team") local redp = countPlayersInTeam( redteamname ) local bluep = countPlayersInTeam( blueteamname ) local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 90, 200 local ax1, ay1 = screenWidth - 92, 180 dxDrawText("Red Team: "..tostring(redp), ax,ay) dxDrawText("Blue Team: "..tostring(bluep), ax1,ay1) end addEvent("stoptdm",true) addEventHandler("stoptdm",root, function() removeEventHandler("onClientRender", root, drawthetext) end ) Server (Team Join Commands ) : addCommandHandler("joinredteam", function(thePlayer, commandName) setPlayerTeam(thePlayer, "Red Team") outputChatBox("You are on the Red Team.",thePlayer) end ) addCommandHandler("joinblueteam", function(thePlayer, commandName) setPlayerTeam(thePlayer, "Blue Team") outputChatBox("You are on the Blue Team.",thePlayer) end )
  7. No Need For Serverside I Have Added The Command It Shows For Like 1 Second Then Disappears Client: addEvent("tdmstart", true) function drawthetext() local redteamname = getTeamFromName("Red Team") local blueteamname = getTeamFromName("Blue Team") local redp = countPlayersInTeam( redteamname ) local bluep = countPlayersInTeam( blueteamname ) local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 90, 200 local ax1, ay1 = screenWidth - 92, 180 dxDrawText("Red Team: "..tostring(redp), ax,ay) dxDrawText("Blue Team: "..tostring(bluep), ax1,ay1) end addEventHandler("onClientRender", root, drawthetext) addEventHandler("tdmstart",root, drawthetext)
  8. If you noticed i missed the comma i just noticed it because i got a error addEventHandler("onResourceStart",root function(thePlayer) createTeam("Red Team", 255,0,0) createTeam("Blue Team", 0,0,255) end )
  9. They are addEventHandler("onResourceStart",root function(thePlayer) createTeam("Red Team" 255,0,0) createTeam("Blue Team" 0,0,255) end ) you forgot to put ',' after "RedTeam" and "Blue Team" addEventHandler("onResourceStart",resourceRoot function() createTeam("Red Team",255,0,0) createTeam("Blue Team",0,0,255) end) Same Error Stupid countPlayersInTeam addEvent("tdmstart", true) addEventHandler("tdmstart",root, addEventHandler("onClientRender", root, function() local redteamname = getTeamFromName("Red Team") local blueteamname = getTeamFromName("Blue Team") local redp = countPlayersInTeam( redteamname ) local bluep = countPlayersInTeam( blueteamname ) local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 90, 200 local ax1, ay1 = screenWidth - 92, 180 dxDrawText("Red Team: "..tostring(redp), ax,ay) dxDrawText("Blue Team: "..tostring(bluep), ax1,ay1) end) )
  10. They are addEventHandler("onResourceStart",root function(thePlayer) createTeam("Red Team" 255,0,0) createTeam("Blue Team" 0,0,255) end )
  11. bad arg @ countPlayersInTeam Line 3 and 4
  12. Error: Client: addEventHandler("onClientRender", root, function() local redp = countPlayersInTeam("Red Team") local bluep = countPlayersInTeam("Blue Team") local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 34, 70 local ax1, ay1 = screenWidth - 34, 65 dxDrawText("Red Team:".. redp .. "", ax,ay ) dxDrawText("Blue Team:".. bluep .. "", ax1,ay1 ) end )
  13. micheal1230

    Delete This!

    I never said the map was mine ???
  14. Mate We Dont Accept Requests Try And Make It Yourself Or Buy A Scripter
  15. micheal1230

    Delete This!

    Delete This Please!
  16. No Errors And I Made Edits But the message still doesnt show the message -- Infopoints Script By haws1290 For Use On Fort Carson Roleplay © -- Help From: -- Alpha -- Soildsnake14 -- blazy -- Draken mysql = exports.mysql local pInfo = createPickup ( -204.19921875, 1116.7587890625, 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 outputChatBox ( "Our Forums Address Is mtafcrp.freeforums.org", pPlayer ); 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, "PosX", nX ); setElementData ( pInfoPickup, "PosY", nY ); setElementData ( pInfoPickup, "PosZ", nZ ); --addEventHandler ( "onPickupHit", pInfoPickup, infohit ); local id = mysql:query_insert_free ( "INSERT INTO infopoints SET posx='" .. mysql:escape_string(nX) .. "', posy='" .. mysql:escape_string(nY) .. "', posz='" .. mysql:escape_string(nZ) .. "', message='" .. mysql:escape_string(chText) .. "'" ); exports['anticheat-system']:changeProtectedElementDataEx(pInfoPickup, "dbid", id, false) outputChatBox("You Have Created A Infopoint With The ID ".. id ..".",pPlayer, 255, 194, 14) --fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end --[[function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local posx = getElementData ( pInfoPickup, "PosX" ); local posy = getElementData ( pInfoPickup, "PosY" ); local posz = getElementData ( pInfoPickup, "PosZ" ); end]] --[[function infohit(thePlayer) local message = getElementData( pInfoPickup,"Message") outputChatBox("" .. message .."",thePlayer) end]] mysql = exports.mysql --[[function createInfoPoints( ) local result = mysql:mysql_query(host,"SELECT * FROM infopoints") if #result ~= 0 then for index, pInfoPickup in ipairs(result ) do fnCreateInfo(pInfoPickup ["posx"], pInfoPickup ["posy"], pInfoPickup["posz"], pInfoPickup["message"]) end end end addEventHandler("onResourceStart",resourceRoot, createInfoPoints)]] function loadAllInfopoints(res) -- Load current ones local result = mysql:query("SELECT * FROM infopoints") local count = 0 local highest = 0 if (result) then local run = true while run do local row = exports.mysql:fetch_assoc(result) if not (row) then break end local id = tonumber(row["id"]) local x = tonumber(row["posx"]) local y = tonumber(row["posy"]) local z = tonumber(row["posz"]) local infomessage = row["message"] local pickup = createPickup( x, y, z, 3, 1239, 0.1) exports.pool:allocateElement(pickup) setElementData ( pickup, "Message", infomessage ) exports['anticheat-system']:changeProtectedElementDataEx(pickup, "dbid", id, false) local pickupmessage = getElementData( pickup, "Message" ) outputChatBox("".. pickupmessage .."", source) count = count + 1 if id > highest then highest = id end end mysql:query_free("ALTER TABLE `infopoints` AUTO_INCREMENT = " .. mysql:escape_string((highest + 1))) end mysql:free_result(result) end addEventHandler("onResourceStart", getResourceRootElement(), loadAllInfopoints)
  17. Well the markers load in from the mysql but i dont understand how to get the messages to load -- Infopoints Script By haws1290 For Use On Fort Carson Roleplay © -- Help From: -- Alpha -- Soildsnake14 -- blazy -- Draken mysql = exports.mysql local pInfo = createPickup ( -204.19921875, 1116.7587890625, 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 outputChatBox ( "Our Forums Address Is mtafcrp.freeforums.org", pPlayer ); 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, "PosX", nX ); setElementData ( pInfoPickup, "PosY", nY ); setElementData ( pInfoPickup, "PosZ", nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); local id = mysql:query_insert_free ( "INSERT INTO infopoints SET posx='" .. mysql:escape_string(nX) .. "', posy='" .. mysql:escape_string(nY) .. "', posz='" .. mysql:escape_string(nZ) .. "', message='" .. mysql:escape_string(chText) .. "'" ); exports['anticheat-system']:changeProtectedElementDataEx(pInfoPickup, "dbid", id, false) outputChatBox("You Have Created A Infopoint With The ID ".. id ..".",pPlayer, 255, 194, 14) --fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end --[[function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local posx = getElementData ( pInfoPickup, "PosX" ); local posy = getElementData ( pInfoPickup, "PosY" ); local posz = getElementData ( pInfoPickup, "PosZ" ); end]] --[[function infohit(thePlayer) local message = getElementData( pInfoPickup,"Message") outputChatBox("" .. message .."",thePlayer) end]] mysql = exports.mysql --[[function createInfoPoints( ) local result = mysql:mysql_query(host,"SELECT * FROM infopoints") if #result ~= 0 then for index, pInfoPickup in ipairs(result ) do fnCreateInfo(pInfoPickup ["posx"], pInfoPickup ["posy"], pInfoPickup["posz"], pInfoPickup["message"]) end end end addEventHandler("onResourceStart",resourceRoot, createInfoPoints)]] function loadAllInfopoints(res) -- Load current ones local result = mysql:query("SELECT * FROM infopoints") local count = 0 local highest = 0 if (result) then local run = true while run do local row = exports.mysql:fetch_assoc(result) if not (row) then break end local id = tonumber(row["id"]) local x = tonumber(row["posx"]) local y = tonumber(row["posy"]) local z = tonumber(row["posz"]) local infomessage = (row["message"]) local pickup = createPickup( x, y, z, 3, 1239, 0.1) exports.pool:allocateElement(pickup) exports['anticheat-system']:changeProtectedElementDataEx(pickup, "dbid", id, false) outputChatBox("".. infomessage .."", source) count = count + 1 if id > highest then highest = id end end mysql:query_free("ALTER TABLE `infopoints` AUTO_INCREMENT = " .. mysql:escape_string((highest + 1))) end mysql:free_result(result) end addEventHandler("onResourceStart", getResourceRootElement(), loadAllInfopoints)
  18. local thetrain = createVehicle (538, x,y,z) setTrainDirection(thetrain, true) -- True Means Clockwise And False Means Anti-Clockwise.
  19. micheal1230

    Hide map

    I think He Means The F11 Map
  20. Right took me some time but i fixed it the pickups load in when i restart the resource but im unsure how to get the message to load for a certain id. Here is the script Serverside: -- Infopoints Script By haws1290 For Use On Fort Carson Roleplay © -- Help From: -- Alpha -- Soildsnake14 -- blazy -- Draken mysql = exports.mysql local pInfo = createPickup ( -204.19921875, 1116.7587890625, 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 outputChatBox ( "Our Forums Address Is mtafcrp.freeforums.org", pPlayer ); 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, "PosX", nX ); setElementData ( pInfoPickup, "PosY", nY ); setElementData ( pInfoPickup, "PosZ", nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); local id = mysql:query_insert_free ( "INSERT INTO infopoints SET posx='" .. mysql:escape_string(nX) .. "', posy='" .. mysql:escape_string(nY) .. "', posz='" .. mysql:escape_string(nZ) .. "', message='" .. mysql:escape_string(chText) .. "'" ); exports['anticheat-system']:changeProtectedElementDataEx(pInfoPickup, "dbid", id, false) outputChatBox("You Have Created A Infopoint With The ID ".. id ..".",pPlayer, 255, 194, 14) --fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end --[[function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local posx = getElementData ( pInfoPickup, "PosX" ); local posy = getElementData ( pInfoPickup, "PosY" ); local posz = getElementData ( pInfoPickup, "PosZ" ); end]] --[[function infohit(thePlayer) local message = getElementData( pInfoPickup,"Message") outputChatBox("" .. message .."",thePlayer) end]] mysql = exports.mysql --[[function createInfoPoints( ) local result = mysql:mysql_query(host,"SELECT * FROM infopoints") if #result ~= 0 then for index, pInfoPickup in ipairs(result ) do fnCreateInfo(pInfoPickup ["posx"], pInfoPickup ["posy"], pInfoPickup["posz"], pInfoPickup["message"]) end end end addEventHandler("onResourceStart",resourceRoot, createInfoPoints)]] function loadAllInfopoints(res) -- Load current ones local result = mysql:query("SELECT * FROM infopoints") local count = 0 local highest = 0 if (result) then local run = true while run do local row = exports.mysql:fetch_assoc(result) if not (row) then break end local id = tonumber(row["id"]) local x = tonumber(row["posx"]) local y = tonumber(row["posy"]) local z = tonumber(row["posz"]) local infomessage = (row["message"]) local pickup = createPickup( x, y, z, 3, 1239, 0.1) exports.pool:allocateElement(pickup) exports['anticheat-system']:changeProtectedElementDataEx(object, "dbid", id, false) count = count + 1 if id > highest then highest = id end end mysql:query_free("ALTER TABLE `infopoints` AUTO_INCREMENT = " .. mysql:escape_string((highest + 1))) end mysql:free_result(result) end addEventHandler("onResourceStart", getResourceRootElement(), loadAllInfopoints)
  21. The Error: Attempt To Compare Number With nil Line 93 Serverside -- Infopoints Script By haws1290 For Use On Fort Carson Roleplay © -- Help From: -- Alpha -- Soildsnake14 -- blazy -- Draken mysql = exports.mysql local pInfo = createPickup ( -204.19921875, 1116.7587890625, 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 outputChatBox ( "Our Forums Address Is mtafcrp.freeforums.org", pPlayer ); 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, "PosX", nX ); setElementData ( pInfoPickup, "PosY", nY ); setElementData ( pInfoPickup, "PosZ", nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local posx = getElementData ( pInfoPickup, "PosX" ); local posy = getElementData ( pInfoPickup, "PosY" ); local posz = getElementData ( pInfoPickup, "PosZ" ); mysql:query_free ( "INSERT INTO `infopoints` ( posx, posy, posz, message ) VALUES ( '" .. exports.mysql:escape_string(posx) .. "', '" .. exports.mysql:escape_string(posy) .. "', '" .. exports.mysql:escape_string(posz) .. "', '" .. exports.mysql:escape_string(message) .. "' )" ); end function infohit(thePlayer) local message = getElementData( pInfoPickup,"Message") outputChatBox("" .. message .."",thePlayer) end mysql = exports.mysql --[[function createInfoPoints( ) local result = mysql:mysql_query(host,"SELECT * FROM infopoints") if #result ~= 0 then for index, pInfoPickup in ipairs(result ) do fnCreateInfo(pInfoPickup ["posx"], pInfoPickup ["posy"], pInfoPickup["posz"], pInfoPickup["message"]) end end end addEventHandler("onResourceStart",resourceRoot, createInfoPoints)]] function loadAllInfopoints(res) -- Load current ones local result = mysql:query("SELECT * FROM infopoints") local count = 0 local highest = 0 if (result) then local run = true while run do local row = exports.mysql:fetch_assoc(result) if not (row) then break end local x = tonumber(row["posx"]) local y = tonumber(row["posy"]) local z = tonumber(row["posz"]) local infomessage = (row["message"]) local pickup = createPickup( x, y, z, 3, 1239, 0.1) exports.pool:allocateElement(pickup) count = count + 1 if id > highest then highest = id end end mysql:query_free("ALTER TABLE `infopoints` AUTO_INCREMENT = " .. mysql:escape_string((highest + 1))) end mysql:free_result(result) end addEventHandler("onResourceStart", getResourceRootElement(), loadAllInfopoints)
×
×
  • Create New...