-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I'm not sure of what are you talking about..
-
triggerServerEvent ( getLocalPlayer(), "nameOfYourEvent", getLocalPlayer(), elementToPass ) the first getLocalPlayer() in client side is not needed if i'm right (at least i never use it)
-
passing what element?
-
of course it won't work if you put GUIEditor_Window[4]! your GUI-window element is GUIEditor_Window[1]. GUIEditor_Window = {} GUIEditor_Progress = {} GUIEditor_Window[1] = guiCreateWindow(473,483,398,201,"",false) --GUIEditor_Progress[1] = guiCreateProgressBar(64,24,274,26,false,GUIEditor_Window[1]) scrollBar = guiCreateScrollBar(64,24,274,26,true,false,GUIEditor_Window[1])
-
booma, mind explaining how?
-
you are just making random code and expecting us to fix it for you.
-
<meta> <script src="blips.lua" type="server"/> </meta> createBlip ( 4262.7416992188, -1555.828125, 43.400787353516, 3 ) createBlip ( 4651.177734375, -1554.4113769531, 25.819654464722, 11 ) createBlip ( 5051.4858398438, -1583.2768554688, 57.828727722168, 23 ) createBlip ( 5006.5146484375, -1283.5164794922, 85.884986877441, 33 ) createBlip ( 4856.8994140625, -1413.4611816406, 85.478088378906, 41 ) createBlip ( 4680.8935546875, -1610.9580078125, 104.85077667236, 48 ) createBlip ( 4667.119140625, -1711.8497314453, 110.76747131348, 53 ) i think should work. P.S: please use LUA tags
-
why don't you just use giveWeapon for everything? it gives the ammo too. function showgui () weapwindow = guiCreateWindow(307,127,480,516,"Weapons Menu",false) BuyAK = guiCreateButton(95,76,117,59,"Ak47 - 500$",false,weapwindow) BuyM4 = guiCreateButton(96,154,116,57,"M4 - 600$",false,weapwindow) BuyMP5 = guiCreateButton(97,302,116,57,"MP5 - 400$",false,weapwindow) BuyUZI = guiCreateButton(96,227,116,57,"UZI - 350$",false,weapwindow) BuyShotgun = guiCreateButton(278,300,117,59,"Shotgun - 400$",false,weapwindow) BuyComShot = guiCreateButton(278,227,117,59,"Combat Shotgun - 450$",false,weapwindow) BuyDeagle = guiCreateButton(277,76,117,59,"Deagle - 200$",false,weapwindow) BuyPistol = guiCreateButton(277,152,117,59,"Pistol - 150$",false,weapwindow) CloseButton = guiCreateButton(180,375,108,41,"Close",false,weapwindow) Text_Memo = guiCreateMemo(97,435,260,45,"You can buy weapons here for in DM.",false,weapwindow) guiMemoSetReadOnly(Text_Memo,true) guiSetVisible ( weapwindow, true ) showCursor(true) addEventHandler("onClientGUIClick", BuyAK, getAK, false) addEventHandler("onClientGUIClick", CloseButton, hidegui, false) end function hidegui() if guiGetVisible ( weapwindow ) then guiSetVisible ( weapwindow, false ) showCursor( false ) end end addCommandHandler ( "weapons", showgui ) function getAK ( playerSource ) local money = getPlayerMoney ( getLocalPlayer() ) if (money > 500) then triggerServerEvent( "playerwantsAK", getLocalPlayer(), getLocalPlayer()) else outputChatBox("You don't have enough cash.", 230,0,0) end end addEvent("playerwantsAK",true) addEventHandler("playerwantsAK",getRootElement(), function (client) giveTheAK = giveWeapon(client, 30, 400, true) if giveTheAK then outputChatBox("You now have a: AK",source,0,230,0) else outputChatBox("failed to give AK",source,0,230,0) end end )
-
wepcol = createColCuboid ( 1495.6212158203, -3100.0891113281, 87.07982635498, 2, 5, 2 ) root = getRootElement() function render() dxDrawText("Press [O] for a M4 (1400$)",329.0,412.0,482.0,425.0,tocolor(255,200,0,255),0.9,"default-bold","left","top",false,false,false) end function enter() addEventHandler("onClientRender", root, render) bindKey( "O", "down", m4) outputChatBox("O BINDED", root, 255, 0, 0) -- TEST MESSAGE end addEventHandler("onClientColShapeHit", wepcol, enter) function leave() removeEventHandler("onClientRender", root, render) unbindKey( "O", "down", m4) outputChatBox("O UNBINDED", root, 255, 0, 0) -- TEST MESSAGE end addEventHandler("onClientColShapeLeave", wepcol, leave) function m4(theElement, matchingDimension) triggerServerEvent( "giveM4", getLocalPlayer(),getLocalPlayer()) end addEvent("giveM4", true) function giveMeM4(client) if getPlayerMoney (client) >= 1400 then giveWeapon(client, 31, 100) outputChatBox("Ka ching!", client, 0, 255, 0) -- TEST MESSAGE else outputChatBox("You dont have enough money!", client, 255, 0, 0) end end addEventHandler ( "giveM4", getRootElement(), giveMeM4 )
-
If you want to pay then you will have more luck getting one
-
I didn't, i tried many times and no luck.
-
Too lazy to post what was wrong on your code (i didn't sleep yet)
-
function renamePlayer () if ( string.lower ( getPlayerName ( source ) ) == string.lower ( "Player" ) ) then local name = "Player_" .. math.random ( 1, 99 ) while getPlayerFromName ( name ) do local name = "Player_" .. math.random ( 1, 99 ) end setPlayerName ( source, name ) end end addEventHandler ( "onPlayerJoin", getRootElement(), renamePlayer )
-
WorksToCensor = { "hacker", "hack", "cheater", "cheat", "Hacker", "Hack", "Cheater", "Cheat" } function checkorcensure (message,messageType) local strings = split ( message , 32 ) for i, v in pairs ( strings ) do str = string.lower ( v ) for a, b in pairs ( WorksToCensor ) do if ( string.find ( str, b ) ) then outputChatBox("Use /report!", source) cancelEvent() end end end end addEventHandler("onPlayerChat", getRootElement(), checkorcensure) i think it works
-
Cmon XX3! we all know this project was a fail from the beggining (this was full community scripts and so on)
-
Callum, i use "type" in many scripts and never had any problem with it.
-
I'm not completely sure of what are you talking about, you want to login in-game? if yes type /login
-
You are creating 1 tab panel for every tab o_O why you think its called "tab panel"? you have to create only ONE then add the tabs. UserP = guiCreateWindow(0.10, 0.15, 0.8, 0.7, getPlayerName(player).. "'s user panel:", true) tabPanel = guiCreateTabPanel(0.02, 0.13, 1, 0.8, true, UserP) ShopTab = guiCreateTab("Shop", tabPanel) StatsTab = guiCreateTab("Stats", tabPanel)
-
Axelectric_, no need to say what has been said many times.
-
i guess you have a grid list, right? then you have to trigger an event when you open the panel/change tab: server side: function mapsList() local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) local type = getResourceInfo ( resourceValue, "type" ) local game = getResourceInfo ( resourceValue, "gamemodes" ) if type == "map" and game == "race" then triggerClientEvent ( "sendMaps", getRootElement(), name) else cancelEvent() end end end addEvent("getMaps", true) addEventHandler("getMaps", getRootElement(), mapsList) then you will send them to client side: addEvent("sendMaps", true) addEventHandler("sendMaps", getRootElement(), function (name) local row = guiGridListAddRow(buyMapGrid) guiGridListSetItemText ( buyMapGrid, row, 1, name, false, false ) end)
-
addCommandHandler("god", function (thePlayer) setElementData ( getLocalPlayer(), "godmode", true ) addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelalldamage ) end ) function cancelalldamage ( ) godonoroff = getElementData ( source, "godmode" ) if ( godonoroff == true ) then if getElementDimension ( source ) == 0 then cancelEvent() end end end
-
client side: function giveWeapon(wID,wAmmo) triggerServerEvent("giveW",getLocalPlayer(),wID,ammo) end server side: root = getRootElement() function gW(gid,gammo) giveWeapon(source,tostring(gid),tostring(gammo)) end addEvent("giveW",true) addEventHandler("giveW",root,gW)