
Albinix
Members-
Posts
48 -
Joined
-
Last visited
Everything posted by Albinix
-
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?
-
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
-
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"
-
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
-
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
-
Little help (gas stations, useful objects,ppl for beta-test)
Albinix replied to dzek (varez)'s question in Client
I can be tester i'm in GMT +1 -
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 )
-
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>
-
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
-
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 )
-
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)
-
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)
-
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)
-
Thanks for help Now i have a new problem -.-' I think this part is enough to show my problem If u do command and enter color 0 and 6 i want the messages to show but insted it change the colors to 0 and 6 but i don't want that -.- function carcolor( player, command, col1, col2 ) else if col1 == 0 and col2 == 6 then outputChatBox("* ERROR: You can't use admin colors!",player,255,0,0)
-
Hi i'm trying making a carcolor script. When i login with script 1 the car color changes but when i add a timer to script 2 (to prevent the carcolor from change when i drive trough a vehicle pickup) the carcolor don't change. debug script 2 says "bad argument @ 'setVehicleColor'" and "bad argument @ 'getPedOccupiedVehicle'" script 1 function carcolor() local veh = getPedOccupiedVehicle( source ) setVehicleColor( veh, 0, 0, 0, 0 ) end addEventHandler( "onPlayerLogin", root, carcolor ) script 2 function carcolor() setTimer ( function() local veh = getPedOccupiedVehicle( source ) setVehicleColor( veh, 0, 0, 0, 0 ) end , 50, 0 ) end addEventHandler( "onPlayerLogin", root, carcolor )
-
I'm trying to make hunter toptimes. When i pickup the hunter nothing happends -.- i have changed this line addEvent('onPlayerFinish') addEventHandler('onPlayerFinish', g_Root, function(rank, time) if g_SToptimesManager then g_SToptimesManager:playerFinished( source, time) end end ) to addEvent('onPlayerPickUpRacePickup') addEventHandler('onPlayerPickUpRacePickup', g_Root, function hunterBonus(pickupID, pickupType, vehicleModel) if vehicleModel == 425 then function(rank, time) if g_SToptimesManager then g_SToptimesManager:playerFinished( source, time) end end end end )
-
can u put it on the mta resources site? so i can download
-
can u make like if you have two teams like red and green, if you are in red your car is red ans if you is in green your car is green?
-
The money don't shows in the scoreboard? function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "piraterpg.money", playermoney ) end end local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end ) addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local playercash = getPlayerMoney ( player ) function addColumns() exports.scoreboard:scoreboardAddColumn("Points") points () end addEventHandler("onResourceStart",getRootElement(),addColumns) function points () setElementData ( player, "Points", playercash ) end
-
the timer don't work local localPlayer = getLocalPlayer ( ) local playercash = getPlayerMoney ( localPlayer ) function addColumns() exports.scoreboard:scoreboardAddColumn("Points") setTimer (addPoints,1000,0) end addEventHandler("onClientResourceStart",getResourceRootElement(),addColumns) function addPoints() setElementData(localPlayer,"Points",playercash) end
-
new code but don't work either local myMarker2 = createMarker ( 2502.6672363281, -1659.3017578125, 13.021269798279, "corona", 3, 255, 140, 0, 255 ) function MarkerHit2 ( player ) local veh = getPedOccupiedVehicle(player) if (veh) then setVehicleGravityPoint( veh, 0, 0, 100, 5 ) end end addEventHandler( "onMarkerHit", myMarker2, MarkerHit2 )
-
I have read and I tried this. but i don't get it to work local myMarker = createMarker ( 2502.6672363281, -1679.3017578125, 13.021269798279, "corona", 3, 255, 0, 0, 255 ) function MarkerHit( thePed ) local vehicle = getPedOccupiedVehicle ( theped ) setVehicleGravityPoint( vehicle, 0, 100, 0, 5 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit )