Jump to content

PunishLog Script[HELP]


Price.

Recommended Posts

actually this is new for me the mysql and stuff but uhm i was trying to make punishlog so i can do /punishlog opens me a gui so far i made that gui and command the thing i need help with is , when i mute or jail or ban....etc those kind of punishments it gets written in the player's punishlog and also i couldn't make the /punishlog to appear to specific person, i mean when i do /punishlog it appears for me only and for my serial number only bec of the punishments for me and if anyon

e else did /punishlog it opens it for his serial number only, need help :?

GUIEditor = { 
    tabpanel = {}, 
    tab = {} 
} 
windowhelp = guiCreateWindow(0, 0, 800, 600, "Punish Log", false) 
guiWindowSetSizable(windowhelp, false) 
  
GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 33, 781, 557, false, windowhelp) 
  
GUIEditor.tab[1] = guiCreateTab("PunishLog", GUIEditor.tabpanel[1]) 
rulesEN = guiCreateMemo(4, 4, 773, 525, "", false, GUIEditor.tab[1]) 
guiMemoSetReadOnly(rulesEN, true) 
  
  
buttonclose = guiCreateButton(691, 24, 99, 29, "Close Window", false, windowhelp) 
guiSetVisible (windowhelp,false) 
  
function windowhelpopen() 
if guiGetVisible (windowhelp) == true then 
        guiSetVisible (windowhelp,false) 
        showCursor (false) 
        else 
        showCursor (true) 
        guiSetVisible (windowhelp,true) 
    end 
end 
addCommandHandler( "punishlog", windowhelpopen ) 
  
function windowhelpclose () 
    if source == buttonclose then 
        showCursor (false) 
        guiSetVisible (windowhelp,false) 
    end 
end 
addEventHandler ("onClientGUIClick", root, windowhelpclose) 
  
function createFileHandler() 
local RootNode = xmlCreateFile("new.xml"," newroot") 
local NewNode = xmlCreateChild(RootNode, "newchild") 
xmlSaveFile(RootNode) 
end 
  
addCommandHandler("createfile", createFileHandler) 

Link to comment

Was you talking about mysql?

I can't find anything related to mysql in your code, as i can see it's seems you did nothing at all.

From variable names: windowhelp and rulesEN and copy past wiki example from function xmlCreateFile. It seems to me you are trying to do a mix of codes from other resources and wiki examples?

Can this mix give you a working script at the end? Nope rather than that, try to learn something instead of the mixture you posted here because it make no sense at all.

Link to comment

What I would do is, set /punishlog server side then trigger it to client side with the getPlayerFromName variable ( the player you want to see the GUI) and if the local player is the player you want then set the gui visible. Like:

  
--Server 
addCommandHandler('punishlog', function(playerSource, command, target) 
local targetplayer = getPlayerFromName(target) 
  
    if targetPlayer then 
      triggerClientEvent(getRootElement(), 'openGUI', target) 
    end 
end) 
  
--Client 
addEvent('openGUI', true) 
addEventHandler('openGUI', getRootElement(), function ( target ) 
    if target == getLocalPlayer() then 
        --set your gui visible 
    end 
end) 

Link to comment

well my point is when i mute them or ban them it gets written in the punishlog of a specific player i banned or muted,

Ex: i banned someone called Price

Price has been banned be price for 3 hrs

Punishlog:

3/11/2013 Price has been banned for 3 hours reason: test

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...