-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
What do you mean? I would suggest using SQL to store gangs/gang members.
-
I don't know if basemode has a event for when the round finishes.
-
You have a missing 'end'. function grenadekill ( killer, weapon, bodypart ) if ( weapon == 16 ) then --if the weapon used was the grenade local sound = playSound("Perfect.mp3") setSoundVolume(sound, 0.5) -- set the sound volume to 50% end end addEventHandler("onClientPlayerWasted",getLocalPlayer(),grenadekill)
-
Every GUI element is able to be used with that event handler.
-
Lo abrire de nuevo, bajo la condicion de que no hagan mas off-topic (eso estaban haciendo).
-
Vuelvan al tema o voy a tener que cerrar el post.
-
outputChatBox("Health_Pickup|By[xiGooglex]",255,255,0) function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) local x, y, z = getElementPosition ( source ) local health = createPickup ( x, y, z, 0, 40) addEventHandler("onPickupHit", health, givePlayerHealth) end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) function givePlayerHealth(thePlayer) outputChatBox(tostring(getPlayerName(thePlayer)) .." has picked up health.",getRootElement(),0,255,0) setElementHealth(thePlayer,tonumber(getElementHealth(thePlayer))+tonumber(getPickupAmount(source))) destroyElement(source) end
-
The only function I could see in vehicle-system resource seems to check if they are in water every 10 minutes. File: vehicle-system/s_vehicle_system.lua
-
You welcome. He forgot about me .
-
Yes, I would do that, because If I'm right, you are triggering it to all this way.
-
Use onClientKey instead of bindKey, this way it works with the input too. function finishNow() if (guiGetVisible(logGui) == true) then local username = guiGetText(user_edit) local password = guiGetText(pass_edit) if (username ~= "") and (password ~= "") then triggerServerEvent("log",getRootElement(),username,password,gui) else outputChatBox("*INFO*: Please enter your username and password",getLocalPlayer(),255,0,0) end elseif (guiGetVisible(regGui) == true) then local username = guiGetText(user_edit1) local password = guiGetText(pass_edit1) if (username ~= "") and (password ~= "") then triggerServerEvent("reg",getRootElement(),username,password) else outputChatBox("*INFO*: Please enter a username and password",getLocalPlayer(),255,0,0) end end end addEventHandler("onClientResourceStart",resourceRoot,function() addEventHandler("onClientKey", root, onEnterKeyPressed) end) addEvent("c1",true) addEventHandler("c1",getRootElement(),function() if (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then removeEventHandler("onClientKey", root, onEnterKeyPressed) destroyElement(img) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end) addEvent("c2",true) addEventHandler("c2",getRootElement(),function() if (guiGetVisible(regGui) == true) and (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then removeEventHandler("onClientKey", root, onEnterKeyPressed) destroyElement(img) destroyElement(regGui) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end) function onEnterKeyPressed(button, press) if (press and button=="enter") then finishNow() end end
-
If you have the input enabled, then the binds won't work.
-
Like I told you before, the key is not being binded, because onClientPlayerJoin is only triggered by other players, not the CLIENT, use onClientResourceStart instead. function finishNow() if (guiGetVisible(logGui) == true) then local username = guiGetText(user_edit) local password = guiGetText(pass_edit) if (username ~= "") and (password ~= "") then triggerServerEvent("log",getRootElement(),username,password,gui) else outputChatBox("*INFO*: Please enter your username and password",getLocalPlayer(),255,0,0) end elseif (guiGetVisible(regGui) == true) then local username = guiGetText(user_edit1) local password = guiGetText(pass_edit1) if (username ~= "") and (password ~= "") then triggerServerEvent("reg",getRootElement(),username,password) else outputChatBox("*INFO*: Please enter a username and password",getLocalPlayer(),255,0,0) end end end addEventHandler("onClientResourceStart",resourceRoot,function() bindKey("enter","down",finishNow) end) addEvent("c1",true) addEventHandler("c1",getRootElement(),function() if (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then unbindKey("enter","down",finishNow) destroyElement(img) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end) addEvent("c2",true) addEventHandler("c2",getRootElement(),function() if (guiGetVisible(regGui) == true) and (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then unbindKey("enter","down",finishNow) destroyElement(img) destroyElement(regGui) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end)
-
I think you are never binding the keys at all. function finishNow() if (guiGetVisible(logGui) == true) then local username = guiGetText(user_edit) local password = guiGetText(pass_edit) if (username ~= "") and (password ~= "") then triggerServerEvent("log",getRootElement(),username,password,gui) else outputChatBox("*INFO*: Please enter your username and password",getLocalPlayer(),255,0,0) end elseif (guiGetVisible(regGui) == true) then local username = guiGetText(user_edit1) local password = guiGetText(pass_edit1) if (username ~= "") and (password ~= "") then triggerServerEvent("reg",getRootElement(),username,password) else outputChatBox("*INFO*: Please enter a username and password",getLocalPlayer(),255,0,0) end end end bindKey("enter","down",finishNow) addEvent("c1",true) addEventHandler("c1",getRootElement(),function() if (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then unbindKey("enter","down",finishNow) destroyElement(img) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end) addEvent("c2",true) addEventHandler("c2",getRootElement(),function() if (guiGetVisible(regGui) == true) and (guiGetVisible(logGui) == true) and (guiGetVisible(img) == true) then unbindKey("enter","down",finishNow) destroyElement(img) destroyElement(regGui) destroyElement(logGui) showCursor(false) guiSetInputEnabled(false) end end)
-
Solidsnake14 plz help me trying to make shop work
Castillo replied to IIIIlllllIII's topic in Scripting
I took off his triggerServerEvent because it was wrong. -
Solidsnake14 plz help me trying to make shop work
Castillo replied to IIIIlllllIII's topic in Scripting
For your information, TAPL, the author is trying to script a SHOP script, seriously, did you make that reply just to gain post count? because... that's what it looks like. Now, back on topic. In order to give the player a weapon, you'll need a trigger to the server side, because giveWeapon is only server side. I fixed your script errors, but I didn't make the script to give the weapons, you'll need to learn how to. function initGUI( ) shopWindow = guiCreateWindow(220,100,544,435,"Shop MOJRM-511 1.1",false) guiSetVisible (shopWindow, false) guiWindowSetSizable(shopWindow,false) guiWindowSetMovable(shopWindow,false) tabPanel = guiCreateTabPanel(11,23,544,472,false,shopWindow) tab = guiCreateTab("info",tabPanel) tab = guiCreateTab("buy weapons",tabPanel) --------- ????? 1 -line 1 ----- guiCreateStaticImage( 10,10,90,75, "weapon/4.png", false,tab ) weapButton = guiCreateButton(10,80,90,30,"$500 knif",false,tab) addEventHandler ( "onClientGUIClick", weapButton, outputEditBox, false ) editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, " has been buy it knif", false ) ------------------------------------ guiCreateStaticImage( 110,10,90,75, "weapon/2.png", false,tab ) weapButton = guiCreateButton(110,80,90,30,"$900 dod",false,tab) --------------------------------- guiCreateStaticImage( 210,10,90,75, "weapon/3.png", false,tab ) weapButton = guiCreateButton(210,80,90,30,"M4",false,tab) --------------------------------- guiCreateStaticImage( 310,10,90,75, "weapon/1.png", false,tab ) weapButton = guiCreateButton(310,80,90,30,"M4",false,tab) -------------------------------- guiCreateStaticImage( 410,10,90,75, "weapon/5.png", false,tab ) weapButton = guiCreateButton(410,80,90,30,"M4",false,tab) -------------------------2 ????? guiCreateStaticImage( 10,110,90,80, "weapon/6.png", false,tab ) weapButton = guiCreateButton(10,190,90,30,"M4",false,tab) guiCreateStaticImage( 110,110,90,80, "weapon/7.png", false,tab ) weapButton = guiCreateButton(110,190,90,30,"M4",false,tab) guiCreateStaticImage( 210,110,90,80, "weapon/8.png", false,tab ) weapButton = guiCreateButton(210,190,90,30,"M4",false,tab) guiCreateStaticImage( 310,110,90,80, "weapon/9.png", false,tab ) weapButton = guiCreateButton(310,190,90,30,"M4",false,tab) guiCreateStaticImage( 410,110,90,80, "weapon/10.png", false,tab ) weapButton = guiCreateButton(410,190,90,30,"M4",false,tab) end addEventHandler( "onClientResourceStart", resourceRoot, initGUI ) function outputEditBox ( button ) if button == "left" then local text = guiGetText ( editBox ) outputChatBox ( text ) end end bindKey ( "F2" , "down" , function() guiSetVisible ( shopWindow , not guiGetVisible ( shopWindow ) ) showCursor ( guiGetVisible ( shopWindow ) ) end ) Functions you need: triggerServerEvent addEvent addEventHandler -
Do you think someone would want to handle a server with a unknown guy? you don't even give information about the server, like, what gamemode uses, what style, features, and so on.
-
You welcome.
-
Try with this one; http://pastebin.com/HKhiJg82
-
Weird, maybe your buttons are wrong?
-
I couldn't send it because of that bug, so I uploaded it to pastebin. http://pastebin.com/xMvX1UK9
-
You welcome. P.S: Bandi, getResourceInfo is server only.
-
Something is wrong with the forum, I'll send it via PM. Edit: I don't know what's the problem, it says the message contains too few characters, but it has a lot.
-
There's an example in here: https://wiki.multitheftauto.com/wiki/DxCreateFont Just read it, it's already well explained.
-
What do you mean? if you want to create a new font and use it, just create it and change the font to yours in the dxDrawText function.
