-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
it should be like this -- Client side function useage(button, state) if not button == "left" and not state== "up" then return end triggerServerEvent("Clicked", localPlayer) destroyElement(spawn) showCursor(false) end addEventHandler ("onClientGUIClick", spawn, useage,false) -- Server side addEvent("Clicked", true) addEventHandler ("Clicked", root, function() spawnPlayer(source, 2287.66113, 558.75110, 7.78125) fadeCamera (source, true) setCameraTarget(source, source) end )
-
Try this one. -- Client Side function openPanel(result4) guiGridListClear(manageGridList) for i , v in pairs (result4) do local row = guiGridListAddRow(manageGridList) guiGridListSetItemText(manageGridList, row, 1, v["accName"], false, false) guiGridListSetItemText(manageGridList, row, 2, v["rank"], false, false) end end addEvent("openGroupPanel", true) addEventHandler("openGroupPanel", root, openPanel) -- Server Side executeSQLQuery("CREATE TABLE IF NOT EXISTS groupMembers (groupName TEXT, accName TEXT, rank TEXT)") function openServerPanel(thePlayer) local accName = getAccountName(getPlayerAccount(thePlayer)) local group = getElementData(thePlayer, "Group") local result4 = executeSQLQuery("SELECT * FROM groupMembers WHERE groupName=?", group) triggerClientEvent(thePlayer, "openGroupPanel", thePlayer, result4) end
-
It can be like this addEventHandler ("onPlayerQuit", root, function () local account = getPlayerAccount(source) if account and not isGuestAccount(source) then local x, y, z = getElementPosition(source) setAccountData (account, "position", toJSON({x,y,z})) end end ) addEventHandler ("onPlayerLogin", root, function(_, account) local position = getAccountData(account,"position") if postion then local x, y, z = unpack(fromJSON(position)) spawnPlayer(source, x, y, z) end )
-
it should be like this addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local money = getPlayerMoney(source) setAccountData(account, "Money", money) end ) addEventHandler("onPlayerLogin", root, function(_, theCurrentAccount) local money = getAccountData (theCurrentAccount, "Money") if money then setPlayerMoney(source, tonumber(money)) end end)
-
theCurrentAccount it's an argument Read this : OnPlayerLogin event
-
remove the space between 6 and 0.
-
Try to do it by yourself then post your code here and i will help u. Also post some SS here
-
-- Server side local speakerObject = {} function createSpeaker(thePlayer) local x, y, z = getElementPosition(thePlayer) speakerObject[thePlayer] = createMarker(x, y, z, "corona", 0.1, 255, 0, 0) outputChatBox("You have Succesfully created a speaker!", thePlayer, 0, 250, 0) if (isPedInVehicle(thePlayer)) then local vehicle = getPedOccupiedVehicle(thePlayer) attachElements(speakerObject[thePlayer], vehicle) triggerClientEvent(root,"playTheSound", root, x, y, z, vehicle) else triggerClientEvent(root,"playTheSound", root, x, y, z) end end addCommandHandler("startsound", createSpeaker) function deleteSpeaker(thePlayer) if (isElement(speakerObject[thePlayer])) then destroyElement(speakerObject[thePlayer]) outputChatBox("You have Succesfully destroyed the Speaker!", thePlayer, 0, 0, 255) if (isPedInVehicle(thePlayer)) then local vehicle = getPedOccupiedVehicle(thePlayer) triggerClientEvent(root,"stopTheSound", root,vehicle) end else outputChatBox("Speaker is not created!", thePlayer, 250, 0, 0) end end addCommandHandler("stopsound", deleteSpeaker) -- Client side llocal url = "http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls" local sound = {} function playTheSound(x, y, z, vehicle) if not isElement(vehicle) then outputChatBox("Vehicle does not exist") return false end if isElement(sound[vehicle]) then stopSound(sound[vehicle]) end local theSound = playSound3D(url, x, y, z) if theSound then sound[vehicle] = theSound attachElements(sound[vehicle], vehicle) else outputChatBox("Sound failed to play") return false end end addEvent("playTheSound", true) addEventHandler("playTheSound", getRootElement(), playTheSound) function stopTheSound(vehicle) if isElement(sound[vehicle]) then stopSound(sound[vehicle]) end end addEvent("stopTheSound", true) addEventHandler("stopTheSound", getRootElement(), stopTheSound)
-
You need to use math functions math.sin() math.cos() math.rad()
-
Yeh bro it's just an example of how to concatenates two strings. outputChatBox(W.. " "..M) -- Result: Hello Everybody. anyways thx.
-
function spawnVehiclePack ( player, commandName) local accName = getAccountName (getPlayerAccount (player)) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if hasObjectPermissionTo(player, "command.svp", false) then -- Your code here else -- Your code here end else -- Your code here end end addCommandHandler("svp",spawnVehiclePack)
-
function G(_,cur) if isObjectInACLGroup("user." ..getAccountName(cur), aclGetGroup("Console")) then outputChatBox(getPlayerName(source).." has logged in!", root) end end addEventHandler("onPlayerLogin", root,G)
-
You don't need to use the second argument make sure that report command is client side. executeCommandHandler("report")
-
replace getRootElement() with resourceRoot addEventHandler("onClientResourceStart",resourceRoot, function() outputChatBox(" ") outputChatBox("مود اطلاق صاروخ السيارة ") outputChatBox("By_ Mr.Mouamle") outputChatBox(" ") end )
-
nobody will help you with leaked scripts.
-
Try to use something like this local x, y, z = getElementPosition( player ) local mx, my, mz = getElementPosition( source ) if ((mz <= z+2) and (z >= mz-1)) then -- Your code here end
-
Try to explaine your problem better -- Server side marker = createMarker( ....... ) function teleport(player, matchingDimension) if matchingDimension and isElement(player) and getElementType(player) == "player" then if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) setElementPosition(vehicle, x, y, z) setElementRotation(vehicle, x, y, z) else setElementPosition(player, x, y, z) end end end addEventHandler("onMarkerHit", marker, teleport)
-
-- Server side function RemoveClothes ( ) for i=0,17 do removePedClothes ( source, i ) end end addEvent("Cargar", true ) addEventHandler("Cargar", root,RemoveClothes ) -- Client side triggerServerEvent("Cargar",localPlayer)