Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. text does not change in gridList
  2. hmm i must be a little slow today - i dont understand you... you want to trigger event for all clients, but only add event in one client? i is like this triggerClientEvent( "selectSkill",player, skillsID) this triggerClientEvent(player, "selectSkill", skillsID) trigger the event for one client and set skillsID as source in a handler function... Where do you see that I want to trigger for all clients ? I want for only the corect client so: triggerClientEvent(player, "selectSkill", skillsID) Because: this is not working saying bad argument@`triggerClientEvent` but he saying text change 0 but he not changed text in gridlist client: function startShowingShopLevelMenu() showCursor(true) GUIEditor_Grid = {} MainWindowLevel = guiCreateWindow(0.2234,0.0586,0.5969,0.9102,"New Skills Shop",true) MainButton = guiCreateButton(0.1289,0.9418,0.6974,0.0370,"Buy Skill",true,MainWindowLevel) GUIEditor_Grid[211] = guiCreateGridList(0.0419,0.0354,0.9058,0.8970,true,MainWindowLevel) guiGridListSetSelectionMode(GUIEditor_Grid[211],1) for i = 1, 19 do guiGridListAddRow(GUIEditor_Grid[211]) end guiGridListAddColumn(GUIEditor_Grid[211],"ID",0.2) guiGridListAddColumn(GUIEditor_Grid[211],"Name",0.2) guiGridListAddColumn(GUIEditor_Grid[211],"$",0.2) guiGridListAddColumn(GUIEditor_Grid[211],"Level",0.2) guiGridListAddColumn(GUIEditor_Grid[211],"Status",0.2) addEventHandler ("onClientGUIClick", MainButton, onClientPlayerSkillBuy) for i,v in ipairs (skillsLevelsTable) do local row21 = guiGridListAddRow (GUIEditor_Grid[211]) guiGridListSetItemText (GUIEditor_Grid[211], row21, 1, v[1], false, true) guiGridListSetItemText (GUIEditor_Grid[211], row21, 2, v[2], false, true) guiGridListSetItemText (GUIEditor_Grid[211], row21, 3, v[3], false, true) guiGridListSetItemText (GUIEditor_Grid[211], row21, 4, v[4], false, true) guiGridListSetItemText (GUIEditor_Grid[211], row21, 5, v[5], false, true) guiGridListSetItemText (GUIEditor_Grid[211], row21, 6, v[6], false, true) end end table:(in client) skillsLevelsTable = { {"0","Deagle Easy Skill 1","3250","11"}, {"1","Deagle Normal Skill 2","5500","13"}, {"2","Deagle Hard Skill 3","8000","15"}, {"3","Deagle Very Hard Skill 4","15800","17"}, {"4","Deagle ~Pro~ Skill 5","21000","20"}, {"5","Shotgun Easy Skill 1 ","4500","12"}, {"6","Shotgun Normal Skill 2 ","8500","14"}, {"7","Shotgun Hard Skill 3","13000","16"}, {"8","Shotgun Very Hard Skill 4","15000","18"}, {"9","Shotgun ~Pro~ Skill 5","24000","21"}, {"10","SPAZ-12 Easy Skill 1 ","16500","22"}, {"11","SPAZ-12 Normal Skill 2 ","24500","28"}, {"12","SPAZ-12 Hard Skill 3 ","35500","32"}, {"13","SPAZ-12 Very Hard Skill 4 ","42500","36"}, {"14","SPAZ-12 ~Pro~ Skill 5 ","47500","40"}, {"15","MP5 Easy Skill 1 ","13130","16"}, {"16","MP5 Normal Skill 2 ","19450","19"}, {"17","MP5 Hard Skill 3 ","25500","23"}, {"18","MP5 Very Hard Skill 4 ","29330","26"}, {"19","MP5 ~Pro~ Skill 5 ","35000","29"}, {"20","AK-47 Easy Skill 1 ","15000","20"}, {"21","AK-47 Normal Skill 2 ","22500","24"}, {"22","AK-47 Hard Skill 3 ","27570","28"}, {"23","AK-47 Very Hard Skill 4 ","35130","32"}, {"24","AK-47 ~Pro~ Skill 5 ","43030","36"}, {"25","M4A1 Easy Skill 1 ","17110","25"}, {"26","M4A1 Normal Skill 2 ","25350","30"}, {"27","M4A1 Hard Skill 3 ","36100","35"}, {"28","M4A1 Very Hard Skill 4 ","44400","40"}, {"29","M4A1 ~Pro~ Skill 5 ","50000","45"} }
  3. Ok, I found two errors: 1- The function is function getSkillFunc(player,Levelids) so why you made getSkillFunc(1,source) it's getSkillFunc(source,1) 2-Why your 'tonumber's are empty ? function getSkillFunc(player,Levelids) if ( Levelids ) then local skillsID = tonumber( Levelids ) triggerClientEvent(source, "selectSkill", source,skillsID) return true else return false end end And like Solidsnake, I don't understand what do you want to do exactly This Works he Triggered to Client !!! YEEE THX MAN but client side not work addEvent("selectSkill",true) addEventHandler( "selectSkill", getRootElement(), function(skillsID) outputChatBox("trigger Called YEE"..tostring(skillsID)) -- says nil else tonumber and if something does not work function wtf??? if (tonumber(skillsID)) then outputChatBox("1") guiGridListSetItemText(GUIEditor_Grid[211],tonumber(skillsID),5,"purchased",false,false) outputChatBox("2") guiGridListSetItemColor (GUIEditor_Grid[211],tonumber(skillsID),5,0,255,0) outputChatBox("text change "..tonumber(skillsID)) end end )
  4. yes I meant it but getSkillFunc not working = (
  5. Сёдня поискал нашёл ещё туторы: http://forum.woh.ru/showthread.php?t=137545 http://gpub.ru/programmirovanie-lua-primeri-t134.html это примеры скриптов Mx Master добавь ко всем существующим ещё эти ссылки.
  6. Use resource textlib and arbitrary functions added Make checks text and lines and use the library textlib
  7. i should off chat https://wiki.multitheftauto.com/wiki/ShowChat and use events https://wiki.multitheftauto.com/wiki/OnPlayerChat https://wiki.multitheftauto.com/wiki/DxDrawText and https://wiki.multitheftauto.com/wiki/OnClientPlayerJoin https://wiki.multitheftauto.com/wiki/OnClientPlayerQuit https://wiki.multitheftauto.com/wiki/OnC ... ChangeNick
  8. вообщем есть проблема функция getSkillFunc function getSkillFunc(player,Levelids) if (Levelids == tonumber) then local skillsID = tonumber triggerClientEvent(source, "selectSkill", source,skillsID) return true else return false end end клиент addEvent("selectSkill",true) addEventHandler( "selectSkill", getRootElement(), function(skillsID) if (tonumber(skillsID)) then guiGridListSetItemText(GUIEditor_Grid[211],tonumber(skillsID),5,"purchased",false,false) guiGridListSetItemColor (GUIEditor_Grid[211],tonumber(skillsID),5,0,255,0) outputChatBox("текст изменился на "..tonumber(skillsID)) end end ) вызывается так getSkillFunc(1,source) функция skillButtonFunc function skillButtonFunc (Levelids, Levelnames,Levelmoneys,LevelLevels ,LevelStatus) outputChatBox("skill buy") if (Levelids == "0") then outputChatBox("0") getThisElementData(4,source) takeMoneyFunc(3250,4,source) getSkillFunc(0,source) setPedStat(source, 71, 99) elseif (Levelids == "1") then getThisElementData(1,source) takeMoneyFunc(5500,1,source) getSkillFunc(1,source) setPedStat(source, 71, 299) end end addEvent ("PlayerSkillBuy", true) addEventHandler ("PlayerSkillBuy", getRootElement(),skillButtonFunc) не работает функция вообщем суть такова когда игрок покупает скилл он должен проверять Levelids и тригером менять текст в гридлисте. но я не знаю как перенести аргумент из функции skillButtonFunc. помогите пожалуйста.
  9. ok but I did not understand how to do to get the skill function I do not know how to pass from a function skillButtonFunc a function getSkillFunc argument Levelids perhaps because of it not working. function getSkillFunc(player,Levelids) if (Levelids == tonumber) then local skillsID = tonumber triggerClientEvent(source, "selectSkill", source,skillsID) return true else return false end end getSkillFunc(1,source) addEvent("selectSkill",true) addEventHandler( "selectSkill", getRootElement(), function(skillsID) if (skillsID == tonumber(1)) then guiGridListSetItemText(GUIEditor_Grid[211],1,5,"purchased",false,false) guiGridListSetItemColor (GUIEditor_Grid[211], 1,5,0,255,0) outputChatBox("text change 1") elseif (skillsID == tonumber(2)) then guiGridListSetItemText(GUIEditor_Grid[211],2,5,"purchased",false,false) guiGridListSetItemColor (GUIEditor_Grid[211],2,5,0,255,0) outputChatBox("text change 2") end end )
  10. try to watch all the col file area 51, ​​and there editore molecules will be drawn Coliseum something like this: the fact that this is the gray density of the object. and that it passes through just delete polygons in col editor.
  11. you want to do that you would pass through this object? First find the name col model of the object in the Med 0.32 - Map Editor for GTA San Andreas locate the object on the map stalemate pull through the img tool 2 and through the Col Editor, change the density of the object Tutorials : http://gtamaps.net/forum/index.php?showforum=40 on Russian language translate this.
  12. guys i have new question in general, so I've done almost everything I wanted but I need to do that when the ability to buy something changed text guiGridList but I do not know how to get the player if he bought a skill or not and what kind of skill client event local localPlayer = getLocalPlayer() addEvent("selectSkill",true) addEventHandler( "selectSkill", localPlayer, function(rowIndex) outputChatBox("trigger called") guiGridListSetItemText(GUIEditor_Grid[211],rowIndex,5,"purchased",false,false) guiGridListSetItemColor (GUIEditor_Grid[211], rowIndex,5,0,255,0) outputChatBox("text change") end ) server function skillButtonFunc (Levelids, Levelnames,Levelmoneys,LevelLevels ,LevelStatus) outputChatBox("skill buy") if (Levelids == "0") then outputChatBox("0") getThisElementData(4,source) takeMoneyFunc(3250,4,source) triggerClientEvent(source, "selectSkill", source, 1) outputChatBox("trigger working") setPedStat(source, 71, 99) elseif (Levelids == "1") then getThisElementData(1,source) takeMoneyFunc(5500,1,source) triggerClientEvent(source, "selectSkill", source, 2) outputChatBox("trigger working") setPedStat(source, 71, 299) end end addEvent ("PlayerSkillBuy", true) addEventHandler ("PlayerSkillBuy", getRootElement(),skillButtonFunc) so I tested it but if you do not even have enough money, he still calls the event, and I think what you need as you get bought if the player skill number but I do not know how
  13. Mx Master программа хорошая советую всем удобный поисковик вобщем всё что нужно но он паходу не сохраняет в формат db только sql xomka видал плагин на ооф сайте для мозилы.
  14. Уважаемые форумчане посоветуйте хорошую прогу с работой db файлов (базы данных). Раньше юзал SQLite Database Browser , но она не катит т.к мало функций. Мне просто нужно почистить базу данных от ненужного. Вообщем посоветуйте .Я думаю всем пригодится.
  15. it works great thanks!
  16. try this setTimer(function() for id, player in ipairs(getElementsByType("player")) do if getElementModel(player ) == 78 then setPlayerTeam ( player , teamWorkless) end end end,1000,0) please explain how you would like to receive getElementModel in which case
  17. how you use setTeams function?
  18. please help script perfectly working. I have a question how do I stop takeMoneyFunc if the player does not have this level? function skillButtonFunc (Levelids, Levelnames,Levelmoneys,LevelLevels ,LevelStatus) outputChatBox("skill buy") if (Levelids == "0") then outputChatBox("0") getThisElementData(4,source) takeMoneyFunc(3250,source) setPedStat(source, 71, 99) elseif (Levelids == "1") then getThisElementData(1,source) takeMoneyFunc(5500,source) setPedStat(source, 71, 299) end end addEvent ("PlayerSkillBuy", true) addEventHandler ("PlayerSkillBuy", getRootElement(),skillButtonFunc) function takeMoneyFunc(cashs,player) if (getPlayerMoney (player) >= cashs) then outputChatBox("skill buying") takePlayerMoney (player,cashs) else outputChatBox("you not have money ") end end function getThisElementData(tostring,player) if (getElementData (player,"Level") == tostring) then outputChatBox("level suitable") else outputChatBox("Level insufficient ") end end
  19. Kenix

    question

    thank you so much I just did not know that there is an event for this thanks a lot
  20. Kenix

    question

    how to remove the rear it was impossible to kill with a knife. help guys. may be because I'm not sure. function stopingKnifeHeadKill ( attacker, weapon, bodypart ) if ( weapon == 4 ) then if ( bodypart == 9 ) then cancelEvent() end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopingKnifeHeadKill )
  21. в том то и дело что не все можно моды и скрипты запустить через amx
×
×
  • Create New...