
LonelyRoad
Members-
Posts
116 -
Joined
-
Last visited
Everything posted by LonelyRoad
-
Ok so, you'll be looking to use this function: https://wiki.multitheftauto.com/wiki/SetPlayerTeam In conjunction with: https://wiki.multitheftauto.com/wiki/GetElementData The easy way to do it is like so: if getElementData(thePlayer, registered) then setPlayerTeam(thePlayer, members) else return false end ^That'd check if the element data has a value for registered, if it does, their team is set, else it returns false and ends. Ensure that you create the team first with: https://wiki.multitheftauto.com/wiki/CreateTeam And that you add the element data with (So the script can see that they're a registered player): https://wiki.multitheftauto.com/wiki/SetElementData
-
Ok so what I'm looking to do is make it so that an admin can hide themselves, so when trying to watch what's going on (in say an RP on an RP server) no player can see that the admin is there. Here's the code I have server-side: --ADMIN HIDDEN function adminHide(sourcePlayer, command) if isGuestAccount(getPlayerAccount(sourcePlayer)) ~= true then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("Admin")) then outputChatBox("Sorry, but you are not allowed to use the hide command", sourcePlayer) return false else if getElementData(sourcePlayer, "hidden") then setElementAlpha(sourcePlayer, 255) removeElementData(sourcePlayer, "hidden") setPlayerNameTagShowing(sourcePlayer, true) triggerClientEvent(sourcePlayer, "onUnhide", sourcePlayer) outputChatBox("You are no longer invisible.", sourcePlayer) else setElementData(sourcePlayer, "hidden") setElementAlpha(sourcePlayer, 0) setPlayerNameTagShowing(sourcePlayer, false) triggerClientEvent(sourcePlayer, "onHide", sourcePlayer) outputChatBox("You are now invisible.", sourcePlayer) end end end end addCommandHandler("ahide", adminHide) ISSUES: [15:07:42] WARNING: admincmds/server/admincommands.lua:10: Bad argument @ 'setEl ementData' [15:07:42] ERROR: admincmds/server/admincommands.lua:12: attempt to call global 'setPlayerNameTagShowing' (a nil value) Here's the code I have client-side: function showToLocalPartial() setElementAlpha(source, 150) end addEvent("onHide", true) addEventHandler("onHide", getRootElement(), showToLocalPartial) function showToLocalAbsolute() setElementAlpha(source, 255) end addEvent("onUnhide", true) addEventHandler("onUnhide", getRootElement(), showToLocalAbsolute) ISSUES: -The graphics go slightly red, the draw distance seems to drop and it doesn't make them partially visible. -Maybe this is scripted wrong? Any help is appreciated.
-
And what are you trying to ask here?
-
Perfect so far as I can see.
-
Aye, I'll look into that, was considering it but what annoys me is I find that sort of thing quite, err... 'intrusive' ... shall we say? (Especially when it locks all the controls so you can't do anything ) I'll maybe make an entirely new edition of it with an actual GUI, I duno...
-
This to me shows too much vG PD (Tony Fox, the ingame character name of the PD chief posted this on their external forums) ^source: I used to be a police officer at the vGPD.
-
Ok, first thing I notice is you seem to be using "setVehicleColor" wrong. It does not go by r, g, b. Each car has different colour 'boxes' and each argument given to "setVehicleColor" is the colour ID for each box, not the RGB values for just one 'box'. Also, your trying to set the vehicle colour of the player? this obviously won't work. Study this page: https://wiki.multitheftauto.com/wiki/SetVehicleColor An example from me, for the usage of setVehicleColor is: local myCar = createVehicle(496, 0, 0, 0) function MyCarColour(myCar) setVehicleColor(myCar, 3) end ^The example above would spawn a Blista Compact(496) at the co-ords of 0,0,0 (x,y,z) and then set the vehicle's colour to red.
-
Hey guys, New to scripting, it's a small resource but it works(better than the other pm system released on the resources database.) and I just want suggestions/requests (or fixes/better ways if their is any for what I've done?) so, I, without further-ado, present to you: Player PM Which is available at: https://community.multitheftauto.com/index.php?p=resources&s=details&id=840
-
Hey guys, So I'm new to scripting and I've been trying to make my own / admin commands. I've come down to the part where I'm using "setElementPosition" and "getElementPosition" so I've written this: --ADMIN TELEPORTS --Goto function adminGoto(sourcePlayer, command, tPlayer) if isGuestAccount(getPlayerAccount(sourcePlayer)) ~= true then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("Admin")) then outputChatBox ( "Sorry, but you are not allowed to use the goto command", sourcePlayer ) return false else if not tPlayer then outputChatBox("You need to specify a target player. Syntax: /agoto ", sourcePlayer) return false else if not getPlayerFromName(tPlayer) then outputChatBox("Specified player not found on server.", sourcePlayer) return false else local targetPlayer = getPlayerFromName(tPlayer) local tx, ty, tz = getElementPosition(tPlayer) if isPedInVehicle(targetPlayer) then local vehicle = getPedOccupiedVehicle(tPlayer) local seats = getVehicleMaxPassengers ( vehicle ) + 1 local i = 0 while i < seats do if not getVehicleOccupant (vehicle, i) then warpPedIntoVehicle (sourcePlayer, vehicle, i) break end i = i + 1 end if i >= seats then setElementPosition(sourcePlayer, tx + 10, ty, tz + 25, true) outputChatBox("Sorry, the player's vehicle is full.", sourcePlayer) end else setElementPosition(sourcePlayer, tx + 10, ty, tz + 25, true) outputChatBox("You have been teleported to:" ..getPlayerFromName(tPlayer)..".", sourcePlayer) outputChatBox("An administrator has teleported to you.", targetPlayer) -- etc end end end end end end addCommandHandler("agoto", adminGoto) --Bring function adminBring(sourcePlayer, command, tPlayer) if isGuestAccount(getPlayerAccount(sourcePlayer)) ~= true then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("Admin")) then outputChatBox ( "Sorry, but you are not allowed to use the bring command", sourcePlayer ) return false else local targetPlayer = getPlayerFromName(tPlayer) local tx, ty, tz = getElementPosition(sourcePlayer) setElementPosition(targetPlayer, tx + 10, ty, tz + 25, true) outputChatBox("You have teleported " ..getPlayerName(targetPlayer).." to you.", sourcePlayer) outputChatBox("An administrator has teleported you to them.", targetPlayer) end end end addCommandHandler("abring", adminBring) So, here's the errors that are printed by each command: agoto: abring: I'd normally ask my friend, but I just can't see what's wrong myself and he's AFK lol. Hope someone can help. EDIT: Corrected line numbers to fit snippet and not the full resource file.
-
Sure, I dunno which one you'll need so I've attached all the ones from yesterday, as I got it quite frequently.[attachment=0]dumps.zip[/attachment]
-
I was playing on the SAES:RPG server, nothing to do with me running a server or anything...
-
Lol, to me the system is apparently mostly PHP anyways, so he might get so far if he knows PHP? lol.
-
Umm, nothing more than standard playing really? If you want me to be really specific then I was just driving a car around?
-
What use is the script to you if you haven't got a game to play&test it with? Go buy some common sense and reinstall your game.
-
Hey guys, My problem is that while I am playing my game, on the odd occasion(although it can get quite frequent) will just close itself, with no error/message/warning or anything? I use the client from nightly.multitheftauto.com but my friend uses the official mta client and gets the same problem? Hope you can help, cheers.
-
Though I'm not a vG scripter and am therefore guessing it's a little like this: Registering -: You register on the site which adds data to a MySQL database and waits for an admin to review your app, at which point they change a variable on your account which may be liked "AdminApproved" to 1, this is then checked ingame (through MySQL Lua code) and it 'asks' the database if the account is approved, if it was they are able to login, otherwise they're told they haven't been approved or haven't registered on the website. Logging in -: The login system makes Lua calls to a MySQL database and checks if the account meets something like the following criteria: -Does the account exist? -Do the login details match what we have on file? -Is the account approved by an admin? (If AdminApproved is 1 your accepted, if 0 then you were either denied/not yet approved) If it meets all of the above criteria it will allow you to login, it then sends you to the character select screen and this is more data lifted from the database related to your account. ^Hope the above answers your question.