
Cadell
Members-
Posts
64 -
Joined
-
Last visited
Everything posted by Cadell
-
Better refer to mtasa wiki client and server side scripting functions and event there you get all the info you need for scripting Visit this link https://wiki.multitheftauto.com/wiki/Main_Page
-
you can use this code in server side local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 0, 300, getRootElement()) where rbg you can define player blip color code
-
try this taxiVehicles = { [420]=true, [438]=true } function enterVehicle ( thePlayer, seat, jacked ) if ( taxiVehicles[getElementModel ( source )] ) then taxiBlip = createBlipAttachedTo( taxiVehicles, 3) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) function exitVehicle ( thePlayer, seat, jacked ) if ( taxiVehicles[getElementModel ( source )] ) then destroyElement(taxiBlip) end end addEventHandler ( "onVehicleExit", getRootElement(), exitVehicle )
-
just add "resource.*" in your admin acl then you never need to add resources name manually all resources get admin access and your all errors get fixed related to resource rights and register
-
function convertRGBToHEX(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end i think u need this it convert rbg to hex color else explain in detail
-
You using spawn panel and that is xml of it right?
-
Store score data in sql and use it after server restart all status will be safe there
-
U have to code script to check and authenticate spawn player from acl group
-
You have to write function for it to check acl lock on spawn
-
Here is full script enjoy PLAYING MTA Client Side --Update Scoreboard stuff function updateScoreboardSettings() local playTime = getElementData(localPlayer, "playTime") setElementData(localPlayer, "Play Time", playTime) end setTimer(updateScoreboardSettings, 500, 0) Server function loadPlayTimeAll() for index, player in pairs(getElementsByType("player")) do if (isGuestAccount(getPlayerAccount(player))) then local account = getPlayerAccount(player) local minutes = getAccountData(account, "playTime") if (tonumber(minutes)) then minutes = tonumber(minutes) local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(player, "playTime", hours.." Hours") else setElementData(player, "playTime", minutes.." Minutes") end else setAccountData(account, "playTime", 0) setElementData(player, "playTime", "0 Minutes") end playTimeTimer[player] = setTimer(incrementPlayTime, 60000, 0, player) end end end addEventHandler("onResourceStart", resourceRoot, loadPlayTimeAll) --Load on Play time on player login function loadPlayTime(account) local minutes = getAccountData(account, "playTime") if (tonumber(minutes)) then minutes = tonumber(minutes) local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(source, "playTime", hours.." Hours") else setElementData(source, "playTime", minutes.." Minutes") end else setAccountData(account, "playTime", 0) setElementData(source, "playTime", "0 Minutes") end playTimeTimer[source] = setTimer(incrementPlayTime, 60000, 0, source) end addEventHandler("onPlayerLogin", root, loadPlayTime) function stopPlayTime() if (isTimer(playTimeTimer[source])) then killTimer(playTimeTimer[source]) end end addEventHandler("onPlayerLogout", root, stopPlayTime) function incrementPlayTime(player) if (not player or not isElement(player)) then return end if (isGuestAccount(getPlayerAccount(player))) then return end local account = getPlayerAccount(player) local minutes = getAccountData(account, "playTime") or 1 minutes = tonumber(minutes) minutes = minutes + 1 local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(player, "playTime", hours.." Hours") else setElementData(player, "playTime", minutes.." Minutes") end setAccountData(account, "playTime", minutes) end function getPlayerPlayTime(player) if (isGuestAccount(getPlayerAccount(player))) then return false end local account = getPlayerAccount(player) local minutes = getAccountData(account, "playTime") return tonumber(minutes) end I think it will work fine i didnt tested it yet. If any bug post it.
-
i think you looking for this' local x, y, z = getElementPosition(source) local marker = createMarker(x, y, z, "ring", 2, 204, 0, 0) attachElements(marker, source)
-
Bro alpha lie between 0-1
-
If you want to use your own bam screen set player ban accounts when player login if account status banned then it will draw u r own ban screen
-
instead of that i suggest you to use table it will be easy just attach table in chat if word found it give desire output u want
-
weapon == 30 is not bullet that is weapon id u can find all id from wiki mta and 31 is id of m4
-
you can use this blip createBlipAttachedTo ( element elementToAttachTo, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )
-
Simply change the name of the event or you can export 1 fuction to other script using export tag in meta and also define type and then easily can be use in any script using syntax exports.resname:functionname
-
you have to edit and add your function if you want to do that from your p panel
-
what u mean with database you storing log in database? and want bad word get remove from chat + logs?
-
Explain a bit more what is problem
-
Use this i think it will help you function JoinCounter() if not getElementData(localPlayer,"YouR_Data") then setElementData(localPlayer,"Your_data",0) end end addEventHandler("onClientPlayerJoin", getRootElement(), JoinCounter) function initGUI( ) --make your gui here local count = getElementData(localPlayer,"Your_Data") setElementData(localPlayer,"Your_Data",count+1) end addEventHandler ( "onClientGUIClick", btnOutput, intiGUI ) function onQuitGame( ) local count = getElementData(localPlayer,"Your_Data") setElementData(localPlayer,"YOur_Data",count-1) end addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame ) I also suggest you to set player account data on quit so when it come back and click count wont get abuse. I think that what you need if no then please explain some more about your idea.
-
i am using ubuntu
-
i tried that script i got this error :- Could not load /home/fear/mta/mods/deathmatch/./dbconmy.so - l ibmysqlclient.so.15: cannot open shared object file: No such file or directory[0 5:20:46] ERROR: mysql/mysql.lua:5: dbConnect failed; Could not connect