-
Posts
218 -
Joined
-
Last visited
Everything posted by Deep thinker
-
hello,today i had to learn how make the freeroam (F1) only for ACL admin , but it output a debug notice Error: freeroam\fr_client.lua:1596: attempt to call global 'getPlayerAccount' (a nil value) addEventHandler('onClientResourceStart', g_ResRoot, function() local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then -- Does he have access to Admin functions? fadeCamera(true) setTimer(getPlayers, 1000, 1) bindKey('f1', 'down', toggleFRWindow) createWindow(wndMain) hideAllWindows() guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) setJetpackMaxHeight ( 9001 ) triggerServerEvent('onLoadedAtClient', g_ResRoot) end end ) thank you for reading ,
-
then you mean i can't change the slots using this function?
-
i would like to thank you for your efforts but it isn't working
-
uh didn't notice that because i am sleepy coz it's 2 :0 9 am over here any ways you can make a server.lua then use tiggerServerEvent that would be better in my opinion. wait actually i have tested it in-game and it worked but there is a problem.it sets the color to brown and never changes after that. (After changing it into a client in Meta)
-
hey i have a script which makes the slots of the players half than the current local curMaxPlayers = getMaxPlayers() local newMaxPlayers = math.ceil( curMaxPlayers / 2 ) setMaxPlayers( newMaxPlayers ) and i tried to make it double the slots by changing "/" into "*" but it failed can someone tell me what to do,and please don't tell me to change the config i am not that silly :3
-
local wr, wg, wb = 1, 1, 1 local curframemete = 2 local wrd , wgd, wbd = false, false, false addEventHandler ( 'onResourceStart',root, function () setElementData(localPlayer, "rainbowenabled", 0) end) function createRainbow() for i, player in ipairs(getElementsByType("player")) do if (wr > 0 and wrd == false) then wr = wr+curframemete if (wb ~= 1) then wb = wb-curframemete end if (wr > 254) then wr = 255 wrd = true end elseif (wg > 0 and wgd == false) then wg = wg+curframemete wr = wr-curframemete if (wg >254) then wg = 255 wgd = true end elseif (wb >0 and wbd == false) then wb = wb+curframemete wg = wg-curframemete if (wb > 254) then wbd = false wrd = false wgd = false wb = 255 wr = 1 wg = 1 end end if getPedOccupiedVehicle(player) then if getPedOccupiedVehicleSeat(player) == 0 then if getElementData(player, "rainbowenabled") == 0 then local money = getPlayerMoney() if money > 100000 then takePlayerMoney(100000) setVehicleColor(getPedOccupiedVehicle(player), wr, wg, wb, 0, 0, 0) addEventHandler("onClientRender", root, createRainbow) setElementData(player, "rainbowenabled", 1) else outputChatBox("You do not have enough money for this! ($100000 required)", 255, 0, 0) end else setElementData(player, "rainbowenabled", 0) removeEventHandler("onClientRender", root, createRainbow) end else outputChatBox("You must be at driver seat to turn on/off!", 255, 0, 0) end else outputChatBox("You must be in a vehicle to do that!", 255, 0, 0) end end end addCommandHandler("rainbow", createRainbow) try this and if you want to start it with a map you can use this <meta> <include resource="rainbow" /> </meta> --or add its .lua file in the folder <meta> <script src="rainbow.lua" type="server"/> </meta> after this change i have found a bug in this compare in line 44
-
exactly ,it's too tiny to read.
-
i meant this you don't have the .lua file or what?
-
you can get one from the community like : https://community.multitheftauto.com/index.php?p=resources&s=details&id=347
-
if you typed your code on over here ,it would be easier also i can't see anything.
-
you must do "/refresh" then check in F8 if it's loaded or not .also it could be unusable .
-
mm at first you should do like this local blip = createBlip ( 1877.7958984375 , -1738.8798828125 , 13.405012130737, 30, 0, 0, 0, 255 ) tell me if it's not working
-
what about my code is it correct ( the point of the script that i made is to make these teams can't be killed by others ) is it correct in any kind of ways? and i will test your code.thank you
-
check this i have thought in anther idea for me ,i have created teams which can't be able to get killed but i will use this again here i just wanted to make these people unable to get killed local team = getTeamFromName (getLocalPlayer()) addEventHandler ( 'onClientPlayerDamage',root, function () if ( team == "Unemployed" ) or ( team == "Off Duty Workers" ) or ( team == "Civilian" ) or ( team == "Emergency" ) then if getElementData ( Player, "team" ) then cancelEvent() end end end ) is it right,i don't have a virtual machine to test it? and i don't know how to make one i have the program but i didn't get it
-
i am confused and i don't know to add after "getElementType ( Player,.......)"
-
what does getElementType Used for?
-
actually i want you to explain something and tide the functions and events as i say in the following sentences,I want check if the player who is shooting for example in "Team 1" and the anther one in "Team 2" if the both tried to kill each others they fail.
-
hello,today i needed a script which enables the friendlyfire between two teams among like 7 teams in the scoreboard but i didn't know what to type in the script or what functions or events should i use , i wish if someone gives me an example to make this script, thank you ,
-
lol if you have a code share it ,to let people understand what do you say and mean Perfect answer
-
should i use this with it as the wiki said getRandomPlayer
-
thank you .the laser script worked and i scripted the fire extinguisher script but i have 1 more question .i want to make a script which makes the nightstick only for teams Police,SWAT,Military. i need to know what functions to use
-
actually i would like to thank you for the advice ,i was just copy and paste the full script for 1 point which is that i think that would help the supporter ,but we went away from the error my only question is : can you fix it ? also i have a secondary question out of the subject how can i make the weapon stop shooting it's own bullets .the weapon id is 42 which is Fire Extinguisher i want it to stop showing that smoke ,and thank you again also i would like to say that you gained me as a fan
-
i think the bug is in the compare only
-
hello i have a script which is depending on some kind of vip system but it's bugged because there is something wrong in the compare in the line "7" which is a laser script. local laserColor = {[2]={255, 0, 0}, [3]={255, 100, 0}} addCommandHandler("laser", function (thePlayer) if not exports["(T-RPG)VIP"]:isPlayerVIP(getAccountName(getPlayerAccount(thePlayer))) then return end local vip = exports["(T-RPG)VIP"]:isPlayerVIP(thePlayer) if vip > 1 then return end if getElementData(thePlayer, "laser.on") then lState="Disabled" r,g,b=unpack(laserColor[vip]) setElementData(thePlayer, "laser.on", false) else lState="Enabled" r,g,b=unpack(laserColor[vip]) setElementData(thePlayer, "laser.on", true) end setElementData(thePlayer, "laser.aim", false) exports["(T-RPG)Info"]:sendMessage(thePlayer,"Laser: The laser is now ".. lState ..".",r,g,b) end)
