Jump to content

I need help


Dimos7

Recommended Posts

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

Edited by Guest
Link to comment

local marker = createMarker (255.38, 77.35, 1003.64, "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 = guiGidListAddRow(playerSkin) 
          guiGidListSetItemText(playerSkin, row, 1, v[1], false, false) 
          guiGidListSetItemData(playerSkin, row, 1, v[2]) 
        if (guiGirdListGetSelectItem(source), ~= -1) then 
           local Select = tonumber(guiGirdListGetItemData(source, guidGirdListGetSelectItem(source), 1) ) 
        if (Select and Select ~= ' ')then 
            triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGidListGetItemData(source, guiGidListGetSelectItem(source),1))) 
        end 
        end 
        end 
        end 
        end     
end   
addEventHandler("onClientMarkerHit", marker, Job) 
  
function Buttons() 
    local data = getElementData("Rank") 
    local Select = tonumber(guiGirdListGetItemData(source, guiGirdListGetSelectItem(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 
end 
addEvent("SetPlayerSkin", true) 
addEventHandler("SetPlayerSkin", root, Buttons) 
addEventHandler("onClientGUIClick", root, Buttons) 
Link to comment
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

Link to comment

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

Edited by Guest
Link to comment
  
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" or "Chief") ) and Select == 1 then 
           setElementModel(localPlayer, 246) 
           triggerServerEvent("PDteam", localPlayer) 
           setElementData(localPlayer, "Job" , "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and Select == 2 then 
           setElementModel(localPlayer, 265) 
           triggerServerEvent("PDteam", localPlayer) 
           setElementData(localPlayer, "Job" , "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and Select == 3 then 
          setElementModel(localPlayer, 266) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and Select == 4 then 
          setElementModel(localPlayer, 267) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and Select == 5 then 
          setElementModel(localPlayer, 280) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and  Select == 6 then 
          setElementModel(localPlayer, 281) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == (" Cadet" or "Chief") ) and Select == 7 then 
          setElementModel(localPlayer, 282) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == ("Cadet" or "Chief") ) and Select == 8 then 
          setElementModel(localPlayer, 283) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == (" Cadet" or "Chief") ) and Select == 9 then 
          setElementModel(localPlayer, 284) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data ==  "SWAT Officer" or ( "Captain" and "Chief" ) ) and  Select == 10 then 
          setElementModel(localPlayer, 285) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == (" Cadet" or "Chief") and  Select == 11 then 
          setElementModel(localPlayer, 288) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif (data == ( "Lieutenant" or  "Chief") ) and Select == 12 then 
          setElementModel(localPlayer, localPlayer) 
          triggerServerEvent("PDteam", localPlayer) 
          setElementData(localPlayer, "Job", "Police Officer") 
        elseif source == refuse then 
           setElementModel(localPlayer, localPlayer) 
           triggerServerEvent("Citizenteam", localPlayer) 
           setElementData(localPlayer, "Job" "Unemployed") 
           guiSetVisible(Jobwindow, false) 
           showCursor(false) 
        elseif source == cancel then 
           guiSetVisible(Jobwindow, false) 
           showCursor(false) 
        else 
          outputChatBox("You have no access!", localPlayer, 255, 0, 0, true) 
        end 
    end 
end 
addEvent("SetPlayerSkin", true) 
addEventHandler("SetPlayerSkin", root, Buttons) 
addEventHandler("onClientGUIClick", root, Buttons) 
  

Link to comment

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?

Edited by Guest
Link to comment

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

Edited by Guest
Link to comment
anyone?

Try:

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", 153}, 
  {"Own Skin", localPlayer}, 
  {"Young Driver", 155}, 
  {"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) 
      triggerServerEvent("Tteam", localPlayer) -- show 
      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) 

Link to comment

this should work:

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", 153}, 
  {"Own Skin", "PlayerSkin"}, 
  {"Young Driver", 155}, 
  {"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) 
    if v[2] == "PlayerSkin" then 
        guiGridListSetItemData(playerSkin, row, 1, getElementModel(localPlayer)) 
    else 
        guiGridListSetItemData(playerSkin, row, 1, v[2]) 
    end 
  end 
end 
addEventHandler("onClientMarkerHit", marker1, Job) 
addEventHandler("onClientMarkerHit", marker2, Job) 
addEventHandler("onClientMarkerHit", marker3, Job) 
addEventHandler("onClientMarkerHit", marker4, Job) 
  
-- 
  
addEventHandler ( "onClientGUIClick", root, 
function(button,state) 
if not Jobwindow or not guiGetVisible(Jobwindow) then return end 
  if source == accept then 
    if guiGridListGetSelectedItem ( playerSkin ) == -1 then outputChatBox ( "Select One Skin !", 255, 0, 0 ) return end 
    local SkinID = guiGridListGetItemData ( playerSkin, guiGridListGetSelectedItem ( playerSkin ), 1 ) 
    setElementModel(localPlayer,SkinID) 
    triggerServerEvent("Tteam", localPlayer, SkinID) -- show 
    setElementData(localPlayer, "Taxi Driver", true) 
    guiSetVisible(Jobwindow, false) 
    showCursor(false) 
  elseif source == refuse then 
    setElementData(localPlayer, "Unemployed", true) 
    setElementData(localPlayer, "Taxi Driver", false) 
    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) 

Link to comment
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
    bindKey(source, "t", "down", "chatbox", "genel") 
    if (account ~= false) then 
       outputChatBox("You must login to speak in chat", player, 255, 0, 0) 
    end 
end) 
  
  
addEventHandler("onResouceStart", getResourceRootElement(getThisResource()), 
function () 
 for index, player in pairs(getElementsByType("player")) do  
  bindKey(player, "t", "down", "chatbox", "genel") 
  end 
 end) 
  
 function onChat(player, _, ...) 
    local message = table.concat( {...}, " ") 
    local name = getPlayerName(player) 
    local r,g,b = getTeamColor(getPlayerTeam(player)) 
    outputChatBox("#FFFFFFSay:"r,g,b..name.."#FFFFFF"..message.., getRootElement(), true) 
end  

http://imgur.com/nwN3P4H

Link to comment
  
function RGBToHex(red, green, blue, alpha) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then 
        return nil 
    end 
    if(alpha) then 
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) 
    else 
        return string.format("#%.2X%.2X%.2X", red,green,blue) 
    end 
