-
Posts
156 -
Joined
-
Last visited
Everything posted by opnaiC
-
Its not outputting working and I have the same problem
-
Hello, I made a faction script for grove street gang. The gang script is fully working. But to test the gang script I have to set me as a member of the gang. The gang has two markers one for ammo and one for the skin. So when I am using my function the set my rank and faction (script below) and I am hitting the skin marker it says in console: getElementData nil I know what its standing for but I dont know why my rankme script is not working ... I hope you can help me Also its outputting in the chat "working", so it should work but it doesnt.. function rankMySelf (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local oFaction = getElementData(thePlayer, "Faction") if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if tonumber(iFaction) == nil then setElementData(thePlayer, "Faction", 1) setElementData(thePlayer, "Rank", 6) outputChatBox ("working", thePlayer) end end end addCommandHandler( "rankme", rankMySelf, false, false)
-
local groveSkin = { [106]=true, [105]=true, [107]=true, [271]=true, [270]=true } function skin(thePlayer) local original = getElementData(thePlayer,"Original") local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 1) then if (rank == 0) then setElementModel(thePlayer,105) elseif (rank == 1) then setElementModel(thePlayer,105) elseif (rank == 2) then setElementModel(thePlayer,106) elseif (rank == 3) then setElementModel(thePlayer,107) elseif (rank == 4) then setElementModel(thePlayer,271) elseif (rank == 5) then setElementModel(thePlayer,270) end if getElementModel (thePlayer, groveSkin) then setElementData(thePlayer,"Original",getElementModel(thePlayer)) end end end addEvent ("skin", true) addEventHandler ("skin", root, skin) function onDisconnect (thePlayer) local original = getElementData(thePlayer,"Original") local fac = getElementData(thePlayer,"Faction") if (fac == 1) then if getElementModel (thePlayer, groveSkin) then setElementData(thePlayer,"Original",getElementModel(thePlayer)) end end end addEventHandler ("onPlayerQuit", root, onDisconnect) So this would work, right ? Also I am using onClientMarkerHit on the Client script to get this function working.
-
Hello, I making a gang for my server. So I allready made a marker. When the player hits the marker he will get a skin for his rank. Now I want that if the player all ready a gang skin he will get his OLD skin. Here is my code. This is not the hole code only a part of it. I can make the events myself I only need help in saving and setting the OLD skin: gangSkin = { [106]=true, [105]=true, [107]=true, [271]=true, [270]=true } function fbskin(thePlayer) local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 1) then if (rank == 0) then setElementModel(thePlayer,105) elseif (rank == 1) then setElementModel(thePlayer,105) elseif (rank == 2) then setElementModel(thePlayer,106) elseif (rank == 3) then setElementModel(thePlayer,107) elseif (rank == 4) then setElementModel(thePlayer,271) elseif (rank == 5) then setElementModel(thePlayer,270) end end if getElementModel (thePlayer, gangSkin) then setElementModel (thePlayer, oldSkin) -- how to define oldSkin ??? end end
-
Hello, I made my own tab panel with player name and player ping. For player name I used getPlayerName() and for ping getPlayerPing(). But now I need to add the Player Level in my Tab Panel. client guiGridListSetItemText(gridlist, row, 2, Whattoadd? , false, false) server local account = getPlayerAccount(thePlayer) local lvls = getAccountData(account, "lvl") or 0
-
I think you dont understand what I want. Look this is my tab panel: local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) window = guiCreateWindow(x*430, y*170, x*739, y*379, "", false) guiWindowSetSizable(window, false) guiWindowSetMovable(window, false) guiSetVisible(window, false) gridlist = guiCreateGridList(x*9, y*24, x*720, y*345, false, window) guiGridListAddColumn(gridlist, "Имя Фамилия", 0.3) guiGridListAddColumn(gridlist, "Уровень", 0.3) guiGridListAddColumn(gridlist, "Пинг", 0.3) scrollbar = guiCreateScrollBar(x*681, y*19, x*15, y*310, false, false, gridlist) guiScrollBarSetScrollPosition(scrollbar, 100.0) function openpanel () if guiGetVisible(window) == false then guiSetVisible(window, true) showCursor(true) getplayers () elseif guiGetVisible(window) == true then guiSetVisible(window, false) showCursor(false) guiGridListClear(gridlist) end end bindKey ( "TAB", "down", openpanel ) function getplayers () guiGridListClear(gridlist) for index, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, row, 1, getPlayerName(player), false, false) guiGridListSetItemText(gridlist, row, 2, triggerServerEvent ("level", root), false, false) guiGridListSetItemText(gridlist, row, 3, getPlayerPing(player), false, false) end end addEventHandler("onClientPlayerChangeNick", getRootElement(), getplayers) I want in row 2 to be displayed the level
-
This is what I mean: function getLevel (thePlayer, lvls) local account = getPlayerAccount(thePlayer) local lvls = getAccountData(account, "lvl") or 0 end addEvent ("level", true) addEventHandler("level", root, getLevel) guiGridListSetItemText(gridlist, row, 2, triggerServerEvent ("level", root), false, false) Only a part of the panel script
-
Thank you! I have a second question. Do you know how I can add this server sided data to a client sided guiGridlist ? I made my own TAB Panel with Player name and Ping. Its working perfectly but I need also the level to be displayed in the gridlist..
-
Server sided script: function experience () for i, pPlayer in ipairs( getElementsByType( "player" ) ) do local pAccount = getPlayerAccount( pPlayer ) local exp = getAccountData(pAccount, "exp") local exps = tonumber(getAccountData(pAccount, "exp")) local lvls = tonumber(getAccountData(pAccount, "lvl")) local needexp = lvls * 4 if not exp then setAccountData(pAccount, "exp", 1) setAccountData(pAccount, "allexp", 1) setAccountData(pAccount, "lvl", 1) outputChatBox("Ваш опыт: " .. exps .. "/" .. needexp, getRootElement(), 0, 255, 0) else setAccountData(pAccount, "exp", exps + 1) if exps == needexp then setAccountData(pAccount, "lvl", lvls + 1) setAccountData(pAccount, "exp", 1) outputChatBox("Ваш уровень повышен до " .. lvls + 1 .. "!", getRootElement(), 0, 255, 0) else end end end end setTimer(experience, 3600000, 0) function nilexp (thePlayer) setAccountData(getPlayerAccount(thePlayer), "exp", 1) setAccountData(getPlayerAccount(thePlayer), "lvl", 1) end addCommandHandler("nilexp", nilexp) function command (thePlayer) outputChatBox("Ваш опыт: " .. exps .. "/" .. needexp ".", thePlayer, 0, 255, 0) outputChatBox("Ваш уровень: " .. lvls .. ".", thePlayer, 0, 255, 0) end addCommandHandler("level", command) Any idea why this system isnt working correctly ?
-
The problem is not in the window, the problem is in the gridlist. I can open and close it ...
-
function teleport(thePlayer,cmd,target) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then x,y,z = getElementPosition (target) local player = getPlayerFromName( target ) if (player) then setElementPosition (thePlayer, x,y,z) end end end addCommandHandler( "tp", teleport, false, false) What is wrong ?
-
Its working this way but it spawns 4 fbi rancher ... Idk why 4 of them ... function fbiscript () local x, y, z = getElementPosition(source) rancher = createVehicle ( 490, x, y, z + 10 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript)
-
givePedWeapon is client sided, I allready tried it but it didnt worked ..
-
client function fbirancherp () triggerServerEvent ( "fbi", getLocalPlayer(), fbirancherp ) end addEventHandler ("onClientDXClick", fbirancher, fbirancherp) server function fbiscript ( target ) local x, y, z = getElementPosition( target ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) Error:
-
not working
-
function m4p () --triggerServerEvent ( "m4", getLocalPlayer() ) givePedWeapon (getLocalPlayer(), 31, 50, true) end addEventHandler ("onClientDXClick", m4, m4p) Its possible to make it working with givePedWeapon.. But my function doesnt work((
-
I changed root to getLocalPlayer() I have this error: Bad Argument: giveWeapon [Expected Argument at 1, got nil] ...
-
client m4 = exports.dxgui:dxCreateButton(167, 65, 113, 26, "M4", window) function m4p () triggerServerEvent ( "m4", root ) end addEventHandler ("onClientDXClick", m4, m4p) server function m4 (player) giveWeapon (player, 31, 50, true) end addEvent ("m4", true) addEventHandler("m4",getRootElement(),m4) When I click on the button nothing happens! But it should give me a weapon ... need help
-
Hello, I want to make a admin panel. The problem is I cant set the window to unvisible and visible but I cant do that with the edit boxes... also can anybody help me to bind the key .. window = exports.dxgui:dxCreateWindow(445, 240, 748, 299, "") label1 = exports.dxgui:dxCreateLabel(17, 32, 150, 23, "Транспорт:", window) label2 = exports.dxgui:dxCreateLabel(167, 32, 150, 23, "Оружие:", window) label3 = exports.dxgui:dxCreateLabel(317, 32, 150, 23, "Скины:", window) engine = exports.dxgui:dxCreateButton(17, 65, 113, 26, "Мотор On/Off", window) m4 = exports.dxgui:dxCreateButton(167, 65, 113, 26, "M4", window) giveskin = exports.dxgui:dxCreateButton(317, 101, 113, 26, "Дать Скин", window) mp5 = exports.dxgui:dxCreateButton(167, 101, 113, 26, "MP5", window) deagel = exports.dxgui:dxCreateButton(167, 137, 113, 26, "Desert Eagel", window) katana = exports.dxgui:dxCreateButton(167, 173, 113, 26, "Katana", window) spray = exports.dxgui:dxCreateButton(167, 209, 113, 26, "Баллончик", window) fallschirm = exports.dxgui:dxCreateButton(167, 245, 113, 26, "Парашют", window) fbirancher = exports.dxgui:dxCreateButton(17, 101, 113, 26, "FBI Rancher", window) towtruck = exports.dxgui:dxCreateButton(17, 137, 113, 26, "Tow Truck", window) lable4 = exports.dxgui:dxCreateLabel(467, 32, 150, 23, "Наказание:", window) mute = exports.dxgui:dxCreateButton(467, 137, 113, 26, "Мут", window) kick = exports.dxgui:dxCreateButton(467, 173, 113, 26, "Кик", window) jail = exports.dxgui:dxCreateButton(467, 209, 113, 26, "Тюрма", window) ban = exports.dxgui:dxCreateButton(467, 245, 113, 26, "Бан", window) lable5 = exports.dxgui:dxCreateLabel(617, 32, 150, 23, "Телепорт:", window) tptoplayer = exports.dxgui:dxCreateButton(617, 101, 113, 26, "К игроку", window) tpplayer = exports.dxgui:dxCreateButton(617, 137, 113, 26, "Игрока к себе", window) follow = exports.dxgui:dxCreateButton(617, 173, 113, 26, "Следить", window) exports.dxgui:dxSetVisible(window, true) exports.dxgui:dxWindowSetSizable(window, false) exports.dxgui:dxWindowSetMovable(window, false) skinid = guiCreateEdit(762, 305, 113, 26, "ID 1-299", false) playerid1 = guiCreateEdit(912, 305, 113, 26, "ID Игрока", false) timeselect = guiCreateEdit(912, 341, 113, 26, "Минуты", false) playerid2 = guiCreateEdit(1062, 305, 113, 26, "ID Игрока", false) guiWindowSetVisible(playerid1, false) guiWindowSetVisible(timeselect, false) guiWindowSetVisible(playerid2, false) guiWindowSetVisible(skinid, false) function turnOn () if exports.dxgui:dxSetVisible(window,false) then exports.dxgui:dxSetVisible(window,true) guiWindowSetVisible(skinid,true) guiWindowSetVisible(playerid1,true) guiWindowSetVisible(playerid2,true) guiWindowSetVisible(timeselect,true) else exports.dxgui:dxSetVisible(window,false) guiWindowSetVisible(skinid,false) guiWindowSetVisible(playerid1,false) guiWindowSetVisible(playerid2,false) guiWindowSetVisible(timeselect,false) end end addEventHandler("onClientResourceStart", resourceRoot, function() bindKey ("P", "down", turnOn) end)
-
I know allready fixed was to blind ..
