Subtixx Posted June 15, 2011 Share Posted June 15, 2011 I hope you can help me .. So I have now tried a command to the Factions scripts (client side) but there is always the fault call failed "string"? Script: function policeDuty(commandName) if exports.factions:isPlayerInFactionType( getLocalPlayer(), 1) then showCursor(true) guiSetVisible(DutyWindow, true) else outputChatBox("Police Department fail!") end outputChatBox(tostring(exports.factions:isPlayerInFactionType( getLocalPlayer(), 1))) end addCommandHandler("pduty",policeDuty) And The images are not displayed .. Script: Waffe1 = guiCreateButton(26,31,85,81,"Deagle",false,DutyWaffenWindow) WaffeImg1 = guiCreateStaticImage(4,4,78,72,"images/DEAGLE.png",false,Waffe1) EDIT: meta.xml: <script src="police/duty/duty_c.lua" type="client" /> <script src="police/duty/duty.lua" type="server" /> <file src="police/duty/images/280.png" /> <file src="police/duty/images/281.png" /> <file src="police/duty/images/282.png" /> <file src="police/duty/images/284.png" /> <file src="police/duty/images/DEAGLE.png" /> <file src="police/duty/images/MP5.png" /> <file src="police/duty/images/M4.png" /> <file src="police/duty/images/SNIPER.png" /> Link to comment
Castillo Posted June 15, 2011 Share Posted June 15, 2011 That's because the function: isPlayerInFactionType it's only server-side in that script. Link to comment
Subtixx Posted June 15, 2011 Author Share Posted June 15, 2011 yeah but in my script i tried to make this: (server-side) function getTheFaction(thePlayer,factionID) if isPlayerInFactionType(thePlayer,factionID) then tempdata = 1 else tempdata = 0 end setElementData(thePlayer,"tempdata.factions",tostring(tempdata)) --getPlayerFactions( thePlayer ) end but the answer was: Police Department fail false Link to comment
Castillo Posted June 15, 2011 Share Posted June 15, 2011 Now I don't understand anything, you we're trying to call a function from factions resource which is only server-side from a client-side script, and now you want something totally different... Link to comment
Subtixx Posted June 15, 2011 Author Share Posted June 15, 2011 Okay. I have made an GUI for the Duty (Weapons and Skins) I want when a player type: /pduty and the Player is in the Faction Police that the GUI opens EDIT: but when the function isPlayerInFaction serverside how do i do that then? Link to comment
JR10 Posted June 15, 2011 Share Posted June 15, 2011 -- server side addCommandHandler('pduty', function(source) if isPlayerInFaction(source, 1) then triggerClientEvent(source, 'showDutyGUI', source) end end ) and then add the event 'showDutyGUI' and in that event show the gui Link to comment
Subtixx Posted June 15, 2011 Author Share Posted June 15, 2011 omg so simple ... im dump.. sorry. Thanks!! And my Image Problem? Full Script: http://pastebin.com/j5gkyj2Y Meta.xml in the first post Link to comment
Castillo Posted June 15, 2011 Share Posted June 15, 2011 Well, your path's are wrong... WaffeImg1 = guiCreateStaticImage(4,4,78,72,"images/DEAGLE.png",false,Waffe1) It should be: WaffeImg1 = guiCreateStaticImage(4,4,78,72,"police/duty/images/DEAGLE.png",false,Waffe1) Link to comment
Subtixx Posted June 15, 2011 Author Share Posted June 15, 2011 Edit: THX. im really dump.. Please Close 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