Jump to content

Et-win

Members
  • Posts

    1,390
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Et-win

  1. +Max you are asleep (No offense x3) addEventHandler("onResourceStart",resourceRoot, function ( ) for _, nMax in ipairs ( getElementsByType ( 'player' )) do local nAccount = getAccountName(getPlayerAccount(nMax)) if (nAccount) then if isObjectInACLGroup ( "user." .. nAccount, aclGetGroup ( "Admin" ) ) then blip1 = createBlip( 1586.1999511719, 1236.4000244141, 9.800000190735, 35, 2, 255, 0, 0, 255, 0, 99999 ) return end end end end )
  2. Only if you don't want to continue your script after creating the blip. Otherwise you could check or 'blip1' does exists.
  3. addEventHandler("onResourceStart",resourceRoot, function ( ) for _, nMax in ipairs ( getElementsByType ( 'player' )) do local nAccount = getPlayerAccount(getAccountName ( nMax )) if isObjectInACLGroup ( "user." .. nAccount, aclGetGroup ( "Admin" ) ) then blip1 = createBlip( 1586.1999511719, 1236.4000244141, 9.800000190735, 35, 2, 255, 0, 0, 255, 0, 99999 ) return end end end ) Otherwise you create serveral blips if there is more than 1 admin, since it's only creating the blip on 1 position.
  4. local account = getPlayerAccount (localPlayer) You can't give up 'localPlayer' because it's not client-side. Instead use: getElementsByType("player") And loop through them.
  5. The script which Max+ gave works on server-side. You don't have to trigger anything for it. If you want to get the kills, then do call it with this: getElementData(player-element, "Kills")
  6. Ow wait, I thought you were someone else replying to... yourself. Sorry
  7. You understood his sentence wrong. Read it again.
  8. Et-win

    vehicles table

    Post your recently script, because you are constantly using another string to save the data under.
  9. Lol, I thought you said it returned 'false'?
  10. function Buy1 () local money = getPlayerMoney(source) if (money > 5000) then takePlayerMoney(source,5000) local vehicleModel = 602 local x,y,z = getElementPosition(source) y = y + 10 z = z + 5 local veh = createVehicle(tonumber(vehicleModel),x,y,z) local lol = setElementData(veh, "owner", getPlayerName(source)) outputChatBox(tostring(lol)) else outputChatBox ( "You need more cash bro..", source, 255, 255, 255, true ) end end addEvent("Car1",true) addEventHandler( "Car1", getRootElement(), Buy1 ) What does it output? If it output's 'true', then I give up. x:
  11. Yes I understand. And yes. Are you sure you are setting the data correctly? Give the function or atleast the event+function line where you set the data.
  12. Oops, sorry. I checked the data of the player and not of the vehicle. sellMarker = createMarker ( -2658.1999511719,-48.599998474121,3.3000001907349, "cylinder", 1.5, 255, 0, 0 ) function sellVeh(tElement) if (getElementType(tElement) == "player") then local gVehicle = getPedOccupiedVehicle(tElement) if (gVehicle ~= false) and (gVehicle ~= nil) then local gData = getElementData(gVehicle , "owner") outputChatBox(tostring(gData)) local gPlayerName = getPlayerName(tElement) if (gPlayerName ~= false) and (gPlayerName ~= nil) and (gData ~= false) and (gData ~= nil) then if (gPlayerName == gData) then outputChatBox("You are owner so bla bla", tElement) -- i will put more things later here else outputChatBox("You are not the owner.", tElement) end else outputChatBox("Error getting data or player name.", tElement) end end end end addEventHandler( 'onMarkerHit', sellMarker, sellVeh)
  13. sellMarker = createMarker ( -2658.1999511719,-48.599998474121,3.3000001907349, "cylinder", 1.5, 255, 0, 0 ) function sellVeh(tElement) if (getElementType(tElement) == "player") then local gData = getElementData(tElement, "owner") outputChatBox(tostring(gData)) local gPlayerName = getPlayerName(tElement) if (gPlayerName ~= false) and (gPlayerName ~= nil) and (gData ~= false) and (gData ~= nil) then if (gPlayerName == gData) then outputChatBox("You are owner so bla bla", tElement) -- i will put more things later here else outputChatBox("You are not the owner.", tElement) end else outputChatBox("Error getting data or player name.", tElement) end end end addEventHandler( 'onMarkerHit', sellMarker, sellVeh) What does it output?
  14. Client-side: function setvvar(yn) vip = yn end end triggerServerEvent("checkVip", getLocalPlayer()) addEvent("pisvip", true) addEventHandler("pisvip", getRootElement(), setvvar) Server-side: function checkVip() if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Vip"))) then triggerClientEvent(source, "pisvip", getRootElement(), "yes") else triggerClientEvent(source, "pisvip", getRootElement(), "no") end end addEvent("checkVip", true) addEventHandler("checkVip", getRootElement(), checkVip) Edited again. :')
  15. function checkZone() --Make a 'function' local gPlayers = getElementsByType("player") --Get all players if (gPlayers ~= false) and (gPlayers ~= nil) then --If it was not failed to get all players for placeNumber, playerData in ipairs(gPlayers) do --Then make a 'loop', this will do the next code for EVERY player local pX, pY, pY = getElementPosition(playerData) --Get the player's position local gZone = getZoneName(pX, pY, pZ, true) --Get the zone name on the position if (gZone == "") then --If the zone name is Las Venturas setPlayerWantedLevel(playerData, 0) --Then set the player's wanted level to '0' end --End the 'if' end --End the 'loop' end --End the 'if' end --End the 'function' setTimer(checkZone, 1000, 0) --Start the function every 1 second I trust that you will 'study' this and try to understand it. Next time it's your turn fully.
  16. Et-win

    vehicles table

    function onJoin(lastAccount, currentAccount) local data = getAccountData(currentAccount, "cu") if data then data = fromJSON(data) --[[THIS IS YOUR VEHICLE TABLE]] vehicleTable = data end end addEventHandler ("onPlayerLogin", getRootElement(),onJoin)
  17. Use 'source' instead of 'player'. And remove 'player' out of the function. ONLY if you are using: triggerServerEvent("fjkjkfjksdf", getLocalPlayer()) and not: triggerServerEvent("dfsdfj", getRootElement(), getLocalPlayer()) Also: function setvvar(root, yn) Remove 'root'.
  18. sellMarker = createMarker ( -2658.1999511719,-48.599998474121,3.3000001907349, "cylinder", 1.5, 255, 0, 0 ) function sellVeh(tElement) if (getElementType(tElement) == "player") then local gData = getElementData(tElement, "owner") local gPlayerName = getPlayerName(tElement) if (gPlayerName ~= false) and (gPlayerName ~= nil) and (gData ~= false) and (gData ~= nil) then if (gPlayerName == gData) then outputChatBox("You are owner so bla bla", tElement) -- i will put more things later here else outputChatBox("You are not the owner.", tElement) end else outputChatBox("Error getting data or player name.", tElement) end end addEventHandler( 'onMarkerHit', sellMarker, sellVeh)
  19. Client-side: triggerServerEvent("Checkmyawesomegroupifiminit", getLocalPlayer()) Server-side: --Code to check or she/he is in that group triggerClientEvent(source, "Backtoclientnamestufflol", source, --[[i just used my first source here : D]], variable-or-is-in-the-group)
  20. Trigger to server-side to get his group. Then trigger back to client and continue your script.
  21. local gData = getElementData(source, "owner") local gPlayerName = getPlayerName(source) if (gPlayerName ~= false) and (gPlayerName ~= nil) and (gData ~= false) and (gData ~= nil) then if (gPlayerName == gData) then --Do something else outputChatBox("You are not the owner.", source) end else outputChatBox("Error getting data or player name.", source) end
  22. setTimer(setElementPosition, 30000, 1, source, x, y, z) Or: setTimer(function(tPlayer) setElementPosition(tPlayer, x, y, z) end, 30000, 1, source) Edited.
×
×
  • Create New...