Albinix

Members
  • Content Count

    48
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Albinix

  • Rank
    Rat
  1. Hey I have a problem with "string.gsub" tag = "-|TG|-" name = "-|TG|-Albinix" subtag = string.gsub(name,tag,"") outputChatBox(subtag) -- outputs -> "|-Albinix" Why does it not delete the whole tag?
  2. Albinix

    Resources

    Hey I have a question about resources. I'm a little annoyed to search for maps in the resource folder so I was thinking if it's possible to make a folder that is named "maps" in the resource folder in mta and then do something like this: startResource("maps/nameofthemap") or getResourceFromName("maps/nameofthemap") I hope u understand my question
  3. Albinix

    PM system

    HI i'm making a pm system. But i got one problem, you can only send one word function PMHandler(player,command,id,message) ... end addCommandHandler("pm",PMHandler) can you make so spaces are allowed in one of the command arguments (in my case the message argument)? if i write "/pm 1 hi all" it will only output "hi" not "hi all"
  4. Is it possible to make a variable of two strings/numbers like this: for i, playerdata in ipairs(topexp) do guiSetText("expexp"..tostring(i),tostring(playerdata.Exp).." Exp") end insted of: for i, playerdata in ipairs(topexp) do if (i == 1) then guiSetText(expexp1,tostring(playerdata.Exp).." Exp") elseif (i == 2) then guiSetText(expexp2,tostring(playerdata.Exp).." Exp") elseif (i == 3) then guiSetText(expexp3,tostring(playerdata.Exp).." Exp") elseif (i == 4) then guiSetText(expexp4,tostring(playerdata.Exp).." Exp") and so on... elseif (i == 20) then guiSetText(expexp20,tostring(playerdata.Exp).." Exp") end end Hope you understand my question
  5. Albinix

    top time

    addCommandHandler ("Top", function(player,command) top = executeSQLQuery("SELECT Name, Points FROM Money ORDER BY Points LIMIT 5") for i, playerdata in ipairs(top) do outputChatBox(playerdata.Name .. ": " .. playerdata.Points, player) end end) I'm not so good at this SQL things so i wonder what is wrong? they are no errors
  6. Albinix

    Players

    Script error: move.lua:2: '}' expectet ( to close '{' at line 1 ) near '=' and it's also say player id is a nil value?
  7. Albinix

    Players

    Still don't work nothing happends when i hit marker. object1 = createObject(8838,3330.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object2 = createObject(8838,3335.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object3 = createObject(8838,3340.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object4 = createObject(8838,3345.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object5 = createObject(8838,3350.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) addCommandHandler("ids", function(player, command) players = getElementsByType("player") for id,p in ipairs(players) do outputChatBox(getPlayerName(p) .. ": " .. tostring(id), player) end end) function getIDFromPlayer(player) if player then local theid players = getElementsByType("player") for id,p in ipairs(players) do if player == p then theid = i end end return theid else return false end end function getPlayerFromID(theID) if theID then theID = tonumber(theID) local theplayer players = getElementsByType("player") for id,p in ipairs(players) do if theID == id then theplayer = p end end return theplayer else return false end end function moveobj ( player ) local id = getIDFromPlayer(player) if id == "1" then moveObject ( object1, 0, 0, 0, 0 ) elseif id == "2" then moveObject ( object2, 0, 0, 0, 0 ) elseif id == "3" then moveObject ( object3, 0, 0, 0, 0 ) elseif id == "4" then moveObject ( object4, 0, 0, 0, 0 ) elseif id == "5" then moveObject ( object5, 0, 0, 0, 0 ) end end addEventHandler( "onMarkerHit", getRootElement(), moveobj )
  8. Albinix

    Map error. HELP!

    Here is meta.xml <meta> <script src="move.lua" type="server" /> <script src="circles.lua" type="server" /> <script src="watercolor.lua" type="client" /> <info gamemodes="race" type="map" name="[DM] WARNING City under construction -Albinix-" author="Albinix" version="1.0.0" /> <map src="[DM]WARNING-City-under-construction-Albinix-.map" dimension="0" /> <settings> <setting name="#skins" value='[ "cj" ]' /> <setting name="#maxplayers" value="[ 128 ]" /> <setting name="#gamespeed" value="[ 1 ]" /> <setting name="#ghostmode" value='[ "false" ]' /> <setting name="#time" value="21:0" /> <setting name="#vehicleweapons" value='[ "true" ]' /> <setting name="#minplayers" value="[ 0 ]" /> <setting name="#weather" value="[ 0 ]" /> <setting name="#gravity" value="[ 0.008000 ]" /> <setting name="#waveheight" value="[ 0 ]" /> <setting name="#respawntime" value="[ 5 ]" /> <setting name="#locked_time" value="[ true ]" /> <setting name="#duration" value="[ 1800 ]" /> <setting name="#respawn" value='[ "none" ]' /> </settings> </meta>
  9. Albinix

    Map error. HELP!

    Hey i builded a great map but when i almost was finish it buged up and this error came up in debugline. WARNING: race\racemap.lua:70: Error while loading [DM]WARNING-City-under-construction-Albinix-: no node in meta.xml what should i do. i have tried change meta and change mapname without succes
  10. Albinix

    Players

    how to make every player have a number from 1 to 32. like when player one hits the marker then object one will move and if player three hits the marker then object three will move. object1 = createObject(8838,3330.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object2 = createObject(8838,3335.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object3 = createObject(8838,3340.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object4 = createObject(8838,3345.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) object5 = createObject(8838,3350.00000000,-1710.00000000,0.00000000,0.00000000,0.00000000,0.00000000) function moveobj ( player ) local target = ??? if target == 1 then moveObject ( object1, 0, 0, 0, 0 ) elseif id == "2" then moveObject ( object2, 0, 0, 0, 0 ) elseif id == "3" then moveObject ( object3, 0, 0, 0, 0 ) elseif id == "4" then moveObject ( object4, 0, 0, 0, 0 ) elseif id == "5" then moveObject ( object5, 0, 0, 0, 0 ) end end addEventHandler( "onMarkerHit", getRootElement(), moveobj )
  11. Albinix

    points problem

    Now it's no error but nothing happends when 1 player win function winpoints(mapInfo,mapOptions,gameOptions) local alivePlayers = getAlivePlayers() if info == "Destruction derby" then if #alivePlayers == 1 then local allAlivePlayers = getAlivePlayers() local player = allAlivePlayers[1] local playerCount = getPlayerCount() local pointsToWin = playerCount *5 setElementData(player, "Points", getElementData(player, "points") + pointsToWin) outputChatBox (getPlayerName(player) .." #FF0000is the final survivor!! He wins " .. tostring(pointsToWin) .." points!",getRootElement(),0,255,0,true) end end end addEventHandler ("onPlayerWasted",getRootElement(),winpoints) addEventHandler ("onPlayerQuit",getRootElement(),winpoints) addEventHandler( 'onPlayerLogin', root, function() local getp = getAccountData ( getPlayerAccount ( source ), "xss.points" ) setElementData(source, "Points", getp) end ) addEventHandler( 'onPlayerQuit', root, function() local setp = getElementData(source, "Points") setAccountData ( getPlayerAccount ( source ), "xss.points", setp ) end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.scoreboard:addScoreboardColumn("Points") end)
  12. Albinix

    points problem

    If a player i want him to win some points but this don't work debug line 2 "attempt to call global 'getAlivePlayers' (a nil value)" function winpoints () local rank = getAliveplayers() if rank == "1" then local allAlivePlayers = getAlivePlayers( ) local player = allAlivePlayers[1] local playerCount = getPlayerCount() local pointsToWin = playerCount *5 setElementData(player, "Points", getElementData(player, "points") + pointsToWin) outputChatBox (getPlayerName(player) .." #FF0000is the final survivor!! He wins " .. tostring(pointsToWin) .." points!",getRootElement(),0,255,0,true) end end addEventHandler ("onPlayerWasted",getRootElement(),winpoints) addEventHandler ("onPlayerQuit",getRootElement(),winpoints)
  13. Albinix

    Timer problem

    I want it to be when u do command /vehcolor 0 6 it will say "ERROR only admins can use that!" but it won't it just change the color to Black and orange anyways function carcolor( player, command, col1, col2 ) local veh = getPedOccupiedVehicle(player) local playeraccount = getPlayerAccount ( player ) if not col1 or not col2 then outputChatBox("* ERROR: Command is /vehcolor [vehicle color 1] [vehicle color 2]",player,255,0,0) elseif col1 == 0 and col2 == 6 then outputChatBox("* ERROR: You can't use admin colors!",player,255,0,0) else setAccountData (playeraccount, "xss.vehcolor1", col1) setAccountData (playeraccount, "xss.vehcolor2", col2) setVehicleColor(veh,col1,col2,0,0) outputChatBox("* VEHCOLOR: You succesful changed your vehicle colors!",player,0,255,0) end end addCommandHandler("vehcolor",carcolor)