-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
--[[-- Script Made By Maria --]]-- function flo ( source ) giveWeapon(source,14,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00FLOWER#ffffff!",source,255,255,255,true) end addEvent( "flower", true ) addEventHandler( "flower", getRootElement(), flo ) function dil ( source ) giveWeapon(source,10,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00DILDO#ffffff!",source,255,255,255,true) end addEvent( "dildo", true ) addEventHandler( "dildo", getRootElement(), dil ) function vib ( source ) giveWeapon(source,12,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00VIBRATOR#ffffff!",source,255,255,255,true) end addEvent( "vibra", true ) addEventHandler( "vibra", getRootElement(), vib ) function cam ( source ) giveWeapon(source,43,10) outputChatBox("#ff0000* #ffffffYou get one #00ff00CAMERA#ffffff!",source,255,255,255,true) end addEvent( "came", true ) addEventHandler( "came", getRootElement(), cam ) function nv ( source ) giveWeapon(source,44,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00NIGHT-VISION GOGGLES#ffffff!",source,255,255,255,true) end addEvent( "niv", true ) addEventHandler( "niv", getRootElement(), nv ) function en ( source ) giveWeapon(source,45,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00INFRARED GOGGLES#ffffff!",source,255,255,255,true) end addEvent( "ifn", true ) addEventHandler( "ifn", getRootElement(), en) function shar ( source ) shark1 = createObject(1608,0,0,3) attachElements(shark1, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,shark1) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00SHARK#ffffff! (1 min)",source,255,255,255,true) end addEvent( "sar", true ) addEventHandler( "sar", getRootElement(), shar) function lov ( source ) love = createObject(1240,0,0,0) attachElements(love, source,0,0,1.5) setTimer(destroyElement,60000,1,love) outputChatBox("#ff0000* #ffffffYou get a #00ff00HEART#ffffff at your head! (1 min)",source,255,255,255,true) end addEvent( "love", true ) addEventHandler( "love", getRootElement(), lov) function mon ( source ) money = createObject(1550,0,0,3) attachElements(money, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,money) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00MONEY BAG#ffffff! (1 min)",source,255,255,255,true) end addEvent( "mo", true ) addEventHandler( "mo", getRootElement(), mon) function tur ( source ) turtl1 = createObject(1609,0,0,3) attachElements(turtl1, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,turtl1) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00TURTLE#ffffff! (1 min)",source,255,255,255,true) end addEvent( "tu", true ) addEventHandler( "tu", getRootElement(), tur) function open(source) if (getElementData(source, "userr") == "[bW]") then triggerClientEvent (source, "opening", getLocalPlayer()) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("Admin")) then triggerClientEvent (source, "opening", source) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("Moderator")) then triggerClientEvent (source, "opening", source) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("HeadAdmin")) then triggerClientEvent (source, "opening", source) end end end end end addCommandHandler("codm",open) addEventHandler("onPlayerJoin",root, function () bindKey(source,"F6","down",open) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"F6","down",open) end end)
-
That's because getLocalPlayer() is a client side only function. -- client side: --[[-- Script Made By Maria --]]-- -- 0º Part GUI GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(391,329,336,255,"Members Stuffs",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_Button[15] = guiCreateButton(882,59,72,15,"CLOSE",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,24,318,222,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Stuffs",GUIEditor_TabPanel[1]) GUIEditor_Button[1] = guiCreateButton(7,42,303,21,"Create Fire",false,GUIEditor_Tab[1]) FireS = guiCreateEdit(121,15,89,19,"2",false,GUIEditor_Tab[1]) guiEditSetMaxLength(FireS,2) GUIEditor_Label[1] = guiCreateLabel(14,16,99,17,"Fire Size: <1-15>",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(11,90,157,18,"Water Color: ",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],0,255,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(11,115,55,20,"255",false,GUIEditor_Tab[1]) guiEditSetMaxLength(GUIEditor_Edit[1],3) GUIEditor_Edit[2] = guiCreateEdit(160,115,55,20,"255",false,GUIEditor_Tab[1]) GUIEditor_Edit[3] = guiCreateEdit(86,115,55,20,"255",false,GUIEditor_Tab[1]) GUIEditor_Button[2] = guiCreateButton(7,147,303,21,"Set Water Color",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Itens",GUIEditor_TabPanel[1]) GUIEditor_Label[3] = guiCreateLabel(9,9,123,17,"Strange Weapons:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[3],0,255,255) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(11,31,83,17,"Flower",false,GUIEditor_Tab[2]) GUIEditor_Button[4] = guiCreateButton(119,31,83,17,"Dildo",false,GUIEditor_Tab[2]) GUIEditor_Button[5] = guiCreateButton(226,31,83,17,"Vibrator",false,GUIEditor_Tab[2]) GUIEditor_Button[6] = guiCreateButton(11,57,83,17,"Camera",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(119,57,83,17,"Night Vision",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(226,57,83,17,"Infra Vision",false,GUIEditor_Tab[2]) GUIEditor_Label[4] = guiCreateLabel(10,91,108,17,"Stuffs:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[4],255,255,0) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(11,115,83,17,"Shark",false,GUIEditor_Tab[2]) GUIEditor_Button[10] = guiCreateButton(119,115,83,17,"Turtle",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(226,115,83,17,"Love",false,GUIEditor_Tab[2]) GUIEditor_Button[12] = guiCreateButton(11,142,83,17,"Money",false,GUIEditor_Tab[2]) --GUIEditor_Button[13] = guiCreateButton(119,142,83,17,"Dolphin",false,GUIEditor_Tab[2]) --GUIEditor_Button[14] = guiCreateButton(226,142,83,17,"Submarine",false,GUIEditor_Tab[2]) -- 1º Part Buttons function firewater(button, state) if (source == GUIEditor_Button[1]) then nun = guiGetText(FireS) local x, y, z = getElementPosition(localPlayer) fi = createFire(x, y, z, nun) setTimer(destroyElement,10000,1,fi) elseif (source == GUIEditor_Button[2]) then r = guiGetText(GUIEditor_Edit[1]) g = guiGetText(GUIEditor_Edit[2]) b = guiGetText(GUIEditor_Edit[3]) setWaterColor(getLocalPlayer(),r,g,b,255) end end addEventHandler("onClientGUIClick",getRootElement(),firewater) -- 2º Part Buttons function wep(button, state) if (source == GUIEditor_Button[3]) then triggerServerEvent ( "flower", localPlayer, localPlayer) elseif (source == GUIEditor_Button[4]) then triggerServerEvent ( "dildo", localPlayer, localPlayer) elseif (source == GUIEditor_Button[5]) then triggerServerEvent ( "vibra", localPlayer, localPlayer) elseif (source == GUIEditor_Button[6]) then triggerServerEvent ( "came", localPlayer, localPlayer) elseif (source == GUIEditor_Button[7]) then triggerServerEvent ( "niv", localPlayer, localPlayer) elseif (source == GUIEditor_Button[8]) then triggerServerEvent ( "ifn", localPlayer, localPlayer) end end addEventHandler("onClientGUIClick",getRootElement(),wep) -- 3º Part Buttons function att(button, state) if (source == GUIEditor_Button[9]) then triggerServerEvent ( "sar", localPlayer, localPlayer) elseif (source == GUIEditor_Button[10]) then triggerServerEvent ( "tu", localPlayer, localPlayer) elseif (source == GUIEditor_Button[11]) then triggerServerEvent ( "love", localPlayer, localPlayer) elseif (source == GUIEditor_Button[12]) then triggerServerEvent ( "mo", localPlayer, localPlayer) end end addEventHandler("onClientGUIClick",getRootElement(),att) -- 4º Part Open function open() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end addEvent("opening",true) addEventHandler("opening",getRootElement(),open) -- 5º Part Close function close() if (source == GUIEditor_Button[15]) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end end addEventHandler("onClientGUIClick",getRootElement(),close) -- server side: --[[-- Script Made By Maria --]]-- function flo ( source ) giveWeapon(source,14,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00FLOWER#ffffff!",source,255,255,255,true) end addEvent( "flower", true ) addEventHandler( "flower", getRootElement(), flo ) function dil ( source ) giveWeapon(source,10,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00DILDO#ffffff!",source,255,255,255,true) end addEvent( "dildo", true ) addEventHandler( "dildo", getRootElement(), dil ) function vib ( source ) giveWeapon(source,12,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00VIBRATOR#ffffff!",source,255,255,255,true) end addEvent( "vibra", true ) addEventHandler( "vibra", getRootElement(), vib ) function cam ( source ) giveWeapon(source,43,10) outputChatBox("#ff0000* #ffffffYou get one #00ff00CAMERA#ffffff!",source,255,255,255,true) end addEvent( "came", true ) addEventHandler( "came", getRootElement(), cam ) function nv ( source ) giveWeapon(source,44,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00NIGHT-VISION GOGGLES#ffffff!",source,255,255,255,true) end addEvent( "niv", true ) addEventHandler( "niv", getRootElement(), nv ) function en ( source ) giveWeapon(source,45,1) outputChatBox("#ff0000* #ffffffYou get one #00ff00INFRARED GOGGLES#ffffff!",source,255,255,255,true) end addEvent( "ifn", true ) addEventHandler( "ifn", getRootElement(), en) function shar ( source ) shark1 = createObject(1608,0,0,3) attachElements(shark1, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,shark1) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00SHARK#ffffff! (1 min)",source,255,255,255,true) end addEvent( "sar", true ) addEventHandler( "sar", getRootElement(), shar) function lov ( source ) love = createObject(1240,0,0,0) attachElements(love, source,0,0,1.5) setTimer(destroyElement,60000,1,love) outputChatBox("#ff0000* #ffffffYou get a #00ff00HEART#ffffff at your head! (1 min)",source,255,255,255,true) end addEvent( "love", true ) addEventHandler( "love", getRootElement(), lov) function mon ( source ) money = createObject(1550,0,0,3) attachElements(money, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,money) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00MONEY BAG#ffffff! (1 min)",source,255,255,255,true) end addEvent( "mo", true ) addEventHandler( "mo", getRootElement(), mon) function tur ( source ) turtl1 = createObject(1609,0,0,3) attachElements(turtl1, source,0,0,0) setElementAlpha(source, 0) setTimer(destroyElement,60000,1,turtl1) setTimer(setElementAlpha,60000,1,source,255) outputChatBox("#ff0000* #ffffffYou be a #00ff00TURTLE#ffffff! (1 min)",source,255,255,255,true) end addEvent( "tu", true ) addEventHandler( "tu", getRootElement(), tur) function open(source) if (getElementData(source, "userr") == "[bW]") then triggerClientEvent (source, "opening", getLocalPlayer()) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("Admin")) then triggerClientEvent (source, "opening", source) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("Moderator")) then triggerClientEvent (source, "opening", source) else acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup("HeadAdmin")) then triggerClientEvent (source, "opening", source) end end end end end addCommandHandler("codm",open) I've fixed another error in yoru script also, you forgot to put twice "localPlayer" in the triggerServerEvent function(s).
-
Why didn't you said that the script is not working at all? you named 3 labels with numbers, that's not possible, and that causes errors. P.S. dxDrawText also has errors. Edit: In general, your script is a total mess, full of bugs, is not the exported function the problem. Edit2: I've fixed all the errors shown in the debugscript, but I don't know what is this, so you'll have to fix the rest. x,y = guiGetScreenSize() l1 = guiCreateLabel(x,0,0,0,"",false) l2 = guiCreateLabel(x,0,0,0,"",false) l3 = guiCreateLabel(x,0,0,0,"",false) guiSetVisible(l1,false) guiSetVisible(l2,false) guiSetVisible(l3,false) gc1 = guiCreateLabel(x,0,0,0,"-65536",false) gc2 = guiCreateLabel(x,0,0,0,"-65536",false) gc3 = guiCreateLabel(x,0,0,0,"-65536",false) guiSetVisible(gc1,false) guiSetVisible(gc2,false) guiSetVisible(gc3,false) function deseneaza() x,y = guiGetScreenSize() t1 = guiGetText(l1) t2 = guiGetText(l2) t3 = guiGetText(l3) a = 0.02 dxDrawText(t1,a*x,0.685*y,1,1,tocolor(255,255,255,255),1.2,"arial") dxDrawText(t2,a*x,0.655*y,1,1,tocolor(255,255,255,255),1.2,"arial") dxDrawText(t3,a*x,0.625*y,1,1,tocolor(255,255,255,255),1.2,"arial") end addEventHandler("onClientRender",root,deseneaza) setTimer( function() removeEventHandler("onClientRender", getRootElement(),deseneaza) end, 1300,0) function opGT(text,c1,c2,c3) local time = getRealTime() local hours = time.hour local minutes = time.minute local secs = time.second if hours < 10 then hours = "0"..hours end if minutes < 10 then minutes = "0"..minutes end if secs < 10 then secs = "0"..secs end theTime = hours..":"..minutes..":"..secs t1 = guiGetText(l1) t2 = guiGetText(l2) t3 = guiGetText(l3) guiSetText(l2,t1) guiSetText(l3,t2) tc1 = guiGetText(gc1) tc2 = guiGetText(gc2) tc3 = guiGetText(gc3) guiSetText(gc2,tc1) guiSetText(gc3,tc2) guiSetText(gc1,"["..theTime.."] "..text) c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) color = tocolor(c1,c2,c3) return "true: added text '"..text.."'" end setTimer(opGT,500,299,"Hello world",255,0,70) addEvent("callOpGT",true) addEventHandler("callOpGT",root, function(text,c1,c2,c3) opSGT(text,c1,c2,c3) end) function opSGT(text,c1,c2,c3) t1 = guiGetText(l1) t2 = guiGetText(l2) t3 = guiGetText(l3) guiSetText(l2,t1) guiSetText(l3,t2) tc1 = guiGetText(gc1) tc2 = guiGetText(gc2) tc3 = guiGetText(gc3) guiSetText(gc2,tc1) guiSetText(gc3,tc2) guiSetText(l1,text) c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) color = tocolor(c1,c2,c3) end
-
Is that function in a client side script? P.S: Did you add some debug outputs to the opGT function?
-
I meant, the script where you call that function from, not the script with the exported function.
-
Can you show me the script where you are using it?
-
Are you sure the exported function is set to type="client" in the meta.xml?
-
What error do you get? is the resource running?
-
call function needed that too, so I didn't think it was necessary.
-
qais, isn't that the same script as I mine..?
-
Use exports instead. ex: exports["myResource"]:myFunction()
-
function onPlayerSpawn ( ) spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam) -- spawns player with random skin end addEventHandler("onPlayerWasted",root,onPlayerSpawn)
-
That's wrong, use this: local serials = { ["CE99D8528E47A68C3BEAC89638D7A344"] = true, } function autounban(banPointer) local serial = getBanSerial(banPointer) local ip = getBanIP(banPointer) for index, ban in pairs(getBans()) do if serials[serial] and getBanSerial(ban) == serial or getBanIP(ban) == ip then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban)
-
Do this, make a list of serials in a table, then when someone get's banned, compare their serials.
-
Well, here works perfectly, are you sure you are banning by serial? I get no bad argument and in console says: "UNBAN: A ban was removed by Console" P.S: I've added to check IP too, function autounban(banPointer) local serial = getBanSerial(banPointer) local ip = getBanIP(banPointer) for index, ban in pairs(getBans()) do if getBanSerial(ban) == serial or getBanIP(ban) == ip then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban)
-
What exactly doesn't work? do you get any error? P.S: Is this script added in acl.xml group "Admin"?
-
Because, you are trying to get the ban serial of the player, not the ban pointer. function autounban(banPointer) local serial = getBanSerial(banPointer) for index, ban in pairs(getBans()) do if getBanSerial(ban) == serial then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban) You can't unban from a IP/serial If i'm right, you need to remove the ban himself.
-
The dxDrawColorText function? I could find this one: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end
