Hello Community,
Please don't say I s*ck, i'm new to script and learning.
But it don't work my script.
I triggered as much as I could and went to Wiki every 5 secs.
So I hope you guys can help me as last option.
My Script
SERVER SIDED:
local theMarker = createMarker ( -2643, 639, 15, "cylinder", 1, 0, 0, 200, 170 ) -- creates the marker
function MarkerHit ( hitElement, matchingDimension )
local elementType = getElementType( hitElement )
setGUIvisable ("Panel") -- sets the triggered GUI visable
triggerClientEvent() -- Triggers the GUI see Client
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit )
function createCar
local createVehicle (416, -2591 584 15) -- ID X Y and Z
setPedIntoCar(createVehicle) -- Warps the Player into the Created Car
end
function setTeam
onGUIclick(bAccept) then
setPlayerTeam("Medic")
if getPlayerTeam = Medic then
outputChatBox("You are already an Medic")
end
-- Adds the Command for Medic members to heal players
local range = 50
addCommandHandler('heal', -- creates the command /heal
function(p,c,who)
local who = getPlayerFromName(who)
if who then
local mx,my,mz = getElementPosition(p)
local ux,uy,uz = getElementPosition(who)
if getDistanceBetweenPoints3D(mx,my,mz,ux,uy,uz) <= range then
if getPlayerTeam(p) == getTeamFromName("Medic") then -- only for medics able
setElementHealth(who, 100) -- sets full health
setPlayerMoney(who, -100) -- Takes 100$ for healing
end
else
outputChatBox("This player is too far away",p,0,0,225)
end
else
outputChatBox('Player not found.',p,0,0,255)
end
end
)
CLIENT SIDED:
GUIEditor = {
memo = {},
button = {},
window = {},
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "", true)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1], false)
bAccept = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "", true, GUIEditor.window[1])
bAccept = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Accept Job", true, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "sa-header")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
addEventHandler("onClientGUIClick", bAccept, showGUIbf, false)
addEventHandler("onClientGUIClick", bAccept, joinTeam, false)
bClose = guiCreateButton(0.67, 0.61, 0.20, 0.16, "CLOSE", true, GUIEditor.window[1])
guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA")
addEventHandler("onClientGUIClick", bClose, showGUIbf, false)
GUIEditor.memo[1] = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Become a Medic and heal people by using the command /heal player !", true, GUIEditor.window[1])
end
triggerServerEvent("theMarker")
triggerServerEvent("createCar")
triggerServerEvent("setTeam")
end
I know this isn't good but I tried and I know people who just give up but I tried.
Thanks for Helping already and be kind with reply's