• [HELP] Edit the scoreboard (Cinema Gamemode)
    21 replies, posted
Hello ! guys I'm looking for help I want to edit the scoreboard of the cinema server... In the cinema server, when a player is admin, it's draw ADMIN left to his username I would like to do the same when a player is ranked as : Operator [IMG]http://image.noelshack.com/fichiers/2014/26/1403986568-admin.jpg[/IMG] Thanks you guys x3 [editline]28th June 2014[/editline] Here is the code: [lua] function PLAYER:Paint( w, h ) surface.SetDrawColor( 38, 41, 49, 255 ) surface.DrawRect( 0, 0, self:GetSize() ) surface.SetDrawColor( 255, 255, 255, 255 ) if self.Player.IsPixelTail && self.Player:IsPixelTail() then surface.SetMaterial( PixeltailIcon ) surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ) elseif self.Player:IsAdmin() then surface.SetMaterial( AdminIcon ) surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ) end end [/lua] [editline]28th June 2014[/editline] Would this works? [lua] else if self.Player:GetNWString("usergroup") == "Operator"() then surface.SetMaterial( VipIcon ) surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ) [/lua] ???
Something like this: I changed self.Player to something shorter; make sure you define materials outside of draw/render hooks, etc... [lua]local PixeltailIcon = Material( "icon16/arrow_up.png" ); local AdminIcon = Material( "icon16/shield.png" ); local VIPIcon = Material( "icon16/heart.png" ); function PLAYER:Paint( w, h ) surface.SetDrawColor( 38, 41, 49, 255 ); surface.DrawRect( 0, 0, self:GetSize() ); surface.SetDrawColor( 255, 255, 255, 255 ); local _p = self.Player; if ( _p.IsPixelTail && _p:IsPixelTail( ) ) then surface.SetMaterial( PixeltailIcon ); surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ); elseif ( _p:IsAdmin( ) ) then surface.SetMaterial( AdminIcon ); surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ); elseif ( string.lower( _p:GetNWString( "UserGroup" ) ) == "operator" ) then surface.SetMaterial( VIPIcon ); surface.DrawTexturedRect( self.Name.x + self.Name:GetWide() + 5, self.Name.y + 3, 40, 16 ); end end[/lua]
Solved over Steam.
It's works fine for me but here is what players see: [img]http://image.noelshack.com/fichiers/2014/26/1403991167-cadrenoir.jpg[/img] And here is what i see: [img]http://image.noelshack.com/fichiers/2014/26/1403991111-cadre.jpg[/img] I added this line on ressources.lua on: /lua/autorun [lua] resource.AddFile( "materials/theater/vipicon.png" ) resource.AddFile( "materials/theater/adminicon2.png" ) [/lua]
Put that resource.AddFile() file in autorun/server and make sure they're on your FastDL server.
Still not working ! i added it on /lua/autorun/server and people don't see them.. P.S: I don't have FASTDL !
You have to have FastDL for resource.AddFile to work.
The guy told me that his vipicon.png is endomaged?? any idea guys? [IMG]http://image.noelshack.com/fichiers/2014/26/1404001007-ss-2014-06-29-at-02-16-12.jpg[/IMG] do i need to put fastdl?
Are the resources placed on your server and not just saved locally on your computer?
the ressources are placed on my servers !
Either FastDL or upload it to workshop.
You'll need the content on server, AND fastdl, OR workshop ( and addon on server, or files on server )
I added them on my fastdl! and still have the same problem ! OMG! Here are the icons on my fastdl: [url]https://dl.dropboxusercontent.com/u/59689937/fastdl2/garrysmod/materials/icon/adminicon.png[/url] [url]https://dl.dropboxusercontent.com/u/59689937/fastdl2/garrysmod/materials/icon/vipicon.png[/url] and i have this: sv_downloadurl "dl.dropboxusercontent.com/u/59689937/fastdl2/garrysmod/" sv_allowupload 0 sv_allowdownload 1 I still download corrupted files... :'( HELP PLZ ! [IMG]http://image.noelshack.com/fichiers/2014/26/1404049211-icon-precache.jpg[/IMG]
You can't use Dropbox for FastDL...
Also, set sv_allowdownload to 0
Pretty sure you can, but it's not recommended because of bandwith caps
You used to be able to, although not any more due to some restrictions made by Dropbox.
[QUOTE=NiandraLades;45245590]Pretty sure you can, but it's not recommended because of bandwith caps[/QUOTE] You can't anymore since Dropbox changed its file structure, hence why this link doesn't work: [url]https://dl.dropboxusercontent.com/u/59689937/fastdl2/garrysmod/materials/[/url]
So, i need to use another fastdl? [editline]29th June 2014[/editline] What about this FASTDL ?? [url]http://anyome.olympe.in/fastdl/garrysmod/[/url] will it works? [editline]29th June 2014[/editline] I did tihs fastdl ! and still the same problem ... players are precaching corrupted files!
You have to BZIP the files into .bz2 format on your FastDL.
You seem to have the files on your FastDL server in a different directory to what you specified in the resource.AddFile's. Perhaps you should fix that and then try? [editline]30th June 2014[/editline] Your resource.AddFile path: materials/theater/adminicon2.png Your FastDL path: materials/icon/adminicon2.png
No i changed them to this: Your resource.AddFile path: materials/icon/adminicon.png
Sorry, you need to Log In to post a reply to this thread.