-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
if getElementType(source) == 'player' then if getElementInterior(player) == 1
-
that is client or server side?
-
Client: local marker1 = createMarker(1728.59, -1878.1, 12.69, "cylinder", 1.5, 255, 255, 0, 255) local marker2 = createMarker(-1968.8, 110.8, 27, "cylinder", 1.5, 255, 255, 0, 255) local marker3 = createMarker(2800.6, 1251.9, 10.5, "cylinder", 1.5, 255, 255, 0, 255) local marker4 = createMarker(1449.4, 2659.5, 10.39, "cylinder", 1.5, 255, 255, 0, 255) local Skins ={ {"Old Driver", 253}, {"Own Skin", localPlayer}, {"Young Driver", 255}, {"Pilot", 61}, } function Job() Jobwindow = guiCreateWindow(679, 486, 305, 264, "Select Uniform", false) playerSkin = guiCreateGridList(9, 21, 286, 153, false, Jobwindow) column = guiGridListAddColumn(playerSkin, "Uniform", 0.60) accept = guiCreateButton(19, 233, 37, 19, "OK", false, Jobwindow) refuse = guiCreateButton(62, 233, 154, 19, "Go off duty", false, Jobwindow) cancel = guiCreateButton(221, 233, 69, 19, "Cancel", false, Jobwindow) memo = guiCreateMemo(13, 184, 282, 48, "Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", false, Jobwindow) guiWindowSetMovable(Jobwindow, false) guiWindowSetSizable(Jobwindow, false) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(playerSkin) ~= -1) then local Select = tonumber(guiGridListGetItemData(playerSkin, guiGridListGetSelectedItem(playerSkin), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("setClientSkin", localPlayer, tonumber(guiGridListGetItemData(playerSkin, guiGridListGetSelectedItem(playerSkin),1)), skin) end end end end addEventHandler("onClientMarkerHit", marker1, Job) addEventHandler("onClientMarkerHit", marker2, Job) addEventHandler("onClientMarkerHit", marker3, Job) addEventHandler("onClientMarkerHit", marker4, Job) function Buttons(Job, SkinID) if source == accept and (SkinID and SkinID~= nil) then setElementModel(localPlayer,SkinID) show: triggerServerEvent("Tteam", localPlayer) setElementData(localPlayer, "Taxi Driver", Job) outputChatBox("You are now Taxi Driver!", 0, 255, 0) guiSetVisible(Jobwindow, false) showCursor(false) elseif srouce == refuse then getElementModel(localPlayer) setElementData(localPlayer, "Unemployed", Job) outputChatBox("You are not long Taxi Driver!", 0, 255, 0) guiSetVisible(Jobwindow, false) showCursor(false) elseif source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) end end addEvent("setPlayerSkin", true) addEventHandler("setPlayerkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons) Server: Tteam = createTeam("Taxi Driver", 255, 255, 0) function TJob(skin, Job) if isElement(source) and source == client then if skin then setElementModel(source, skin) setPlayerTeam(source, Tteam) setElementData(source, "Taxi Driver", Job) outputChatBox("You are now Taxi Driver!", source, 0, 255, 0) outputDebugString("Skin Set!") else outputDebugString("No Skin found") end end end addEvent("Tteam", true) addEventHandler("Tteam", root, TJob) addEvent("setClientSkin", true) addEventHandler("setClientSkin", root, TJob) http://imgur.com/oBbXteF
-
that is the point i dont get any error
-
Client: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) local Skins={ {"Female Uniform", 246}, {"Street Cop1 Uniform", 265}, {"Street Cop2 Uniform", 266}, {"Street Cop3 Uniform", 267}, {"LS Uniform", 280}, {"SF Uniform", 281}, {"LV Uniform", 282}, {"RCSD Uniform", 283}, {"Bike Uniform", 284}, {"SWAT Uniform", 285}, {"BCSD Uniform", 288}, {"Own Skin", localPlayer}, } function Job() local data = getElementData(localPlayer, "Faction") if (data == "SAPD") then Jobwindow = guiCreateWindow(679, 486, 305, 264, "Select Uniform", false) playerSkin = guiCreateGridList(9, 21, 286, 153, false,Jobwindow) column = guiGridListAddColumn(playerSkin, "Uniform", 0.60) guiCreateScrollBar(264, 6, 18, 121, false, false,Jobwindow) accept = guiCreateButton(19, 233, 37, 19, "OK", false, Jobwindow) refuse = guiCreateButton(62, 233, 154, 19, "Go off duty", false,Jobwindow) cancel = guiCreateButton(221, 233, 69, 19, "Cancel", false, Jobwindow) memo = guiCreateMemo(13, 184, 282, 48, "Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", false, Jobwindow) guiWindowSetMovable(Jobwindow,false) guiWindowSetSizable(Jobwindow,false) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(playerSkin) ~= -1) then local Select = tonumber(guiGridListGetItemData(playerSkin, guiGridListGetSelectedItem(playerSkin), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGridListGetItemData(playerSkin, guiGridListGetSelectedItem(playerSkin),1))) end end end end end addEventHandler("onClientMarkerHit", marker, Job) function Buttons() local data = getElementData(localPlayer, "Rank") if source == playerSkin then local Select = tonumber(guiGridListGetItemData(source , guiGridListGetSelectedItem(source), 1) ) if source == accept then guiSetVisible(Jobwindow, false) showCursor(false) if (data == (" Cadet" and "Chief") ) and Select == 1 then setElementModel(localPlayer, 246) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 2 then setElementModel(localPlayer, 265) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 3 then setElementModel(localPlayer, 266) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 4 then setElementModel(localPlayer, 267) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 5 then setElementModel(localPlayer, 280) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 6 then setElementModel(localPlayer, 281) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 7 then setElementModel(localPlayer, 282) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 8 then setElementModel(localPlayer, 283) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 9 then setElementModel(localPlayer, 284) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == "SWAT Officer" and ( "Captain" and "Chief" ) ) and Select == 10 then setElementModel(localPlayer, 285) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 11 then setElementModel(localPlayer, 288) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == ( "Lieutenant" and "Chief") ) and Select == 12 then setElementModel(localPlayer, localPlayer) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif source == refuse then setElementModel(localPlayer, localPlayer) triggerServerEvent("Citizenteam", localPlayer) setElementData(localPlayer, "Unemployed" ,Job) guiSetVisible(Jobwindow, false) showCursor(false) elseif source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) else outputChatBox("You don't have access",localPlayer, 255, 0, 0) end end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons) Server: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) PDteam = createTeam("PD", 0, 0, 255) function PJob(player) local data = getElementData(player, "Rank") local data2 = getElementData(player, "Faction") if (data2 == " SAPD") then if (data == ("Cadet" and "Chief") ) then setElementModel(player, 246) setPlayerTeam(player, PD) setElementData(player, "Police Officer", Job) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 265) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElemetnModel(player, 266) setElementData(player, "Police Officer",Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(playerr, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 267) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 280) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 281) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 282) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 283) setElementData(player, "Police Officer",Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) setElementModel(player, 284) elseif (data == ( "Cadet" and "Chief") ) then setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif ( data == "SWAT Officer" and ( "Captain" and "Chief") ) then setElementModel(player, 285) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 100) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 31, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 288) setPlayerArmor(player, 0) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Lieutenant" and "Chief") ) then setElementModel(player, player) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setTeamColor(PDteam, 255, 255, 255) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) else outputChatBox("You don't have access", player, 255, 0, 0) end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, PJob) addEventHandler("onMarkerHit", marker, PJob) not working why?
-
Client: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) local Skins={ {"Female Uniform", 246}, {"Street Cop1 Uniform", 265}, {"Street Cop2 Uniform", 266}, {"Street Cop3 Uniform", 267}, {"LS Uniform", 280}, {"SF Uniform", 281}, {"LV Uniform", 282}, {"RCSD Uniform", 283}, {"Bike Uniform", 284}, {"SWAT Uniform", 285}, {"BCSD Uniform", 288}, {"Own Skin", localPlayer}, } function Job() local data = getElementData(localPlayer, "Faction") if (data == "SAPD") then Jobwindow = guiCreateWindow(562, 422, 275, 276, "Select Uniform", false) playerSkin = guiCreateGridList(10, 24, 240, 143, false) column = guiGridListAddColumn(playerSkin, "Uniform", 0.60) guiCreateScrollBar(250, 30, 17, 106, false, false,Jobwindow) accept = guiCreateButton(12, 247, 40, 19, "OK", Jobwindow, false) refuse = guiCreateButton(62, 247, 106, 19, "Go off duty", Jobwindow, false) cancel = guiCreateButton(178, 247, 62, 19, "Cancel", Jobwindow, false) memo = guiCreateMemo(10, 176, 258, 71, "Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", Jobwindow, false) guiWindowSetMovable(Jobwindow,false) guiWindowSetSizable(Jobwindow,false) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(source) ~= -1) then local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source),1))) end end end end end addEventHandler("onClientMarkerHit", marker, Job) function Buttons() local data = getElementData(localPlayer, "Rank") if source == playerSkin then local Select = tonumber(guiGridListGetItemData(source , guiGridListGetSelectedItem(source), 1) ) if source == accept then guiSetVisible(Jobwindow, false) showCursor(false) if (data == (" Cadet" and "Chief") ) and Select == 1 then setElementModel(localPlayer, 246) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 2 then setElementModel(localPlayer, 265) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 3 then setElementModel(localPlayer, 266) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 4 then setElementModel(localPlayer, 267) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 5 then setElementModel(localPlayer, 280) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 6 then setElementModel(localPlayer, 281) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 7 then setElementModel(localPlayer, 282) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 8 then setElementModel(localPlayer, 283) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 9 then setElementModel(localPlayer, 284) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == "SWAT Officer" and ( "Captain" and "Chief" ) ) and Select == 10 then setElementModel(localPlayer, 285) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 11 then setElementModel(localPlayer, 288) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == ( "Lieutenant" and "Chief") ) and Select == 12 then setElementModel(localPlayer, localPlayer) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif source == refuse then setElementModel(localPlayer, localPlayer) triggerServerEvent("Citizenteam", localPlayer) setElementData(localPlayer, "Unemployed" ,Job) guiSetVisible(Jobwindow, false) showCursor(false) elseif source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) else outputChatBox("You don't have access",localPlayer, 255, 0, 0) end end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons) Server: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) PDteam = createTeam("PD", 0, 0, 255) function Job(player) local data = getElementData(player, "Rank") local data2 = getElementData(player, "Faction") if (data2 == " SAPD") then if (data == ("Cadet" and "Chief") ) then setElementModel(player, 246) setPlayerTeam(player, PD) setElementData(player, "Police Officer", Job) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 265) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElemetnModel(player, 266) setElementData(player, "Police Officer",Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(playerr, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 267) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 280) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 281) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 282) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 283) setElementData(player, "Police Officer",Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) setElementModel(player, 284) elseif (data == ( "Cadet" and "Chief") ) then setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif ( data == "SWAT Officer" and ( "Captain" and "Chief") ) then setElementModel(player, 285) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 100) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 31, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 288) setPlayerArmor(player, 0) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Lieutenant" and "Chief") ) then setElementModel(player, player) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setTeamColor(PDteam, 255, 255, 255) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) else outputChatBox("You don't have access", player, 255, 0, 0) end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Job) addEventHandler("onMarkerHit", marker, Job) http://imgur.com/6Ds9yj6
-
local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) local Skins={ {"Female Uniform", 246}, {"Street Cop1 Uniform", 265}, {"Street Cop2 Uniform", 266}, {"Street Cop3 Uniform", 267}, {"LS Uniform", 280}, {"SF Uniform", 281}, {"LV Uniform", 282}, {"RCSD Uniform", 283}, {"Bike Uniform", 284}, {"SWAT Uniform", 285}, {"BCSD Uniform", 288}, {"Own Skin", localPlayer}, } function Job() local data = getElementData("Faction") if (data == "SAPD") then Jobwindow = guiCreateWindow(0.40, 0.50, 0.80, 1, "Select Uniform", false) playerSkin = guiCreateGridList(0.20, 0.30, 0.15, 0.60, false) column = guiGridListAddColumn(playerSkin, "Uniform" , 0.60) accept = guiCreateButton(0.4, 0.5, 0.4, 1, "OK", Jobwindow, false) refuse = guiCreateButton(0.4, 0.5, 0.8, 1, "Go off duty", Jobwindow, false) cancel = guiCreateButton(0.4, 0.5, 0.4, 1, "Cancel", Jobwindow, false) memo = guiCreateMemo(17,79,414,246,"Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", Jobwindow, true) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(source), ~= -1) then local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source),1))) end end end end end addEventHandler("onClientMarkerHit", marker, Job) function Buttons() local data = getElementData("Rank") local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if source == accept then guiSetVisible(Jobwindow, false) showCursor(false) if (data == (>=" Cadet" and <= "Chief") and and Select == 1 then setElementModel(localPlayer, 246) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job" , "Police Officer") else if Select == 2 then setElementModel(localPlayer, 265) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job" , "Police Officer") else if Select == 3 then setElementModel(localPlayer, 266) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 4 then setElementModel(localPlayer, 267) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 5 then setElementModel(localPlayer, 280) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 6 then setElementModel(localPlayer, 281) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 7 then setElementModel(localPlayer, 282) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 8 then setElementModel(localPlayer, 283) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if Select == 9 then setElementModel(localPlayer, 284) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if (data == "SWAT Officer" and (>= "Captain" and <= "Chief" ) and Select == 10 then setElementModel(localPlayer, 285) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else outputChatBox("You don't have access", localPlayer, 255, 0, 0) end end else if Select == 11 then setElementModel(localPlayer, 288) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else if (data == (>= "Lieutenant" and <= "Chief") and Select == 12 then setElementModel(localPlayer, localPlayer) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") else outputChatBox("You don't have access", localPlayer, 255, 0, 0) end end end end end else if source == refuse then setElementModel(localPlayer, localPlayer) triggerServerEvent("Citizenteam", localPlayer) setElementData(localPlayer, "Job" "Unemployed") guiSetVisible(Jobwindow, false) showCursor(false) else if source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) end end end end end end end end end end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons) http://imgur.com/bBZjJC0
-
Client: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) local Skins={ {"Female Uniform", 246}, {"Street Cop1 Uniform", 265}, {"Street Cop2 Uniform", 266}, {"Street Cop3 Uniform", 267}, {"LS Uniform", 280}, {"SF Uniform", 281}, {"LV Uniform", 282}, {"RCSD Uniform", 283}, {"Bike Uniform", 284}, {"SWAT Uniform", 285}, {"BCSD Uniform", 288}, {"Own Skin", localPlayer}, } function Job() local data = getElementData(localPlayer, "Faction") if (data == "SAPD") then Jobwindow = guiCreateWindow(562, 422, 275, 276, "Select Uniform", false) playerSkin = guiCreateGridList(10, 24, 240, 143, false) column = guiGridListAddColumn(playerSkin, "Uniform", 0.60) guiCreateScrollBar(250, 30, 17, 106, false, false,Jobwindow) accept = guiCreateButton(12, 247, 40, 19, "OK", Jobwindow, false) refuse = guiCreateButton(62, 247, 106, 19, "Go off duty", Jobwindow, false) cancel = guiCreateButton(178, 247, 62, 19, "Cancel", Jobwindow, false) memo = guiCreateMemo(10, 176, 258, 71, "Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", Jobwindow, false) guiWindowSetMovable(Jobwindow,false) guiWindowSetSizable(Jobwindow,false) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(source) ~= -1) then local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source),1))) end end end end end addEventHandler("onClientMarkerHit", marker, Job) function Buttons() local data = getElementData(localPlayer, "Rank") if source == playerSkin then local Select = tonumber(guiGridListGetItemData(source , guiGridListGetSelectedItem(source), 1) ) if source == accept then guiSetVisible(Jobwindow, false) showCursor(false) if (data == (" Cadet" and "Chief") ) and Select == 1 then setElementModel(localPlayer, 246) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 2 then setElementModel(localPlayer, 265) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer" , Job) elseif (data == (" Cadet" and "Chief") ) and Select == 3 then setElementModel(localPlayer, 266) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 4 then setElementModel(localPlayer, 267) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 5 then setElementModel(localPlayer, 280) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 6 then setElementModel(localPlayer, 281) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 7 then setElementModel(localPlayer, 282) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 8 then setElementModel(localPlayer, 283) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 9 then setElementModel(localPlayer, 284) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == "SWAT Officer" and ( "Captain" and "Chief" ) ) and Select == 10 then setElementModel(localPlayer, 285) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == (" Cadet" and "Chief") ) and Select == 11 then setElementModel(localPlayer, 288) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif (data == ( "Lieutenant" and "Chief") ) and Select == 12 then setElementModel(localPlayer, localPlayer) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Police Officer", Job) elseif source == refuse then setElementModel(localPlayer, localPlayer) triggerServerEvent("Citizenteam", localPlayer) setElementData(localPlayer, "Unemployed" ,Job) guiSetVisible(Jobwindow, false) showCursor(false) elseif source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) else outputChatBox("You don't have access",localPlayer, 255, 0, 0) end end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons) Server: local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) PDteam = createTeam("PD", 0, 0, 255) function Job(player) local data = getElementData(player, "Rank") local data2 = getElementData(player, "Faction") if (data2 == " SAPD") then if (data == ("Cadet" and "Chief") ) then setElementModel(player, 246) setPlayerTeam(player, PD) setElementData(player, "Police Officer", Job) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 265) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElemetnModel(player, 266) setElementData(player, "Police Officer",Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(playerr, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 267) setElementData(player, "Police Officer", Job) setPlayerTeam(player, PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 280) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 281) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 282) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Cadet" and "Chief") ) then setElementModel(player, 283) setElementData(player, "Police Officer",Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) setElementModel(player, 284) elseif (data == ( "Cadet" and "Chief") ) then setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif ( data == "SWAT Officer" and ( "Captain" and "Chief") ) then setElementModel(player, 285) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 100) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 31, 300) giveWeapon(player, 41, 9999) elseif (data == ("Cadet" and "Chief") ) then setElementModel(player, 288) setPlayerArmor(player, 0) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) elseif (data == ( "Lieutenant" and "Chief") ) then setElementModel(player, player) setElementData(player, "Police Officer", Job) setPlayerTeam(player,PD) setTeamColor(PDteam, 255, 255, 255) setPlayerArmor(player, 0) giveWeapon(player, 3, 1) giveWeapon(player, 24, 300) giveWeapon(player, 41, 9999) else outputChatBox("You don't have access", player, 255, 0, 0) end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Job) addEventHandler("onMarkerHit", marker, Job) http://imgur.com/G8ox9mz
-
the first one idont know the second go to elements and press the deleted button sould work
-
try change the soure to thePlayer may it work
-
<meta> <info gamemodes="race" type="map" name="[shooter]OneLove Dimos - Darkdays is coming up" author="OneLove ft Dimos" version="1.0.0"></info> <map src="Shooter-OneLove-Dimos-Darkdays-coming-up.map" dimension="0"></map> <script src="client.lua" type="client"/> <files src="files/music.mp3"/> <script src="music.lua" type ="client"/> <settings> <setting name="#skins" value='[ "random" ]'></setting> <setting name="#maxplayers" value="[ 128 ]"></setting> <setting name="#useLODs" value="[ false ]"></setting> <setting name="#gamespeed" value="[ 1 ]"></setting> <setting name="#ghostmode" value='[ "false" ]'></setting> <setting name="#time" value="0:0"></setting> <setting name="#vehicleweapons" value='[ "true" ]'></setting> <setting name="#minplayers" value="[ 0 ]"></setting> <setting name="#weather" value="[ 7 ]"></setting> <setting name="#gravity" value="[ 0.0080000003799796104 ]"></setting> <setting name="#waveheight" value="[ 0 ]"></setting> <setting name="#respawntime" value="[ 5 ]"></setting> <setting name="#locked_time" value="[ true ]"></setting> <setting name="#duration" value="[ 600 ]"></setting> <setting name="#respawn" value='[ "none" ]'></setting> </settings> </meta> Client side cLP = getLocalPlayer() screenWidth, screenHeight = guiGetScreenSize() function cRStest() setTimer(resourcesCheck, 10000, 1) end addEventHandler("onClientResourceStart", getRootElement(), cRStest) function resourcesCheck() if check=="done" then return else setRadioChannel(0) setTimer(cbinds, 1000, 1) textToggle=0 check="done" end end function cRS() if check=="done" then return else setRadioChannel(0) setTimer(cbinds, 3333, 1) textToggle=0 check="done" end end addEventHandler("onClientPlayerSpawn", getLocalPlayer(), cRS) function markers(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) fixVehicle(vehicle) end end addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers) function cbinds() local keys1 = getBoundKeys("vehicle_fire") local keys2 = getBoundKeys("vehicle_secondary_fire") if keys1 then for keyName, state in pairs(keys1) do bindKey(keyName, "down", cdoshoot) end bindKey("F", "down", cdoshoot) cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- You can shoot once every 3 seconds.\n- Good luck and have fun!" end if keys2 then for keyName, state in pairs(keys2) do bindKey(keyName, "down", cdoshoot) end end if (not keys1) and (not keys2) then bindKey("F", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds." end theVehicle = getPedOccupiedVehicle(cLP) allowShoots() bindKey("Z", "down", toggleText) outputChatBox("#56ff44Press #db8181Z #56ff44to show or hide the instructions!", 255, 255, 255, true) end function toggleText() if textToggle==0 then addEventHandler("onClientRender", getRootElement(), bindsText) textToggle=1 elseif textToggle==1 then removeEventHandler("onClientRender", getRootElement(), bindsText) textToggle=0 end end function allowShoots() bindTrigger = 1 end function cdoshoot() if bindTrigger == 1 then if not isPlayerDead(cLP) then bindTrigger = 0 local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) setTimer(allowShoots, 3000, 1) end end end function bindsText() dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 149, 254, 255), 0.75, "bankgothic") end αfunction startMusic() setRadioChannel(0) song = playSound("files/music.mp3",true) outputChatBox("Toggle music on/off using M") end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("mkmap1_racetheme",toggleSong) bindKey("m","down","mkmap1_racetheme")
-
any one can help me please?
-
local barrier = createObject(968, 1544.6899414063, -1630.8000488281, 13.10000038147, 0, 90, 90) state = 0 function open(player) local x,y,z = getElementPosition(player) if state == 0 and (x >= 1529.63660 and y >= -1628.97876 and z >= 13.38281) and (x <= 1555.20728 and y <= -1627.15662 and z <= 13.38281) then setElementRotation(barrier, 0, 0, 90) state = 1 else if state == 1 and (x >= 1529.63660 and y >= -1628.97876 and z >= 13.38281) and (x <= 1555.20728 and y <= -1627.15662 and z <= 13.38281) then setElementRotation(barrier, 0, 90, 90) state = 0 end end end addCommandHandler("gate", open) not working i am the position and no do nothing someone help
-
if not isObjectInACLGroup(SuperModerator) and isObjectInACLGroup(Admin) something like that i think
-
then i think its getPlayerFromName
-
I know a way its to go to meta and write this <include resource=" "/> inside "" put the name
-
you mean you want create a xml wich include all resource?
-
i need your help idk why i am at position i have put but not working please help local barrier = createObject(968, 1544.6899414063, -1630.8000488281, 13.10000038147, 0, 90, 90) state = 0 function open(player) local x,y,z = getElementPosition(player) if state == 0 and (x >= 1529.63660 and y >= -1628.97876 and z >= 13.38281) and (x <= 1555.20728 and y <= -1627.15662 and z <= 13.38281) then setElementRotation(barrier, 0, 0, 90) state = 1 else if state == 1 and (x >= 1529.63660 and y >= -1628.97876 and z >= 13.38281) and (x <= 1555.20728 and y <= -1627.15662 and z <= 13.38281) then setElementRotation(barrier, 0, 90, 90) state = 0 end end end addCommandHandler("gate", open)