-
Posts
1,423 -
Joined
-
Last visited
-
Days Won
19
Everything posted by Tekken
-
Ok, what exactly do you need help with?
-
Exactly the same you did with onClientClick but with your gui() function.
-
Hi, you have my simple level system in my signature, however you need to setup the rewards by yourself, is not that complicated. Also moved your topic to resources section as this is more a request than a scripting question.
-
getPedAnimation Gets the animation of a player or ped that was set using setPedAnimation. That might not work @Skully (Not sure tho)
-
Try: /stop joinquit in chat. (if I remember correctly that’s how it’s called the default join/quit resource)
-
There you go, best tutorial out there:
- 1 reply
-
- 1
-
-
That's a lot of work just to get the rotation
-
Try 0 as x and y rotation as for now you set the actual x and y positions
-
Try checking if target is element rather than checking if target is different then nil
-
Have you tried conformPedRotation = true https://wiki.multitheftauto.com/wiki/SetElementRotation not sure but worth giving a try
-
function getPositionInfrontOfElement ( element , meters ) if not element or not isElement ( element ) then return false end if not meters then meters = 3 end local posX , posY , posZ = getElementPosition ( element ) local _ , _ , rotation = getElementRotation ( element ) posX = posX - math.sin ( math.rad ( rotation ) ) * meters posY = posY + math.cos ( math.rad ( rotation ) ) * meters return posX , posY , posZ end Use it like that: local fx, fy, fz = getPositionInfrontOfElement(player, 5); -- get the x,y,z positions 5 meters in front of player! createObject(OBJECTID, fx, fy, fz); Remember getPositionInfrontOfElement is a useful function so you will have to paste the code above in order to work!
-
Have you seen my message?
-
If you use attachElements you use the y pos ex. y+2
-
When you trigger bp() function in your script ? To me it looks like you just pasted that function there but you don’t even call it at all! you have the onElementDataChange event to check whenever an elements data changed you should use that event to check whether the opexp have changed and then call the function to give potential reward. You may check my simple level system if you still don’t get it working, it’s in my signature. Good luck.
-
What zombie script are you using ?
-
Hi, for that you will need the following functions: bindKey createObject attachElements (maybe?) and you have to do it in server side to assure others will see it! Good luck, and if you need help we’re here!
-
Hello, I’ve moved your topic to Resources section for best results, as the scripting section is for scripting related questions and not for script requests! Greetings.
-
I am getting this (Expected element at arguement 1 got nil) help me
Tekken replied to Steve_Rogerzz's topic in Scripting
May I see the updated script? Correct form: function storerob(player commandName) -- define player in function! -- no need to create 50+ functions, everything can be done in the same function. local money = math.random(200000, 400000); outputChatBox(" ", root); outputChatBox("-----------------------------------------------------", root, 255, 0, 0); outputChatBox("[ALERT] Someone has breaked the Locker in Store !!", root, 255, 0, 0); outputChatBox("-----------------------------------------------------", root, 255, 0, 0); outputChatBox(" ", root); outputChatBox("Robbing the money ...", player, 0, 255, 0); outputChatBox(" ", player); outputChatBox("------------------------------------------------------", player, 0, 255, 0); outputChatBox("You got $"..money.." by robbing a Store !! ", player, 0, 255, 0); outputChatBox("------------------------------------------------------", player, 0, 255, 0); outputChatBox(" ", player); givePlayerMoney(player, money); end addCommandHandler("robstore", storerob); -
I am getting this (Expected element at arguement 1 got nil) help me
Tekken replied to Steve_Rogerzz's topic in Scripting
edit: moved the topic to scripting section for best results! -
I am getting this (Expected element at arguement 1 got nil) help me
Tekken replied to Steve_Rogerzz's topic in Scripting
Most likely loope() and money2() player argument not passed through the function You will need to pass the player like this loope( player ) money2( player ) -
Hello, please use <> when positing codes! You can't use login() function on client side, you will have to add a server event and call it from client, here you have a simple example: Client.lua function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Account Panel", true) guiWindowSetMovable(wdwLogin, false) -- define new X and Y positions for the first label X = 0.0825 Y = 0.15 -- define new Width and Height values for the first label Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window) guiCreateLabel(X, Y, Width, Height, "First name", true, wdwLogin) -- alter the Y value, so the second label is slightly below the first Y = 0.35 guiCreateLabel(X, Y, Width, Height, "Last name", true, wdwLogin) Y = 0.55 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.15 Width = 0.5 Height = 0.15 edtFirst = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.35 edtLast = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.55 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50 guiEditSetMaxLength(edtFirst, 50) guiEditSetMaxLength(edtLast, 50) guiEditSetMaxLength(edtPass, 50) X = 0.0825 Y = 0.8 Width = 0.25 Height = 0.25 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) X = 0.415 btnRegister = guiCreateButton(X, Y, Width, Height, "Register", true, wdwLogin) guiSetVisible(wdwLogin, false) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false); addEventHandler("onClientGUIClick", btnRegister, clientSubmitRegister, false); end addEventHandler("onClientResourceStart", resourceRoot, function() createLoginWindow(); guiSetVisible(wdwLogin, true); showCursor(true); guiSetInputEnabled(true); end); function clientSubmitLogin(button, state) if button == "left" and state == "up" then local firstName = guiGetText(edtFirst); local lastName = guiGetText(edtLast); local username = firsName .. "_" .. secondName; local password = guiGetText(edtPass); --print(player .. username .. password); if username and password then triggerServerEvent("customLoginPlayer", localPlayer, username, password); end guiSetInputEnabled(false); guiSetVisible(wdwLogin, false); showCursor(false); end end function clientSubmitRegister(button, state) if button == "left" and state == "up" then local firstName = guiGetText(edtFirst); local lastName = guiGetText(edtLast); local username = firsName .. "_" .. secondName; local password = guiGetText(edtPass); --print(player .. username .. password); if username and password then triggerServerEvent("customLoginPlayer", localPlayer, username, password); end guiSetInputEnabled(false); guiSetVisible(wdwLogin, false); showCursor(false); end end Server.lua addEvent("customLoginPlayer", true); addEventHandler("customLoginPlayer", root, function(username, password) local account = getAccount(username, password); if not account then outputChatBox("No account found, please check credentials!"); else logIn(client, account, password); outputChatBox("You got logged in, woha!"); end end); addEvent("customRegisterPlayer", true); addEventHandler("customRegisterPlayer", root, function(username, password) if not getAccount(username) then local theAccount = addAccount(username, password); if theAccount then logIn(client, theAccount, password); outputChatBox("You got logged in, woha!"); end else outputChatBox("Oupss, there is already an account with this username!"); end end); Keep in mind this resource have to have admin rights! Hope that help you out!