nasserdfdd Posted June 21, 2015 Share Posted June 21, 2015 hey every one so i have script which set player team ok so i want it also to set role of player so pls help this is the script client GUIEditor = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(589, 389, 520, 321, "Want To Be A Police Man?", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.button[1] = guiCreateButton(9, 32, 501, 107, "ACCEPT", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.button[2] = guiCreateButton(9, 204, 501, 107, "CLOSE", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") end ) function showwindow() guiSetVisible(GUIEditor.window[1],true) showCursor(true) end addEvent("showwin",true) addEventHandler("showwin", getRootElement(), showwindow) function closewindow() if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler("onClientGUIClick", root, closewindow) function setpolice() if source == GUIEditor.button[1] then triggerServerEvent ("setTeamNow",localPlayer) end end addEventHandler("onClientGUIClick", root, setpolice) server local marker = createMarker ( 476.0654296875, -1765.6552734375, 14.117799758911, "cylinder", 1.5, 255, 255, 0, 170 ) function openwindow(hitPlayer) triggerClientEvent (hitPlayer,"showwin",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,openwindow) createTeam("Police", 255, 0, 0) function policeman() local policeteam = getTeamFromName("Police") setPlayerTeam ( source, policeteam ) outputChatBox("You're Now A Police Man!",source,255,0,0) end addEvent( "setTeamNow", true ) addEventHandler( "setTeamNow", root, policeman ) thanks Link to comment
xXMADEXx Posted June 21, 2015 Share Posted June 21, 2015 What do you mean role? There's no default "roles" in MTA. You're probably looking for the setElementData function. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now