-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
localPlayer is predefined variable ( returns the player element of the local player.) So using localPlayer / getLocalPlayer() is the same thing. I'm pretty sure arg2 is not defined in your code, post full code here.
-
Try this: -- Check here if arg2 exist then .... local bleeding = getElementData(arg2,"bleeding") or 0 local bandage = getElementData(localPlayer,"Bandage") or 0 if bleeding > 0 and bandage >= 1 then -- put your code here end
-
Check if the vehicle exist then destroy it: if isElement(source) then destroyElement(source) end
-
You are welcome.
-
So I've tried different parameters but all with the same result! Try this local Team = createTeam("Medics", 0, 255, 0) function createAmb() local getpteam = getPlayerTeam(client) if (getpteam == Team) then outputChatBox ("Sorry, but you are already employed as a medic!", client) else createVehicle (416, 1191.3876953125, -1325.90234375, 13.3984375) setPlayerTeam(client, team) outputChatBox ("You are now employed as a Medic, enter an ambulance to start your job!", client,0,255,0) end end addEvent("ambul", true) addEventHandler("ambul", root, createAmb)
-
Try this untested i'm using the phone. -- Server side function gui (player) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accName = getAccountName (account) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent (player,"pop",player) end end end function bindTab( thePlayer ) bindKey( thePlayer, "F2","down", gui) end function bindTabOnPlayerJoin () bindTab(source) end addEventHandler("onPlayerJoin",root, bindTabOnPlayerJoin) function bindTabOnResourceStart () local players = getElementsByType("player") for index, player in pairs(players) do bindTab(player) end end addEventHandler("onResourceStart",resourceRoot, bindTabOnResourceStart ) -- Client side -- Client side function popa () guiSetVisible(Wnd,true) showCursor(true) end addEvent("pop",true) addEventHandler("pop", root), popa )
-
It's a dxGUI (dx rectangle) with normal edit box and buttons. Edit sorry didn't see Oscar reply.
-
Already create something like that (Here), it's very easy to do it. Just try and post your code here.
-
Do it by yourself then post your code here.
-
I'm using attachElementToBone to right hands. While the player moves, the object moves also. I want to freeze right hand for the object don't moving. The left hand, legs, ... Have to move normally.
-
Calm down guys.
-
Changing the whole map without without disabling F11, i think it's not a good idea. anyways -- delete all mta sa object for i=550,20000 do removeWorldModel(i,10000,0,0,0) end setOcclusionsEnabled(false) setWaterLevel(-5000) You need to be a good mapper to create your own one.
-
Client side (just to daisable F11 map then added anything you want) function disableMap ( ) toggleControl("radar", false) end addEventHandler ( "onClientResourceStart", resourceRoot, disableMap )
-
Yes it's toggleControl("radar", false) then do what you want. :fp:
-
local civilian = createTeam("Civilian Workers",255,255,0) function Civilian (player) local playerTeam = getPlayerTeam(player) local wantedLevel = getPlayerWantedLevel (player) or 0 if not (playerTeam == civilian) then if wantedLevel == 0 then if isPedInVehicle(player) then outputChatBox("You can't use this command when inside a vehicle",player,255,0,0) return end outputChatBox("You are now a Civilian",player,0,255,0) setPlayerTeam(player,civilian) else outputChatBox("You are wanted",player,255,0,0) end else outputChatBox("You are already in Civilian Team",player,255,0,0) end end addCommandHandler("civilian",Civilian)
-
replace "ped" with "player". and put your code server side.
-
It's very simple it can be like this: Method 1: -- function A function functionA(player,cmd) outputChatBox("test A command",player) end addCommandHandler("testa",functionA) -- function B function functionB(player,cmd) outputChatBox("test B command",player) end addCommandHandler("testb",functionB) local functions = {functionA,functionB} for i,v in pairs(functions) do addCommandHandler("testc",v) end Method 2: function allfunctions(player,cmd) if cmd == "testa" then -- testa code here elseif cmd == "testb" then -- testb code here elseif cmd == "testc" -- testa code here -- testb code here end end addCommandHandler("testa",allfunctions) addCommandHandler("testb",allfunctions) addCommandHandler("testc",allfunctions)
-
added player here it's server side code. outputChatBox("You have been caught escaping, you are jailed!",player, 255, 0, 0)
-
Try this local LSJob_in = createMarker(1727, -1637, 20.5, "arrow", 1, 0, 255, 0, 255) local LSJob_out = createMarker (1727, -1637.7, 20.5, "arrow", 1, 0, 255, 0, 255) function LSJobWarp(player) if (player and isElement(player) and getElementType(player) == "player") then if (source == LSJob_in) then local watedLevel = getPlayerWantedLevel (player) if watedLevel > 5 then return end setElementPosition(player, 1727, -1640.53, 20.2) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) elseif (source == LSJob_out) then setElementPosition(player, 1727, -1635, 20.2) setTimer(setElementFrozen, 2500, 1, player, true) outputChatBox("Come back again!", 0, 255, 0) end end end addEventHandler("onMarkerHit", root, LSJobWarp)