-
Posts
5,973 -
Joined
-
Last visited
-
Days Won
191
IIYAMA's Achievements
Gangsta (45/54)
1.5k
Reputation
Single Status Update
-
Hello, could you help me? I am creating a punishment panel, but I am missing a set timer to kill punished players and return to normal. Could you help me?
-
client
function castig() local screenW, screenH = guiGetScreenSize() jail = guiCreateWindow((screenW - 419) / 2, (screenH - 462) / 2, 419, 462, "CASTIGO", false) guiWindowSetSizable(jail, false) guiSetProperty(jail, "CaptionColour", "FF00EBF9") juga = guiCreateGridList(22, 50, 176, 384, false, jail) guiGridListAddColumn(juga, "Jugadores", 0.9) for _, player in ipairs(getElementsByType("player")) do guiGridListAddRow(juga, getPlayerName(player)) end castiga = guiCreateButton(259, 90, 107, 33, "Castigar", false, jail) guiSetProperty(castiga, "NormalTextColour", "FF2300FC") barb = guiCreateButton(259, 214, 107, 33, "Barbie", false, jail) guiSetProperty(barb, "NormalTextColour", "FFFA00EC") clove = guiCreateButton(259, 352, 107, 33, "Cerrar", false, jail) guiSetProperty(clove, "NormalTextColour", "FFFE0000") showCursor (true) end addEvent( "onCasti", true ) addEventHandler( "onCasti", localPlayer, castig ) addEventHandler('onClientGUIClick',root, function() if source == clove then guiSetVisible(jail,false) showCursor(false) end end) addEventHandler('onClientGUIClick',root, function() if source == castiga then local row = guiGridListGetSelectedItem(juga) local text = guiGridListGetItemText(juga,row,1) if ( row > -1 ) then triggerServerEvent('setCastigo',getPlayerFromName(text)) guiSetVisible(jail,false) showCursor(false) end end end) addEventHandler('onClientGUIClick',root, function() if source == barb then local row = guiGridListGetSelectedItem(juga) local text = guiGridListGetItemText(juga,row,1) if ( row > -1 ) then triggerServerEvent('setCastigoNo',getPlayerFromName(text)) guiSetVisible(jail,false) showCursor(false) end end end)
server
addCommandHandler ("castigo", function ( playerSource ) local cuenta = getAccountName(getPlayerAccount(playerSource)) if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIP")) then triggerClientEvent ( playerSource, "onCasti", playerSource) end end ) addEvent("setCastigo", true) addEventHandler("setCastigo", root, function() setElementPosition ( source , 345.5478515625, 302.33984375, 999.93817138672 ) setElementDimension ( source, 1 ) setElementInterior ( source, 6 ) end) addEvent("setCastigoNo", true) addEventHandler("setCastigoNo", root, function() setElementPosition ( source , 1485.6689453125, -1757.4423828125, 17.53125 ) setElementDimension ( source, 0 ) setElementInterior ( source, 0 ) end)