Firespider Posted July 25, 2022 Share Posted July 25, 2022 How can I make it so that only a special skin can use this command? Link to comment
Tails Posted July 25, 2022 Share Posted July 25, 2022 You need to add a if statement and check for the player's model with getElementModel Example: if getElementModel(localPlayer) == 0 then -- do your thing end Link to comment
roaddog Posted July 28, 2022 Share Posted July 28, 2022 On 27/07/2022 at 03:30, Firespider said: Don't working. show your current code Link to comment
MouNiR.Dz Posted July 28, 2022 Share Posted July 28, 2022 Is it client or server side? In the if statement , instead of Quote getElementModel(skin) Type skin And it should work now Btw there is some mistakes in your script , `setElementModel(*tehPalyer*,266)` instead of tehPalyer i think you mean thePlayer but thePlayer is nil here because you are client sided you should use localPlayer Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 (edited) Try changing `getElementModel(skin)` to `skin` `skin` is the same as `getElementModel(localPlayer)` You can either put `getElementModel(localPlayer)` or just put `skin` Edited July 29, 2022 by MouNiR.Dz Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 I wrote client side Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 Just now, Firespider said: I wrote client side Yes i guess too because you used playSound , btw its the same solution just do what i told you Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 Copy & Paste your code after editing Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 function GetMyPosition() local x,y,z = getElementPosition(localPlayer) local int = getElementInterior(localPlayer) local dim = getElementDimension(localPlayer) local skin = getElementModel(localPlayer) if not skin or not skin == 1 then outputChatBox("Nincs engedélyed hozzá") return end setClipboard(x..", "..y..", "..z.." "..int..", "..dim) outputChatBox("Kordinátád sikeressen kimásolva a vágólapra ") end addCommandHandler("GetMyPos", GetMyPosition, false, false) function alert () local name = getPlayerName(localPlayer) local sound = playSound("alert.mp3") -- Play wasted.mp3 from the sounds folder setSoundVolume(sound, 1) -- Set the sound volume to 50% if not skin or not skin == 1 then outputChatBox("Nincs engedélyed hozzá") return end outputChatBox("HLR felhivás "..name.." megnyitotta váróját! Lehet jönni ha bármi segítség kell!") end addCommandHandler("alert", alert, false, false) function duty () setElementModel(thePalyer, 266) end addCommandHandler("aduty", duty, false, false) Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 Try this function GetMyPosition() local skin = getElementModel(localPlayer) if skin == 1 then local x,y,z = getElementPosition(localPlayer) local int = getElementInterior(localPlayer) local dim = getElementDimension(localPlayer) setClipboard(x..", "..y..", "..z.." "..int..", "..dim) outputChatBox("Kordinátád sikeressen kimásolva a vágólapra ") else outputChatBox("Nincs engedélyed hozzá") end end addCommandHandler("GetMyPos", GetMyPosition, false, false) Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 Thanks, but is there anything else you can help me with? 1 Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 function alert () local skin = getElementModel(localPlayer) if skin == 1 then local name = getPlayerName(localPlayer) local sound = playSound("alert.mp3") -- Play wasted.mp3 from the sounds folder setSoundVolume(sound, 1) -- Set the sound volume to 50% outputChatBox("HLR felhivás "..name.." megnyitotta váróját! Lehet jönni ha bármi segítség kell!") else outputChatBox("Nincs engedélyed hozzá") end end addCommandHandler("alert", alert, false, false) function duty () setElementModel(localPlayer, 266) end addCommandHandler("aduty", duty, false, false) I did the if statement for the skin , to your "alert" command And i corrected the aduty command fuction because you was using thePalyer and it does not mean anything you should use localPlayer because you are using client side Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 Thanks, but is there anything else you can help me with? Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 1 minute ago, Firespider said: Thanks, but is there anything else you can help me with? That's it , but if you suffer any other problems we are here to help Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 Tell me where is the problem , and next time you better copy & paste instead of screenshot Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 There is a function from there, I would like to do it so that if you move the mouse to that coordinate, the button will light up, but I don't know how to calculate the coordinate so that it is "gomb1" The function I use to calculate the coordinates is IsInBox Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 This might be what are you looking for IsMouseInPosition Link to comment
Firespider Posted July 29, 2022 Author Share Posted July 29, 2022 Is OnCursorMove not good? OnClientCursorMove* Doesn't working Link to comment
MouNiR.Dz Posted July 29, 2022 Share Posted July 29, 2022 The event name you used is incorrect you used onClientCorsurMove You should use onClientCursorMove Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now