
Amine#TN
Members-
Posts
99 -
Joined
-
Last visited
Everything posted by Amine#TN
-
hi guys i made this script for players who join the server for the FIRST time but i have a problem i want the players who didnt spawn yet be frozen any idea local randomSpawnTable = { { 152.24,-2090,702 }, { 152.24,-2090,702 }, { 152.24,-2090,702 } } function randomSpawn( thePlayer, randomSpawnTable ) local random = math.random( 1, #randomSpawnTable ) spawnPlayer( thePlayer, randomSpawnTable[random][1], randomSpawnTable[random][2], randomSpawnTable[random][3], randomSpawnTable[random][4] ) setElementModel ( thePlayer, 312 ) giveWeapon ( thePlayer, 46 ) giveWeapon ( thePlayer, 9 ) giveWeapon ( thePlayer, 25, 5000 ,true ) giveWeapon ( thePlayer, 28, 5000 ,true ) giveWeapon ( thePlayer, 31, 5000 ,true ) giveWeapon ( thePlayer, 22, 5000 ,true ) end function onPlayerJoin() fadeCamera( source, true ) setCameraTarget( source, source ) randomSpawn( source, randomSpawnTable ) end addEventHandler( "onPlayerJoin",root, onPlayerJoin )
-
getElementData(p, "acc:admin") > 0 (getElementData(p, "acc:admin") > 0) the difference is in the ()
-
addEventHandler ( 'onPlayerWeaponSwitch',root, function ( _,aMyWeapon ) local curWeapon = getPedWeapon(source) if (isElementWithinColShape( source, zone1 )) and ( curWeapon == 38 ) then toggleControl( source,'fire',false ) outputChatBox ( "You Can not use This Weapon in this Event", source, 255, 255, 255,true ) else toggleControl( source,'fire',true ) end end ) with this code i cant use all the guns and the minigun i can use it i want to disable it not the other guns
-
hey all this script is for disabel some skins and toggle control for minigun and weapon 0 but i have a problem when the player leave this area or some times some staff use warp and the script didn't work fine i want to add a timer for this fonction of toggle controll for the players in that area local skintable = { [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [17] = true, [16] = true, [18] = true, [19] = true, [20] = true, [21] = true, [22] = true, [24] = true} zone1 = createColCuboid ( 1588.478515625, -1149.2705078125, 0, 95, 150, 255 )-- just the 3 numbers safeZoneRadar = createRadarArea ( 1588.478515625, -1149.2705078125, 95, 150, 255, 0, 0, 0 )-- just 2 numbers setElementData (safeZoneRadar, "zombieProof", true) function inZone(hitPlayer,thePlayer) local skin = getElementModel (hitPlayer) if not skintable[getElementModel(hitPlayer)] then toggleControl (hitPlayer, "vehicle_fire", false) else killPed (hitPlayer) end end addEventHandler( "onColShapeHit", zone1, inZone ) function outZone(hitPlayer,thePlayer) local skin = getElementModel (hitPlayer) if skintable[getElementModel(hitPlayer)] then killPed (hitPlayer) end end addEventHandler( "onColShapeLeave", zone1, outZone ) addEventHandler ( 'onPlayerWeaponSwitch',root, function ( _,aMyWeapon ) if isElementWithinColShape( source, zone1 ) and aMyWeapon == 38 or aMyWeapon == 0 then toggleControl( source,'fire',false ) outputChatBox ( "You Can not use This Weapon in this Event", source, 255, 100, 0,true ) else toggleControl( source,'fire',true ) end end ) sorry for my bad english
-
hi guys i used this safe area to stop poeple killing each other in an event and the the event is to killing a bot "slothbot" and the bot must kill us not to killing each other but now the bot can kill us now so i want to cancel the damage only from the players -- Format is: {x = 0, y = 0, z = 0, width = 0, depth = 0, height = 0}, local greenzones = { {x = 1587.58, y = -1150.29, z = 0, width = 116, depth = 139, height = 46}, --boss ls {x = 1987.69, y = 1503.08, z = 8, width = 40, depth = 70, height = 25}, {x = -727.38, y = 930.76, z = 11, width = 60, depth = 60, height = 25}, -- Wooden house thing {x = -2420, y = -626.2, z = 125, width = 60, depth = 60, height = 30}, -- San Fierro antenna thing } -- initialize all zones on resource start local z = {} function initGreenzones() if greenzones and #greenzones ~= 0 then for _,v in ipairs (greenzones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) local rarea = createRadarArea (v.x, v.y, v.width, v.depth, 0, 255, 0, 150) setElementParent (rarea, c) if c then z[c] = true for _,p in ipairs (getElementsWithinColShape(c, "player")) do setElementData (p, "greenzone", true) end addEventHandler ("onElementDestroy", c, function() if z[source] then z[source] = nil end end ) addEventHandler ("onColShapeHit", c, function (h, d) if h and d and isElement(h) and getElementType (h) == "player" then setElementData (h, "greenzone", true) end end ) addEventHandler ("onColShapeLeave", c, function (h, d) if h and d and isElement(h) and getElementType (h) == "player" then removeElementData (h, "greenzone") end end ) end end end end end end addEventHandler ("onResourceStart", resourceRoot, initGreenzones) function resetGreenzoneData() for _,p in ipairs (getElementsByType("player")) do if isElement(p) then removeElementData (p, "greenzone") end end end addEventHandler ("onResourceStop", resourceRoot, resetGreenzoneData) function onPDamage() if getElementData (source, "greenzone") then cancelEvent() end end addEventHandler ("onClientPlayerDamage", localPlayer, onPDamage) function onPSKill(target) if getElementData (target, "greenzone") then cancelEvent() end end addEventHandler ("onClientPlayerStealthKill", localPlayer, onPSKill) function renderGreenzoneTag() local streamedPlayers = getElementsByType ("player", root, true) if streamedPlayers and #streamedPlayers ~= 0 then local lpos = {getElementPosition(localPlayer)} for _,p in ipairs (streamedPlayers) do if p and isElement (p) then if getElementData (p, "greenzone") then local ppos = {getElementPosition(p)} if getDistanceBetweenPoints3D (lpos[1], lpos[2], lpos[3], ppos[1], ppos[2], ppos[3]) <= 20 then local x, y = getScreenFromWorldPosition (ppos[1], ppos[2], ppos[3]+1.2) if x and y then dxDrawText ("Greenzone protected", x+1, y+1, x, y, tocolor (0, 0, 0), 0.5, "bankgothic", "center") dxDrawText ("Greenzone protected", x, y, x, y, tocolor (0, 220, 0), 0.5, "bankgothic", "center") end end end end end end end addEventHandler ("onClientRender", root, renderGreenzoneTag) the second one is the client side
-
i don't know but they have a pro team
-
Hi, I Have Problem In Team System !!! The Idea is to set ElementData by Panel... And when the Player have that ElementData he can join the Team .. Can anyone help me ?? PLease :\ This Is the Code ------------------------------------------------ function Invitar (player) local Vipteam = getTeamFromName("F.B.I") local thePlayer = getPlayerFromName(source) if (Vipteam) then setElementData ( source,"F.B.I",true) outputChatBox ( "#00FF00To Join #2EFF9A*F.B.I* #FF0000/accept",source, 0, 255, 0, true ) else cancelEvent() end end addEvent( "FBI", true) addEventHandler( "FBI", getRootElement(), Invitar ) ------------------------------------------------------------- addCommandHandler( "accept", function(player) if getElementData(player,"Player") and getElementData(player,"F.B.I") == true then setPlayerTeam(player, Vipteam) triggerClientEvent (source, "lainvitacion", source) else cancelEvent() outputChatBox ( "#FF0000You Are Not Invited To Any Clan !!",source, 0, 255, 0, true ) end end ) And This the Errors that i got :\ WARNING: TeamSystem\server.lua:54: Bad argument @ 'getPlayerFromName' [Expected string at argument 1, got player] WARNING: TeamSystem\server.lua:89: Bad argument @ 'getPlayerFromName' [Expected string at argument 1, got nil] WARNING :TeamSystem\server.lua:90: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] Thanks
-
function autoJail () if type(source) ~= "player" then return end if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() else theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, - 1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail)
-
i have that jail systeme function autoJail () if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() else theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail) but that script have a warning Bad argument @ 'getPlayerWantedLevel'[Expected player at argument 1, got ped] sorry about posting here but i did not find the solution