end 
  
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
    bindKey(source, "t", "down", "chatbox", "genel") 
    if (account ~= false) then 
       outputChatBox("You must login to speak in chat", player, 255, 0, 0) 
    end 
end) 
  
  
addEventHandler("onResouceStart", getResourceRootElement(getThisResource()), 
function () 
 for index, player in pairs(getElementsByType("player")) do 
  bindKey(player, "t", "down", "chatbox", "genel") 
  end 
 end) 
  
 function onChat(player, _, ...) 
    local message = table.concat( {...}, " ") 
    local name = getPlayerName(player) 
    local r,g,b = getTeamColor(getPlayerTeam(player)) 
    outputChatBox("#FFFFFFSay:"..RGBToHex( r, g, b )..""..name.."#FFFFFF"..message.., getRootElement(), r, g, b true) 
end  
  

Link to comment
function RGBToHex(red,green, blue, alpha)  
    if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then 
    return nil 
    end 
    if (alpha) then 
    return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) 
    else 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
    end 
end 
  
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
bindKey(source, "x", "down", "genal","chatbox", "global") 
end) 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function() 
    for index,player in pairs(getElementsByType("player")) do 
         bindKey(player, "x", "down", "genal" ,"chatbox", "global") 
        sourceAccount = getPlayerAccount(player) 
    if  isGuestAccount(sourceAccount) then 
        outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) 
    end 
    end 
end) 
  
function onChat(player, ...) 
    local name = getPlayerName(player) 
    local message = table.concat({...}," ") 
    local r,g,b = getTeamColor 
    outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) 
    bindKey(player, "x", "down") 
end 
addCommandHandler("genal", onChat) 

http://imgur.com/hPnfWJy

Link to comment
  
function RGBToHex(red,green, blue, alpha) 
    if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then 
    return nil 
    end 
    if (alpha) then 
    return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) 
    else 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
    end 
end 
  
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
bindKey(source, "x", "down", "genal","chatbox", "global") 
end) 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function() 
    for index,player in pairs(getElementsByType("player")) do 
         bindKey(player, "x", "down", "genal" ,"chatbox", "global") 
        sourceAccount = getPlayerAccount(player) 
    if  isGuestAccount(sourceAccount) then 
        outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) 
    end 
    end 
end) 
  
function onChat(player, ...) 
    local name = getPlayerName(player) 
    local message = table.concat({...}," ") 
    local r,g,b = getTeamColor(getPlayerTeam(player)) 
    outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) 
    bindKey(player, "x", "down") 
end 
addCommandHandler("genal", onChat) 
  

Link to comment
addEventHandler("onResourceStart", resourceRoot, 
function() 
    for index,player in pairs(getElementsByType("player")) do 
        if isGuestAccount(getPlayerAccount(player)) then 
            outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) 
        else 
            bindKey(player, "x", "down", "genal" ,"chatbox", "global") 
        end 
    end 
end) 

Link to comment
function RGBToHex(red,green, blue, alpha)  
    if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then 
    return nil 
    end 
    if (alpha) then 
    return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) 
    else 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
    end 
end 
  
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
bindKey(source, "x", "down", "genal","chatbox", "global") 
end) 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function() 
    for index,player in pairs(getElementsByType("player")) do 
    if  isGuestAccount(getPlayerAccount(player)) then 
        outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) 
    else 
        bindKey(player, "x", "down", "genal", "chatbox", "global") 
    end 
    end 
end) 
  
function onChat(player, ...) 
    local name = getPlayerName(player) 
    local message = table.concat({...}," ") 
    local r,g,b = getTeamColor(getPlayerTeam(player)) 
    outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) 
    bindKey(player, "x", "down") 
end 
addCommandHandler("genal", onChat) 

http://imgur.com/qO6jbIz

Link to comment
  
function RGBToHex(red,green, blue, alpha) 
    if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then 
    return nil 
    end 
    if (alpha) then 
    return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) 
    else 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
    end 
end 
  
addEventHandler("onPlayerLogin", getRootElement(), 
function() 
bindKey(source, "x", "down", "genal","chatbox", "global") 
end) 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function() 
    for index,player in pairs(getElementsByType("player")) do 
    if  isGuestAccount(getPlayerAccount(player)) then 
        outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) 
    else 
        bindKey(player, "x", "down", "genal", "chatbox", "global") 
    end 
    end 
end) 
  
function onChat(player, ...) 
    local name = getPlayerName(player) 
    local message = table.concat({...}," ") 
    local r,g,b = getTeamColor(getPlayerTeam(player)) or 255, 255, 255 
    outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) 
    bindKey(player, "x", "down") 
end 
addCommandHandler("genal", onChat) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...