-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
MYSQL Database [Solved] Anyone Who Has MYSQL PROBLEM COME
Saml1er replied to 3B00DG4MER's topic in Scripting
function testsql(p) connection = dbConnect( "mysql", "dbname=cir;host=localhost", "mtaserver", "game2020", "share=1" ) dbExec( connection, "INSERT INTO names VALUES (?,?)", 4, "test2" ) local allnames = dbQuery( connection, "SELECT * FROM names") local result = dbPoll(allnames, -1) if #result ~= 0 then triggerClientEvent(p,"onStart",p,result) end end addCommandHandler("testmysql",testsql) -
local clans = {"KekZ|","[Wild]"} -- insert as many clans you want function banPlayer2 () local player = source for _ ,v in pairs (clans) do local v = v:upper() local pname = getPlayerName ( player ):gsub("#%x%x%x%x%x%x", ""):upper() -- remove those color codes and lets find clantag using uppercase if pname:find(v, 1, true) then banPlayer ( player, true ) --- Btw players can easily change ip so this banning method is not so secure, do it with serials. end end end addEventHandler ( "onPlayerChangeNick", getRootElement(), banPlayer2) addEventHandler ( "onPlayerJoin", root, banPlayer2) EDIT: aaaaa, max.
-
You can ask MTA developers in Irc ( mta scripting channel ).
-
Sigmar is lobby script... It's not race gamemode and on the top of that sigmar is leaked script. Lock this topic. eeeh.
-
That doesn't make much sense... The reason is that ammo data is only kept as long as the ped is streamed in. If the ped is streamed out after or while the weapon is given (that includes giving the weapon right after ped creation when it's not streamed in yet), then upon streaming in it will only have one bullet. The workaround is to give the weapon again, which can be done using repeatedly executing timer. You're right. That can be the reason, I totally forgot about that. I experienced this problem once with slothbot resource.
-
I think you want to do it for a specific player, right? You don't want it for everyone?
-
if it's small one then I'll help you for free.
-
Thank you. You're welcome.
-
Even though you found a solution but tell me tell you the reason why you couldn't see the ped shooting. Since setPedControlState is client side event and only the client can see him shooting. For example, player1 = getRandomPlayer() triggerClientEvent(player1,"onClientControlTrigger", player1) -- Now this event is triggered for player1 only and player1 can only see what's happening ;P
-
I'll show you another way. objects = { {1237, 2838.873, 1712.0601, 9.844}, {1237, 2855.843, 1712.0601, 9.844}, {1237, 2823.625, 1712.0601, 9.844} } for placeNumber, elementData in ipairs(objects) do local obj = createObject(elementData[1], elementData[2], elementData[3], elementData[4]) if obj then objects[placeNumber] = obj end end
-
Are you talking about a top bar which is used for advertising gang etc in RPG servers?
-
Can you tell us what are you trying to do? Just as TAPL said "Why are you using an element data whereas you can simply use: doesPedHaveJetPack ? "
-
You SQL,MySql or Db functions to insert/retrieve owners.
-
Hello! I have a shooter map and I saw that there is a script : function palm () palmtxd = engineLoadTXD("Bullet.txd") engineImportTXD(palmtxd, 541) local palmdff = engineLoadDFF('Bullet.dff', 0) engineReplaceModel(palmdff, 541) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), palm ) When the map is loaded + Players are warped into vehicles then those textures are loaded and when they are loaded then ped is removed from vehicle. But if I use this: palmtxd = engineLoadTXD("Bullet.txd") engineImportTXD(palmtxd, 541) local palmdff = engineLoadDFF('Bullet.dff', 0) engineReplaceModel(palmdff, 541) Then everything works fine. The source of onClientResourceStart event is causing this.. Hmmm.. I really dunno why is this even happening because loading textures has nothing to do with removing ped from vehicle. If I don't find a good solution then I'll load the map scripts first and then warp peds into vehicles. Is this MTA bug? NOTE: I'm using a custom gamemode.
-
Ah, I haven't seen this topic since a while. local gate = createObject(3114, -3362.0400390625, 2425.9689941406, 9.4750003814697, 0, 0, 270) local marker = createMarker(-3364.6000976563, 2414, 10, "cylinder", 1, 255, 255, 255, 0) function isAclGroup(p,group) if p and getElementType(p) == "player" and type(group) == "string" then local Deadusergroup = getAccountName(getPlayerAccount(p)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup(group)) then return true else return false end else return false end end function moveGate(psource) if isAclGroup(psource,"PST_Army") then moveObject(gate, 5000, -3362.0400390625, 2425.9499511719, 16.540000915527) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack(pp) moveObject(gate, 5000, -3362.0400390625, 2425.9689941406, 9.4750003814697) end addEventHandler("onMarkerLeave", marker, moveBack) Everything should work fine now btw your group name was "PST_Army" not "Dead".
-
local gate = createObject(3114, -3362.0400390625, 2425.9689941406, 9.4750003814697, 0, 0, 270) local marker = createMarker(-3364.6000976563, 2414, 10, "cylinder", 1, 255, 255, 255, 0) function isAclGroup(p,group) if p and getElementType(p) == "player" and type(group) == "string" then local Deadusergroup = getAccountName(getPlayerAccount(p)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup(group)) then return true else return false end else return false end end function moveGate(psource) if isAclGroup(psource,group) then moveObject(gate, 5000, -3362.0400390625, 2425.9499511719, 16.540000915527) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack(pp) if isAclGroup(pp,group) then moveObject(gate, 5000, -3362.0400390625, 2425.9689941406, 9.4750003814697) end end addEventHandler("onMarkerLeave", marker, moveBack)
-
You can create a nice fadeIn and FadeOut effect using getTickCount
-
What do you want tho?
-
You're welcome but I don't have your server side code so I didn't notice that when a player clicks a button then it will be triggered twice means player will lose money two times so just use this: function buttonsz (button,state) if buttton == "left" and state == "down" then --if down does not work then place it with "up" if source == weapons.close then guiSetVisible(weapons.window,false) showCursor ( false ) ------- If you want to make your code a little more better then use 1 triggerServerEvent. You can use variables for that elseif source == weapons.M4 then triggerServerEvent("buyWeapon",getLocalPlayer(),"M4","2000","31","100") elseif source == weapons.Eagle then triggerServerEvent("buyWeapon",getLocalPlayer(),"Desert Eagle","500","24","50") elseif source == weapons.MP5 then triggerServerEvent("buyWeapon",getLocalPlayer(),"MP5","1000","29","100") elseif source == weapons.Pistol then triggerServerEvent("buyWeapon",getLocalPlayer(),"Pistol","100","22","50") elseif source == weapons.SPAZ12 then triggerServerEvent("buyWeapon",getLocalPlayer(),"SPAZ-12","1500","27","90") elseif source == weapons.AK47 then triggerServerEvent("buyWeapon",getLocalPlayer(),"AK-47","1200","30","100") end end end addEventHandler ( "onClientGUIClick", root, buttonsz )
-
I did another small fix after testing it in my local server and its working now. local weapons = { } -- lets use 1 table weapons.window = guiCreateWindow(471, 218, 367, 511, "WeAmmu Nation v1.0", false) guiWindowSetMovable(weapons.window, false) guiWindowSetSizable(weapons.window, false) guiSetVisible(weapons.window,true) -- lets put this here, just to make it easy for you weapons.M4 = guiCreateButton(9, 50, 105, 41, "M4 \n2000$", false, weapons.window) guiSetProperty(weapons.M4, "NormalTextColour", "FFAAAAAA") weapons.Eagle = guiCreateButton(124, 50, 105, 41, "Desert Eagle \n500$", false, weapons.window) guiSetProperty(weapons.Eagle, "NormalTextColour", "FFAAAAAA") weapons.MP5 = guiCreateButton(239, 50, 105, 41, "MP5\n1000$", false, weapons.window) guiSetProperty(weapons.MP5, "NormalTextColour", "FFAAAAAA") weapons.Pistol = guiCreateButton(9, 101, 105, 41, "Pistol\n100$", false, weapons.window) guiSetProperty(weapons.Pistol, "NormalTextColour", "FFAAAAAA") weapons.SPAZ12 = guiCreateButton(124, 101, 105, 41, "SPAZ-12\n1500$", false, weapons.window) guiSetProperty(weapons.SPAZ12, "NormalTextColour", "FFAAAAAA") weapons.AK47 = guiCreateButton(239, 101, 105, 41, "AK-47\n1200$", false, weapons.window) guiSetProperty(weapons.AK47, "NormalTextColour", "FFAAAAAA") weapons.close = guiCreateButton(329, 19, 28, 27, "X", false, weapons.window) guiSetProperty(weapons.close, "NormalTextColour", "FFAAAAAA") local WeANmarker = createMarker ( 777, -2070, 11.5, "cylinder", 2, 0, 128, 0, 170 ) -- -- -- function WeANmarkerEnter () if source == WeANmarker then guiSetVisible(weapons.window,true) showCursor ( true ) end end addEventHandler ( "onClientMarkerHit", getRootElement(), WeANmarkerEnter ) function buttonsz () if source == weapons.close then guiSetVisible(weapons.window,false) showCursor ( false ) ------- If you want to make your code a little more better then use 1 triggerServerEvent. You can use variables for that elseif source == weapons.M4 then triggerServerEvent("buyWeapon",getLocalPlayer(),"M4","2000","31","100") elseif source == weapons.Eagle then triggerServerEvent("buyWeapon",getLocalPlayer(),"Desert Eagle","500","24","50") elseif source == weapons.MP5 then triggerServerEvent("buyWeapon",getLocalPlayer(),"MP5","1000","29","100") elseif source == weapons.Pistol then triggerServerEvent("buyWeapon",getLocalPlayer(),"Pistol","100","22","50") elseif source == weapons.SPAZ12 then triggerServerEvent("buyWeapon",getLocalPlayer(),"SPAZ-12","1500","27","90") elseif source == weapons.AK47 then triggerServerEvent("buyWeapon",getLocalPlayer(),"AK-47","1200","30","100") end end addEventHandler ( "onClientGUIClick", root, buttonsz )