HunT Posted September 16, 2011 Share Posted September 16, 2011 (edited) I finish my own admin panel race but Bugged (facepalm) i select the player for push and push me -.- ( ) ClientSide GridList : playersList = guiCreateGridList(28,85,146,149,false,bigWindow) local column = guiGridListAddColumn(playersList, "Drivers", 0.85) if (column) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playersList ) guiGridListSetItemText(playersList, row, column, getPlayerName(playeritem), false, false) guiGridListSetItemColor ( playersList, row, column, 255, 150, 0 ) guiGridListSetScrollBars ( playersList, true, true ) end end function guiGridListRemoveRowByName ( playersList , column , name ) for index = 1 , guiGridListGetRowCount ( playersList ) do if guiGridListGetItemText ( playersList , index , column ) == name then guiGridListRemoveRow ( playersList , index ) break end end end ClientSide onClientGUIClick : function onGuiClick (button, state, absoluteX, absoluteY) if (source == botton1) then client = getLocalPlayer() selectedPlayer = guiGridListGetItemText ( playersList, guiGridListGetSelectedItem (playersList), 1 ) if ( guiGridListGetSelectedItem ( playersList ) ~= -1 ) then triggerServerEvent ("pushim",getLocalPlayer(),selectedPlayer, client) else outputChatBox("No user selected :|'", nil , 255, 0, 0, false) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) ServerSide triggerServerEvent : addEvent("pushim", true) addEventHandler("pushim", rootElement, function() local vehicle = getPedOccupiedVehicle(source) x,y,z = getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.30) outputChatBox("PRO|Admin Panel : Push " ..getPlayerName(source), getRootElement(), 255, 200, 0, true) end ) And the outputChatBox show ever my name where wrong ???? help me please Edited September 17, 2011 by Guest Link to comment
JR10 Posted September 16, 2011 Share Posted September 16, 2011 server: addEvent("pushim", true) addEventHandler("pushim", rootElement, function(player) local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.30) outputChatBox("PRO|Admin Panel : Push " ..getPlayerName(player), getRootElement(), 255, 200, 0, true) end ) You are sending an argument containing the selected player, but you are not using it, you are using source, which is the player who is using the panel. And you don't need client argument @ triggerServerEvent ( "pushhim" ) function onGuiClick (button, state, absoluteX, absoluteY) if (source == botton1) then selectedPlayer = guiGridListGetItemText ( playersList, guiGridListGetSelectedItem (playersList), 1 ) if ( guiGridListGetSelectedItem ( playersList ) ~= -1 ) then triggerServerEvent ("pushim",getLocalPlayer(),selectedPlayer) else outputChatBox("No user selected \"{SMILIES_PATH}/icon_neutral.gif\" alt=\"\" title=\"Neutral\" />'", nil , 255, 0, 0, false) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Link to comment
HunT Posted September 16, 2011 Author Share Posted September 16, 2011 No Work Bad Argument in debugscript 3 "player" Why ? Help please. Link to comment
Cadu12 Posted September 16, 2011 Share Posted September 16, 2011 Post full debugscript, we cant see your files name and lines. Link to comment
JR10 Posted September 16, 2011 Share Posted September 16, 2011 addEvent("pushim", true) addEventHandler("pushim", rootElement, function(name) local player = getPlayerFromName(name) local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.30) outputChatBox("PRO|Admin Panel : Push " ..getPlayerName(player), getRootElement(), 255, 200, 0, true) end ) Link to comment
HunT Posted September 17, 2011 Author Share Posted September 17, 2011 addEvent("pushim", true) addEventHandler("pushim", rootElement, function(name) local player = getPlayerFromName(name) local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.30) outputChatBox("PRO|Admin Panel : Push " ..getPlayerName(player), getRootElement(), 255, 200, 0, true) end ) Now is Perfect. Tnx TheRock 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