-
Posts
451 -
Joined
-
Last visited
Everything posted by AhmadQTR
-
try addEventHandler('onPlayerChat',root, function(msg,msgtype) if msgtype == 0 then if msg == "!flip" then executeCommandHandler("bf",source) end end end )
-
local allowedGroups = {"Admin", "Moderator"} addEventHandler("onPlayerDamage", getRootElement(), function(attacker, weapon, bodypart, loss) if getElementData(source, "staff.active") == 1 then if loss then setElementHealth(source,200) end end end ) addEventHandler("onPlayerQuit", getRootElement(), function() removeElementData(source, "staff.active") removeElementData(source, "staff.skin") removeElementData(source, "staff.tagcolor.red") removeElementData(source, "staff.tagcolor.green") removeElementData(source, "staff.tagcolor.blue") end ) addCommandHandler("staff", function(player) local data = getElementData(player, "staff.active") local check = 0 local r = getElementData(player, "staff.tagcolor.red") local g = getElementData(player, "staff.tagcolor.green") local b = getElementData(player, "staff.tagcolor.blue") for i, v in ipairs(allowedGroups) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then if data == 0 or data == false then red, green, blue = getPlayerNametagColor(player) setElementData(player, "staff.skin", getElementModel(player)) setElementData(player, "staff.tagcolor.red", red) setElementData(player, "staff.tagcolor.green", green) setElementData(player, "staff.tagcolor.blue", blue) setElementModel(player, 217) setPlayerTeam (player, team "Admins") setPlayerNametagColor(player, 150, 155, 255) outputChatBox("#9900FF[sTAFF] #FFFFFFYou have enabled staffmode! Don't abuse your godlike powers.", player, 255, 255, 255, true) setElementData(player, "staff.active", 1) return elseif data == 1 then setElementModel(player, getElementData(player, "staff.skin")) setPlayerNametagColor(player, r, g, b) outputChatBox("#9900FF[sTAFF] #FFFFFFYou have disabled staffmode!", player, 255, 255, 255, true) setElementData(player, "staff.active", 0) return end elseif isGuestAccount(getPlayerAccount(player)) and data ~= 0 then outputChatBox("#9900FF[sTAFF] #FFFFFFYou need to be logged in to perform this command!", player, 255, 255, 255, true) return elseif not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup(v)) and #allowedGroups == i then outputChatBox("#9900FF[sTAFF] #FFFFFFYou lack the rights to use this command!", player, 255, 255, 255, true) end end end )
-
Try this addEventHandler('onPlayerChat',root, function(message, messageType) if messageType == 0 then if message == "!flip" then executeCommandHandler("buyflip",source) end end end ) PS : This is just for the second function which is !flip not the whole script.
-
cashToTake, savePlayerData, setVehicleRotation and scoreboardRefresh aren't functions use setElementRotation instead of setVehicleRotation
-
Just add a ) in line 37 near 'Admins' at staff/server.lua https://wiki.multitheftauto.com/wiki/Debugging
-
http://www.mediafire.com/?f5ncndcn1us1rxf
-
Wait for Towncivilian.
-
Then post it in tags
-
Please use http://www.pastebin.com
-
local car = createVehicle (432, x, y, z) function damageProof (car) setVehicleDamageProof (car, true) end
-
function click(m,s,p) if(getPlayerTeam(p)==getTeamFromName('Police'))then if(m=='right')then if(getElementType(source)=='vehicle')then destroyElement(source) return end if(getElementType(source)=='player')then setElementHealth(source,0) return end end end end addEventHandler('onElementClicked',root,click)
-
local sx, sy = guiGetScreenSize () function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) -- Reason for this is for using more than 1 color instead of using two dxDrawText Functions local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end function startMusic() outputChatBox ("#ff5b03[RADIO] #ffffffPress #ff5b03'R' #ffffffto Listen To The Radio", 255,137,0, true ) setRadioChannel(0) song = playSound ("http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls", true) setSoundVolume(song,0) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,1) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) function renderPlayerJoined ( ) dxDrawColorText(listening,sx/4, sy/23,sx,sy,tocolor(255,255,255),1.3,"sans","center","top",true,true,false) end listening = "#ff5b03[RADIO] #ffffffYou are currently #ff5b03listening #ffffffto the radio" addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,3000,1 ) if ( renderPlayerJoined ) then removeEventHandler ( "onClientRender", root, : ) end else setSoundVolume(song,0) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) function : ( ) dxDrawColorText(notlistening,sx/4, sy/23,sx,sy,tocolor(255,255,255),1.3,"sans","center","top",true,true,false) end notlistening = "#ff5b03[RADIO] #ffffffYou are currently #ff5b03not listening #ffffffto the radio" addEventHandler ( "onClientRender", root, : ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, : ) end ,3000,1 ) if ( : ) then removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) bindKey("r","down",toggleSong) addEventHandler("onClientResourceStop",getResourceRootElement(getThisResource()),startMusic)
-
Okay i'll test it but why functions dosen't show? i mean the server side and client side.
-
انت قصدك انك تبي تسوي مود و تركبه على سيرفرك؟
-
نسويلك المود مثلا؟ https://community.multitheftauto.com/
-
http://gta-news.org/images/wiki/samp/pa ... anus_0.png http://gta-news.org/images/wiki/samp/pa ... anus_1.png http://gta-news.org/images/wiki/samp/pa ... anus_2.png if that's what you meant Well i think this is just for samp if it's for mta too then maybe i forgot lol
-
تفضل local bb = { [1] = createRadarArea( -750, 900, 100, 100, 0, 255, 0, 175 ); [2] = createColCuboid ( -750, 900, 100, 100, 10.0, 10.0 ); } function hill_Enter ( hitPlayer, matchingDimension ) outputChatBox ( "hi", getRootElement(), 255, 255, 0 ) end addEventHandler ( "onColShapeHit", bb, hill_Enter )
-
ياخخي حاولت فيه ولا ضبط اسححب على المود يعني ؟ ابغى مساعده طيب ليش تحط المود كامل حط الجزء و احنا نساعدك
-
Your using it on client-side , use it on server-side and it will work. because killPlayer and spawnPlayer is server-sided functions.
-
local Serials = { ["سيريال 1"] = {}, ["سريال 2"] = {}, ["سيريال 3"] = {} } function kick(source) local serial = getPlayerSerial (source) for i,v in pairs(Serials) do if(serial==i)then kickPlayer (source, "انت غير مرغوب فيك") end end end addEventHandler("onPlayerConnect", root, kick)
-
سطر 6 لـ القروبات مو تيم يعني الكود غلط ؟ >< انا ابي مثلا اسوي زر لمن يضغطه اللاعب ينضم لـ الفريق الفلاني فـ السكور هو قصده عن الcomment
-
Then script it?
-
سطر 6 لـ القروبات مو تيم ااسف ماركزت
-
الثاني عرفتهه مشكور لكن الاول ياليت تسوي شرح بسيط عليهه function VIP () VIPTeam = createTeam ( "VIP", 255, 0, 0 ) -- VIP يعمل فريق اسمه end addEventHandler("onResourceStart", resourceRoot, VIP) -- الايفنت عندما يعمل السكربت function setVIP() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("VIP")) then -- قروب VIPيتأكد اذا هو في setPlayerTeam(source, VIPTeam) -- يضع الاعب في الفريق end end addEventHandler("onPlayerLogin",getRootElement(),setVIP) -- الايفنت عندما يدخل اللعب