The Killer Posted November 8, 2013 Share Posted November 8, 2013 hello i have a problem that when i select a player and press ' freeze' nothing happend but when i select my self it happend what is the problem in this code ? addEventHandler("onClientGUIClick", root, function () if (source == frez) then local row, col = guiGridListGetSelectedItem(playerlist) local selectp = guiGridListGetItemText(playerlist, row, col) if selectp and selectp ~= "" then local player = getPlayerFromName(selectp) if player then setElementFrozen(player, true) outputChatBox("You Have Been Frozen By " .. getPlayerName(localPlayer), 255, 0, 0) end else outputChatBox("Please Select Player.", 255, 0, 0) end end end ) Link to comment
TAPL Posted November 8, 2013 Share Posted November 8, 2013 You must trigger to server side for setElementFrozen and for the output. Link to comment
The Killer Posted November 8, 2013 Author Share Posted November 8, 2013 so i did the trigger but not working, debug : ERROR: Freeze/server.lua:5: attempt to concatenate a boolean value addEvent("freeze", true) addEventHandler("freeze", root, function (player) setElementFrozen(source, true) outputChatBox("You Have Been Frozen By " .. getPlayerName(player) .. ".", source, 255, 0, 0) end ) Link to comment
The Killer Posted November 8, 2013 Author Share Posted November 8, 2013 addEventHandler("onClientGUIClick", root, function () if (source == frez) then local row, col = guiGridListGetSelectedItem(playerlist) local select = guiGridListGetItemText(playerlist, row, col) if select and select ~= "" then local player = getPlayerFromName(select) if player then triggerServerEvent("freeze", getLocalPlayer()) end else outputChatBox("Please Select Player.", 255, 0, 0) end end end ) Link to comment
TAPL Posted November 8, 2013 Share Posted November 8, 2013 addEvent("freeze", true) addEventHandler("freeze", root, function (player) setElementFrozen(player, true) outputChatBox("You Have Been Frozen By "..getPlayerName(source)..".", player, 255, 0, 0) end) addEventHandler("onClientGUIClick", root, function () if (source == frez) then local row, col = guiGridListGetSelectedItem(playerlist) local select = guiGridListGetItemText(playerlist, row, col) if select and select ~= "" then local player = getPlayerFromName(select) if player then triggerServerEvent("freeze", getLocalPlayer(), player) end else outputChatBox("Please Select Player.", 255, 0, 0) end end end) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now