Jump to content

PunishLog Script[HELP]


Price.

Recommended Posts

Posted

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) 

Posted

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.

Posted

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) 

Posted

actually someone told me to make that XML thingy, and i really have no idea how to make mysql or sql stuff to get this done.

yea but it i still need the punishments gets written when i mute or ban anyone.

Posted

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

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