#Al-Ha[J]aRii Posted March 29, 2013 Share Posted March 29, 2013 Hi All what function I wil use it for to do this bomb when I press in button open window and I do the window and in this window get all player's name it's in the shop see this picture -_-" and this picture what I wil use function in it it's put on u bomb and after 5 sec she wil Explode this is the picture Link to comment
CaptainZ. Posted March 29, 2013 Share Posted March 29, 2013 I don't get it dxDrawImage ? Please speak English atleast bit better Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 You want to set player's name in gridlist? right? and you want to create explosion? if so : getElementsByType -- getAllPlayer's guiGridListClear -- To Clear The Grid From Spam Name's guiGridListAddRow -- You should add the row guiGridListSetItemText -- To set player's name in the list getPlayerName -- GetPlayer name fucntion and do it like that : for _,v in ipairs(getElement.........); and use to create the explosion : createExplosion I Hope that you understand what i said . Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 You want to set player's name in gridlist? right?and you want to create explosion? if so : getElementsByType -- getAllPlayer's guiGridListClear -- To Clear The Grid From Spam Name's guiGridListAddRow -- You should add the row guiGridListSetItemText -- To set player's name in the list getPlayerName -- GetPlayer name fucntion and do it like that : for _,v in ipairs(getElement.........); and use to create the explosion : createExplosion I Hope that you understand what i said . I understand all but the getPlayerName I did't understand how to put the name player in the Row and I create guiGridListSetItemText Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 Check this out : ChangeGridListItemToPlayersName Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 Check this out :wil be like this ? ChangeGridListItemToPlayersName GUIEditor = { gridlist = {}, button = {}, } wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.90) GridList = guiCreateGridList(9, 19, 221, 226, false, wnd) guiGridListAddColumn(GridList, "Name", 0.9) for i = 1, 30 do guiGridListAddRow(GridList) end guiGridListSetItemText(GridList, 0, 1, "-", false, false) guiGridListSetItemText(GridList, 1, 1, "-", false, false) guiGridListSetItemText(GridList, 2, 1, "-", false, false) guiGridListSetItemText(GridList, 3, 1, "-", false, false) guiGridListSetItemText(GridList, 4, 1, "-", false, false) guiGridListSetItemText(GridList, 5, 1, "-", false, false) guiGridListSetItemText(GridList, 6, 1, "-", false, false) guiGridListSetItemText(GridList, 7, 1, "-", false, false) guiGridListSetItemText(GridList, 8, 1, "-", false, false) guiGridListSetItemText(GridList, 9, 1, "-", false, false) guiGridListSetItemText(GridList, 10, 1, "-", false, false) guiGridListSetItemText(GridList, 11, 1, "-", false, false) guiGridListSetItemText(GridList, 12, 1, "-", false, false) guiGridListSetItemText(GridList, 13, 1, "-", false, false) guiGridListSetItemText(GridList, 14, 1, "-", false, false) guiGridListSetItemText(GridList, 15, 1, "-", false, false) guiGridListSetItemText(GridList, 16, 1, "-", false, false) guiGridListSetItemText(GridList, 17, 1, "-", false, false) guiGridListSetItemText(GridList, 18, 1, "-", false, false) guiGridListSetItemText(GridList, 19, 1, "-", false, false) guiGridListSetItemText(GridList, 20, 1, "-", false, false) guiGridListSetItemText(GridList, 21, 1, "-", false, false) guiGridListSetItemText(GridList, 22, 1, "-", false, false) guiGridListSetItemText(GridList, 23, 1, "-", false, false) guiGridListSetItemText(GridList, 24, 1, "-", false, false) guiGridListSetItemText(GridList, 25, 1, "-", false, false) guiGridListSetItemText(GridList, 26, 1, "-", false, false) guiGridListSetItemText(GridList, 27, 1, "-", false, false) guiGridListSetItemText(GridList, 28, 1, "-", false, false) guiGridListSetItemText(GridList, 29, 1, "-", false, false) GUIEditor.button[1] = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd) changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; GUIEditor = { gridlist = {}, button = {}, } wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.90) GridList = guiCreateGridList(9, 19, 221, 226, false, wnd) guiGridListAddColumn(GridList, "Name", 0.9) changeGridListItemToPlayersName(GridList,1) GUIEditor.button[1] = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd) Now you can see player's name in the list but u can't add "-" why? because the add player name need the column ._. . Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; GUIEditor = { gridlist = {}, button = {}, } wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.90) GridList = guiCreateGridList(9, 19, 221, 226, false, wnd) guiGridListAddColumn(GridList, "Name", 0.9) changeGridListItemToPlayersName(GridList,1) GUIEditor.button[1] = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd) Now you can see player's name in the list but u can't add "-" why? because the add player name need the column ._. . so now I don't need the guiGridListSetItemText Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 Yes you can see player's name with this useful function . Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 is my code now server is true? Client Side! changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; GUIEditor = { gridlist = {}, button = {}, } wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.90) GridList = guiCreateGridList(9, 19, 221, 226, false, wnd) guiGridListAddColumn(GridList, "Name", 0.9) changeGridListItemToPlayersName(GridList,1) Explosion = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd) addEventHandler("onClientGUIClick", root, function() if (source == NameButtonShop) then guiSetVisible ( wnd, true ) showCursor(true) guiSetInputEnabled(true) end end) addEventHandler("onClientGUIClick", root, function() if (source == Explosion) then triggerServerEvent("Explosion",localPlayer()) guiSetVisible ( wnd, false ) showCursor(false) guiSetInputEnabled(false) end end) Server Side ! addEvent("Explosion", true) addEventHandler("Explosion", root, function () for k,v in ipairs(getElementsByType("player"))do local x, y, z = getElementPosition ( source ) createExplosion ( x , y , z , 0 ,nil , source ) end end) Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 You want to blow all player's in the server?Or just the one that you select it? Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 You want to blow all player's in the server?Or just the one that you select it? just one player when I select in his name and I do when the player click in the button blow hide the window and player blow Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 -- Client Side -- changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false); guiWindowSetSizable(wnd, false); guiSetAlpha(wnd, 0.90); GridList = guiCreateGridList(9, 19, 221, 226, false, wnd); guiGridListAddColumn(GridList, "Name", 0.9); changeGridListItemToPlayersName(GridList,1); Explosion = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd); addEventHandler("onClientGUIClick",Explosion, function ( ) local Name = guiGridListGetItemText(GridList, guiGridListGetSelectedItem(GridList), 1); local Who = getPlayerFromName ( Name ); if guiGridListGetSelectedItem(GridList) == -1 then return outputChatBox("* Please Select Player!!",255,0,0,true); end triggerServerEvent("Explosion",localPlayer,Who); guiSetVisible ( wnd, false ); showCursor(false); end,false); -- Server Side -- addEvent("Explosion",true); addEventHandler("Explosion",getRootElement(), function ( Who ) local x,y,z = getElementPosition ( Who ); createExplosion ( x,y,z,10,Who ); outputChatBox("* You have been blown up by [#0000FF"..getPlayerName(source).."#FFFF00] ",Who,255,255,0,true); outputChatBox("* The Player ["..getPlayerName(Who).."] been successfully blow up!",source,0,255,0,true); end ); Try it . Link to comment
ixjf Posted March 29, 2013 Share Posted March 29, 2013 Yes you can see player's name with this useful function . How is it useful? Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 -- Client Side -- changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), Column, getPlayerName ( v ), false, false ); end; end; end; end; end; wnd = guiCreateWindow(434, 133, 254, 304, "Window Explosion !", false); guiWindowSetSizable(wnd, false); guiSetAlpha(wnd, 0.90); GridList = guiCreateGridList(9, 19, 221, 226, false, wnd); guiGridListAddColumn(GridList, "Name", 0.9); changeGridListItemToPlayersName(GridList,1); Explosion = guiCreateButton(14, 253, 221, 36, "Explosion", false, wnd); addEventHandler("onClientGUIClick",Explosion, function ( ) local Name = guiGridListGetItemText(GridList, guiGridListGetSelectedItem(GridList), 1); local Who = getPlayerFromName ( Name ); if guiGridListGetSelectedItem(GridList) == -1 then return outputChatBox("* Please Select Player!!",255,0,0,true); end triggerServerEvent("Explosion",localPlayer,Who); guiSetVisible ( wnd, false ); showCursor(false); end,false); -- Server Side -- addEvent("Explosion",true); addEventHandler("Explosion",getRootElement(), function ( Who ) local x,y,z = getElementPosition ( Who ); createExplosion ( x,y,z,10,Who ); outputChatBox("* You have been blown up by [#0000FF"..getPlayerName(source).."#FFFF00] ",Who,255,255,0,true); outputChatBox("* The Player ["..getPlayerName(Who).."] been successfully blow up!",source,0,255,0,true); end ); Try it . thanx I wil try it now Link to comment
#Al-Ha[J]aRii Posted March 29, 2013 Author Share Posted March 29, 2013 Yes you can see player's name with this useful function . How is it useful? useful means player do the function and put it in the wiki https://wiki.multitheftauto.com/wiki/DxDrawColorText see down Author: Aibo https://wiki.multitheftauto.com/wiki/Useful_Functions Link to comment
ixjf Posted March 29, 2013 Share Posted March 29, 2013 Yes you can see player's name with this useful function . How is it useful? useful means player do the function and put it in the wiki https://wiki.multitheftauto.com/wiki/DxDrawColorText see down Author: Aibo https://wiki.multitheftauto.com/wiki/Useful_Functions That makes no sense, and has nothing to do with what I asked. Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 Yes you can see player's name with this useful function . How is it useful? if you have many grid list you can use this function it will be easy to use it to add players to much grid . Link to comment
ixjf Posted March 29, 2013 Share Posted March 29, 2013 That's too basic stuff and can be made in less than a minute. Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 That's too basic stuff and can be made in less than a minute. I do not care for this I did not create this page, just tell your opinion to the page creator not to me . Link to comment
Tete omar Posted March 29, 2013 Share Posted March 29, 2013 (edited) Mr.Pres[T]ege, you don't get what #|~Al-7A[J]Rii~| wants, iirc, they wants to attach a bomb to the player who's clicked on some gui-button and this bomb will explode in a certain time, that's it.. Edited March 29, 2013 by Guest Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 @ TeTe Hmm.. i think that " #|~All-7AJ]I~| " want when the player press the button will explode the player that you select it . 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