Jump to content

Sisqo0

Members
  • Posts

    78
  • Joined

  • Last visited

Everything posted by Sisqo0

  1. Я не понимаю вас, если вы хотите этот сценарий или вам нужно, чтобы он был исправлен, но если вы хотите, чтобы исправить это затем показать код
  2. those are the functions that you need ? createMarker isElementWithinMarker setElementPosition bindKey
  3. este script precisa estar em server-side
  4. --Server function Superman (player, command ) if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then -- o seu código addCommandHandler("voar",Superman)
  5. criar uma "database.db" e usar estas funções para editar e fazer o que quiser com o seu script dbConnect dbQuery dbExec dbFree dbPoll
  6. هذا السكربت ممكن يساعدك
  7. yes @redditing
  8. maybe this can help you
  9. usted debe cambiar la piel con "setElementModel" para obtener su piel vieja usted debe mantener este guión en ejecución cuando se cambia la piel con el fin de obtener su piel vieja Id
  10. i think this resource will help you. Just start it and type /createzone
  11. Sisqo0

    Ped Sound Help

    maybe you didn't define "tanks" or you didn't add sound in meta.xml <file src="tank_spawn.wav" />
  12. --Server function Resource(playerSource, commandName ) local res = getResourceFromName("ResourceTest") startResource(res) end addCommandHandler("res", Resource)
  13. Sisqo0

    Ped Sound Help

    Ok i understood what you wanted --Client function attachsound () local ped = createPed(120,0,0,0) local x,y,z = getElementPosition( ped ) local sound = playSound3D( "sound", x, y, z, true) attachElements ( sound, ped) end
  14. Try this:- --server function getplayer() triggerClientEvent(root,"randomPlayer",root,getRandomPlayer() ) end addEvent("getplayer", true) addEventHandler("getplayer" , resourceRoot, getplayer ) -- client function checkPlayer(commandName) triggerServerEvent("getplayer", resourceRoot) end addCommandHandler("check", checkPlayer) function randomPlayer (player) outputChatBox ( "The player is " .. player ) end addEvent("randomPlayer", true) addEventHandler("randomPlayer" , resourceRoot, randomPlayer) Or you can try this better --server function randomPlayer (playerSource, commandName ) triggerClientEvent(playerSource ,"checkplayer", playerSource, getRandomPlayer() ) end addCommandHandler("check", randomPlayer) --client function checkPlayer (player) outputChatBox("The player is "..player ) end addEvent("checkplayer", true) addEventHandler ("checkplayer", localPlayer, checkplayer)
  15. Sisqo0

    Ped Sound Help

    @S7waj You want another example as well as in wiki? I don't know what you mean exactly ?
  16. Sisqo0

    Ped Sound Help

    See the example in wiki playSound Or playSound3D addEventHandler("onPedWasted") -- for ped not player
  17. As i know triggerServerEvent pass information from client to server not to receive You can make all the code in serverside --Server function randomPlayer (playerSource, commandName) outputChatBox(getPlayerName(getRandomPlayer()).." is the player!",playerSource ) end addCommandHandler("check", randomPlayer) But if you want to get it on client side then you should use those both triggerServerEvent triggerClientEvent
  18. That's because the player logged out before the timer finishes. You should check on player first
  19. That's because there are two variables called (x, y) and the 2nd variables only will be called here Try this if playerTarget then local xp,yp,zp = getElementPosition(playerTarget) local x,y,distance = getScreenFromWorldPosition (xp,yp,zp+0.5) distance = 30 if getElementData(playerTarget,"bandit") then text = string.gsub(getPlayerName(playerTarget), '#%x%x%x%x%x%x', '' ) else text = string.gsub(getPlayerName(playerTarget), '#%x%x%x%x%x%x', '' ) end local w = dxGetTextWidth(text,distance*0.033,"default-bold") if w and x and y and text and distance then dxDrawText ( text.."("..(getDistanceBetweenPoints3D( xp,yp,zp, getElementPosition ( localPlayer )))..")",x-(w/5),y,x-(w/5),y,tocolor(100, 255, 100, 200),distance*0.033,"bankgothic") end end end);
  20. @IIYAMA Oh! you are right and those id functions is better in this case but i forgot since i used to use setElementData to save more data to one element.
  21. getElementPosition setElementPosition createVehicle addCommandHandler You can give the vehicle you spawned a special id so you can get it back. setElementData(vehicle, "ID", num) getElementData(vehicle, "ID")
  22. local antiFlood = {} local antiFloodTick = {} local badwords = { "mom", "dad" } function chatLocal(message, messageType) if messageType == 1 then cancelEvent() end if messageType == 0 then cancelEvent() if not antiFlood[source] then antiFlood[source] = true antiFloodTick[source] = getTickCount() elseif getTickCount() - antiFloodTick[source] > 800 then antiFloodTick[source] = getTickCount() else return end local len = string.len(message) if len > 128 then return end local players = getElementsByType("player") local posX1, posY1, posZ1 = getElementPosition(source) for i = 1, #players do local posX2, posY2, posZ2 = getElementPosition(players[i]) if getDistanceBetweenPoints3D(posX1, posY1, posZ1, posX2, posY2, posZ2) <= 20 then outputChatBox(""..string.gsub((getPlayerName(source)..": "..message), "#%x%x%x%x%x%x", ""), players[i], 211, 211, 211, true) outputServerLog("[Local Chat]: "..string.gsub((getPlayerName(source)..": "..message), "#%x%x%x%x%x%x", "")) end end end end addEventHandler("onPlayerChat", getRootElement(), chatLocal) function adminChat(thePlayer, _,...) local word = {...} local message = table.concat(word, " ") local len = string.len(message) if len > 128 then return end local account = getPlayerAccount(thePlayer) if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Owner")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Administrator")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Moderator")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Support")) then showAdminMessage(thePlayer, message) end end addCommandHandler("a", adminChat) function showAdminMessage(player, message) local players = getElementsByType("player") for i = 1, #players do local account = getPlayerAccount(players[i]) if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Owner")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Administrator")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Moderator")) or isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Support")) then outputChatBox("#FF4500[Staff Chat]#FFFFFF "..removeHEXFromString(getPlayerName(player))..": #3498DB"..removeHEXFromString(message), players[i], 255, 255, 255, true) outputServerLog("[Admin Chat]: "..removeHEXFromString(getPlayerName(player))..": "..message) end end end function globalMessage(thePlayer, cmd, ...) local message = table.concat({ ... }, " ") local len = string.len(message) if len > 128 then return end local team = getTeamName(getPlayerTeam(thePlayer)) if not team then return end if isPlayerMuted(thePlayer) then outputChatBox("You are muted!", thePlayer, 255, 128, 22, true) return end for k,msg ipairs (badwords) do if string.find (message, msg) then setPlayerMuted (thePlayer, true) outputChatBox("You have been muted by Console!", thePlayer, 255, 0, 0, true) return end end if not antiFlood[thePlayer] then antiFlood[thePlayer] = true antiFloodTick[thePlayer] = getTickCount() elseif getTickCount() - antiFloodTick[thePlayer] > 800 then antiFloodTick[thePlayer] = getTickCount() else return end local name = getPlayerName(thePlayer) local r, g, b = getTeamColor(getTeamFromName(team)) outputServerLog("[Global Chat]: "..name..": "..message) if isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(thePlayer))), aclGetGroup("Owner")) then outputChatBox("[Owner] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) return end if isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(thePlayer))), aclGetGroup("Administrator")) then outputChatBox("[Administrator] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) return end if isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(thePlayer))), aclGetGroup("Moderator")) then outputChatBox("[Moderator] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) return end if isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(thePlayer))), aclGetGroup("Support")) then outputChatBox("[Support] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) return end if isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(thePlayer))), aclGetGroup("VIP")) then outputChatBox("[VIP] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) return end outputChatBox("[Player] #FFF5EE"..name..": #FFF5EE"..message, getRootElement(), r, g, b, true) end addCommandHandler("globalchat", globalMessage) function teamMessage(message, messageType) if messageType == 2 then cancelEvent() local len = string.len(message) if len > 128 then return end local team = getPlayerTeam(source) if not team then return end if not antiFlood[source] then antiFlood[source] = true antiFloodTick[source] = getTickCount() elseif getTickCount() - antiFloodTick[source] > 800 then antiFloodTick[source] = getTickCount() else return end local name = getPlayerName(source) local r, g, b = getTeamColor(team) local members = getPlayersInTeam(team) or {} for i = 1, #members do outputChatBox("[Team Chat] #FFF5EE"..name..": #FFF5EE"..message, members[i], r, g, b, true) end outputServerLog("[Team "..getTeamName(team).."]: "..name..": "..message) end end addEventHandler("onPlayerChat", getRootElement(), teamMessage) function onJoinPlayer() outputChatBox("#ff8800* #EBDDB2"..getPlayerName(source).." #FF6464has joined the game.", getRootElement(), 255, 0, 0, true) setPlayerBlurLevel(source, 0) setPlayerNametagShowing(source, false) end addEventHandler("onPlayerJoin", getRootElement(), onJoinPlayer) function onQuitPlayer(quitType) outputChatBox("#ff8800* #EBDDB2"..getPlayerName(source).." #FF6464has left the game ["..quitType.."]", getRootElement(), 255, 0, 0, true) if antiFlood[source] then antiFlood[source] = nil end if antiFloodTick[source] then antiFloodTick[source] = nil end end addEventHandler("onPlayerQuit", getRootElement(), onQuitPlayer) function disableBlur() setPlayerBlurLevel(getRootElement(), 0) end addEventHandler("onResourceStart", resourceRoot, disableBlur) function onCommandPlayer(commandName) if commandName == "login" or commandName == "logout" or commandName == "register" or commandName == "me" then cancelEvent() end end addEventHandler("onPlayerCommand", getRootElement(), onCommandPlayer) Try this and say sentences include "mom" or "dad" words in global chat.
×
×
  • Create New...