-
Posts
128 -
Joined
-
Last visited
Everything posted by Static-X
-
[lua][/lua] highlighting
Static-X replied to Static-X's topic in Site/Forum/Discord/Mantis/Wiki related
That is the point, I want to know why it isn't working. -
Just guessing, why lua syntax highlighting isn't working? See how it worked here, viewtopic.php?f=91&t=25072#p294527 now here is the quote of the same post, Clientside: bindKey("p", "down", "chatbox", "Admin") -- Admin is chatinput begin. Serverside: function adminCommand(player, command, ...) -- Add a check if he is a admin.. outputChatBox("Admin chat: "..getPlayerName(player)..": "..table.concat({...}," "), getRootElement(), 255, 0, 0, true) end addCommandHandler("Admin", adminCommand) or it only works for devs ?
-
Make sure you have the latest directX version >HERE< Also try using compatibility mode, If you use Vista or Win 7 then. Go to MTA's root directory Right click on MTA's executable (*.exe) file,click on "Compatibility" tab, if "Run this program with compatibility mode for" is unchecked, check it and select Windows XP service pack 2 ( or any )
-
I am glad that you got the solution ( finally ). What did actually help you?
-
Try this, function onResourceStart() setElementData(getLocalPlayer(),"crimerange",0) -- first of all you are going to set the data when the client resource starts end addEventHandler("onClientResourceStart",getLocalPlayer(),onResourceStart) function wantedstars() wantedlevel = getElementData (getLocalPlayer(),"crimerange") if wantedlevel >=100 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 1 elseif wantedlevel >=250 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 2 dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) elseif wantedlevel >=500 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 3 dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) elseif wantedlevel >=1000 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 4 dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) elseif wantedlevel >=2000 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(0,0,0,100),false) dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 5 dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) elseif wantedlevel>=4000 then dxDrawImage(1003.0,556.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) -- Wanted level 6 dxDrawImage(1003.0,578.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,600.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,620.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,642.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) dxDrawImage(1003.0,663.0,16.0,19.0,"images/star.png",0.0,0.0,0.0,tocolor(255,255,255,200),false) else outputDebugString("Invalid data") end end addEventHandler ( "onClientElementDataChange", getRootElement(),wantedstars ) For saving the data you can use, (SERVER SIDED= -- saving function save() if not (isGuestAccount(source)) then local Wanteddata = getElementData(source,"crimerange") setAccountData(getPlayerAccount(source),"wantedLevel",Wanteddata ) end end addEventHandler("onPlayerQuit",getRootElement(),save) addEventHandler("onPlayerLogout",getRootElement(),save) -- loading function loadit() local Wanteddata = getAccountData(getPlayerAccount(source),"crimerange") setElementData(source,"wantedLevel",Wanteddata ) end addEventHandler("onPlayerLogin",getRootElement(),loadit) An example, how you can make the stars appear. SERVER SIDED: function xx (_,killer,_,_) if (killer) then local Wanteddata = getElementData(killer,"crimerange") setElementData(killer,"crimerange",Wanteddata + 100) -- set the killer's wanted level to current wanted level + 100 setElementData(source,"crimerange",0) -- set the wasted player's wanted level to 0 else setElementData(source,"crimerange",0) -- set the wasted player's wanted level to 0 end end addEventHandler("onPlayerWasted",getRootElement(),xx)
-
nice work, keep going. Good luck on the next versions
-
setTimer (setVehicleHeadLightColor,800,0,getPedOccupiedVehicle(thePlayer),math.random(0,255),math.random(0,255),math.random(0,255))
-
@volk, just corrected an error, please look at the code now.
-
mm, I dont think so. You can create a colShape and play the sound when the player hits (enters) it.
-
oops, look out! just corrected an error function playerLogin () local statID0 = getAccountData (getPlayerAccount(source), "funmodev2-statID0") local statID1 = getAccountData (getPlayerAccount(source), "funmodev2-statID1") local statID2 = getAccountData (getPlayerAccount(source), "funmodev2-statID2") local statID3 = getAccountData (getPlayerAccount(source), "funmodev2-statID3") local statID4 = getAccountData (getPlayerAccount(source), "funmodev2-statID4") local statID5 = getAccountData (getPlayerAccount(source), "funmodev2-statID5") local statID6 = getAccountData (getPlayerAccount(source), "funmodev2-statID6") local statID7 = getAccountData (getPlayerAccount(source), "funmodev2-statID7") local statID8 = getAccountData (getPlayerAccount(source), "funmodev2-statID8") local statID9 = getAccountData (getPlayerAccount(source), "funmodev2-statID9") local statID10 = getAccountData (getPlayerAccount(source), "funmodev2-statID10") setPedStat ( source, 69, statID0 ) setPedStat ( source, 70, statID1 ) setPedStat ( source, 71, statID2 ) setPedStat ( source, 72, statID3 ) setPedStat ( source, 73, statID4 ) setPedStat ( source, 74, statID5 ) setPedStat ( source, 75, statID6 ) setPedStat ( source, 76, statID7 ) setPedStat ( source, 77, statID8 ) setPedStat ( source, 78, statID9 ) setPedStat ( source, 79, statID10 ) end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit () if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "funmodev2-statID0", getPedStat (source, 69)) setAccountData (account, "funmodev2-statID1", getPedStat (source,70)) setAccountData (account, "funmodev2-statID2", getPedStat (source, 71)) setAccountData (account, "funmodev2-statID3", getPedStat (source,72)) setAccountData (account, "funmodev2-statID4", getPedStat (source, 73)) setAccountData (account, "funmodev2-statID5", getPedStat (source, 74)) setAccountData (account, "funmodev2-statID6", getPedStat (source, 75)) setAccountData (account, "funmodev2-statID7", getPedStat (source, 76)) setAccountData (account, "funmodev2-statID8", getPedStat (source,77)) setAccountData (account, "funmodev2-statID9", getPedStat (source, 78)) setAccountData (account, "funmodev2-statID10", getPedStat (source, 79)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
-
READ THIS CAREFULLY, Seriously, Is this a joke? <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) -->)
-
When you used "onPlayerLogin" whats the point of using not (isGuestAccount(getPlayerAccount(source)) stat is not a string, why using tostring? the function GetPlayerStat is wrong, use getPedStat At function, why are you using all of the arguments? when you don't need even 1 of them. use function playerLogin () and function onQuit () on the first function, you are getting the stat but not making it to set, lmao... You'll have to make different data(s) for each weapon.
-
Good luck, here is an example. ( don't know if has any error ) star1= guiCreateStaticImage( x, y, w, h, "stars.png", false ) star2= guiCreateStaticImage( x, y, w, h, "stars.png", false ) star3= guiCreateStaticImage( x, y, w, h, "stars.png", false ) star4= guiCreateStaticImage( x, y, w, h, "stars.png", false ) star5= guiCreateStaticImage( x, y, w, h, "stars.png", false ) star6= guiCreateStaticImage( x, y, w, h, "stars.png", false ) function onResourceStart() setElementData(getLocalPlayer(),"wantedLevel",0) end addEventHandler("onClientResourceStart",root,onResourceStart) addEventHandler ( "onClientElementDataChange", getRootElement(), function ( data ) data = "wantedLevel" if (getElementData(getLocalPlayer(),"wantedLevel")==1) then guiSetVisible(star1,true) end end )
-
Is it on mta monitor? monitor.mtasa.com
-
+1 dzek. MISS0, if you have further problems, not regarding to English, please ask.
-
If you are looking for the head light function then it is SetVehicleHeadLightColor(vehicle,r,g,b) if you want the sky color same as vehicle then use. r = math.random(0,255) g = math.random(0,255) b = math.random(0,255) replace setSkyGradient (math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) with setSkyGradient (r, g, b, math.random(0,255),math.random (0,255),math.random (0,255)) and add this for the headlights color same as the sky setVehicleHeadLightColor(getPedOccupiedVehicle(thePlayer),r,g,b) For making r,g,b to get generated randomly after every X miliseconds you can use setTimer function defineTheRGB() r = math.random(0,255) g = math.random(0,255) b = math.random(0,255) end setTimer(defineTheRGB,XXX,XXX) If this is still not the thing you want then please explain what you want.
-
createBlip (1938,-1777,19 [int icon=20]) the code you copied from wiki just tells you that you have to use int a.k.a integer at the 4th argument, createBlip (1938,-1777,19, 20) Is the right function as told in the above post.
-
XX3, all you need to do is to create the gui and make the starts appear on element data change, you can use wasted event to set the wanted data of the player.
-
function closeWindow() guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2], closeWindow, false )
-
You just need to make an nodeattribute for the account name for the player who added the friend, like when the players add another friend make it get the player's account who added the friend and check all the lines which has Account nodeattribute as ( e.g )"Static-X", then get the account of the player who I wanted to add, if the friendAccount is "Pulsar" it will return end.
-
executeSQLDelete ( "PlayersEmail2","mail = '".. address .."'","subject = '".. selected .."'" ) This should return no syntax errors
-
have a look here
-
The easiest way for this thing is MTA Map Editor.
-
Use this CLIENT: if (source == buyweapondeagle) then triggerServerEvent("giveWeaponToPlayer",getLocalPlayer()) outputChatBox ("You've bought a deagle!") end end addEventHandler ("onClientGUIClick",getRootElement(),guiClick) SERVER: addEvent("giveWeaponToPlayer",true) addEventHandler("giveWeaponToPlayer",getRootElement(),function() giveWeapon(source,24) end I hope that works
-
Castle is right, you have to script the GUI functions for the GUI you created with guieditor as it only helps in designing the gui interface nothing else. The wiki help link is included in Remi-X's post. You can also go with https://community.multitheftauto.com/index.php?p= ... ils&id=241 good luck.
