# Server :
addEvent("slap",true)
addEventHandler("slap",root,
function (plr,reasons)
outputChatBox(plr.." Has Slapped By "..getPlayerName (source).." Reason : "..reasons,source, 255, 0, 0, false)
end
# Client :
addEventHandler("onClientGUIClick",root,
function ( )
if ( source == SlapButton ) then
if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList ),1)
local player = getPlayerFromName ( plr )
local reasons = guiGetText ( Edit ) -- اسم الايديت
triggerServerEvent("slap", localPlayer, plr, reasons)
setElementHealth(player, 0)
guiSetVisible(SlapWnd,false)
guiSetInputEnabled(false)
showCursor(false)
end
end
end
)
^ جرب الحين ، غلط ب لوكال بلاير لأني نسخت الكود سريع سريع وما عدلته