Jump to content

kino

Members
  • Posts

    87
  • Joined

  • Last visited

Everything posted by kino

  1. есть массив _G он доступен из любого срв скрипта _G["var"]
  2. у меня 2 вопроса 1 почему не работает этот код function onChat(player,msgc,t) if t == 0 then local px,py,pz=getElementPosition(player) local msg = table.concat(msgc, " ") local nick=getPlayerName(player) local r,g,b =255,255,255 for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox(""..nick..": "..msg,v,r,g,b,true) end end end if t ==2 then local r,g,b= getTeamColor(getPlayerTeam(player)) local msg = table.concat(msgc, " ") local nick=getPlayerName(player) rank=getElementData(player,"frang") outputChatBox(rank .." "..nick..": "..msg,getPlayerTeam(player),r,g,b,true) end cancelEvent () end addCommandHandler("Local",onChat) addEventHandler( "onPlayerChat", getRootElement(), onChat ) 2вопрос как сделать камеру сделать как в кат сценах обрезанная по верхним краям?
  3. вот есть строка bindKey(source,"u","down","chatbox","Local") я так понял что при ножатии кнопки он открывает окно чата и отправляет текст на функцию local так? где об этом прочесть ?
  4. ладно как мне взять данные этого типа и разложить по переменным иными словами как прочесть файл используя разделитель
  5. мне лень создавать автопарк гз и т.п из такого 536,2118.743408,-1140.133666,24.724407,304.783538,3,0,Dealership,Blade,70000,,0,1 И такого None|0xFF000069|1961.417|-1966.099|2197.193|-1760.817 в xml
  6. спать надо ночью) можно сделать доп иды поиграться с вс(weaponstats)и хронить инфу о пухах Setelementdate (player ) и в зовимости от ида ставить текстуру
  7. SetPlayerMoney по опыту скажу если отнимим больше чем есть выйдим в0
  8. привет я не мог удержаться и поныть во первых я очень долго отходил от си так как я пишу активно на php 2 Я писал мод я потерял 4 месяца на баге с тонумбер 3 мне кажется что с выходам гта5 все бросят са хотя гта 4 тоже пророчили популярность мне просто обиддно что я упустил свое время
  9. utf-8 да и внимательно прочтите ресурс sql если по прежнему крокозяблы могу дать вам свой экземпляр
  10. не батя она за chroot(resources) не как ты выпрыгнешь выше е этой папки
  11. if setElementModel( v.vehicle, data.model ) then не компилированый он
  12. можно попробовать через executeSQLQuery
  13. вот спасибо я грешил на себя а на сервер всё завелось блин я полгода убил всё тему можно зокрыть
  14. я с бинарников обнавляюсь и у меня линукс
  15. [2011-11-23 17:27:19] Starting resources................. [2011-11-23 17:27:20] ERROR: [gamemodes]/mode0/score.lua:46: bad argument #2 to 'format' (string expected, got nil) [2011-11-23 17:27:20] Server started and is ready to accept connections! [2011-11-23 17:27:20] Type 'help' for a list of commands. [2011-11-23 17:27:43] MTA:SA Server v1.1.1-release-3464 46 outputDebugString(string.format("po=%q",spawnx))
  16. в ручную всё работает правда мои друзья координаты перепутали где русская там сват я понял в чём проблема tonumber не возвращает число а почему я хз
  17. после тономеризации при загрузки по вашему примеру возвращает ложь а если так spawnPlayer (sourcec, tonumber( factions[f][4]), tonumber( factions[f][5]),tonumber( factions[f][6])) то все равно спавнюсь на 0
  18. это таблица какие вам ещё данные нужны? У меня есть предположение что он координаты воспринимает как строку когдв я добавил tonumber он начал орать что не может найти y posY="-1607.54"
  19. я уже всю бошку вот код загрузки хмл function loadFactions () if fileExists ( ":mode0/conf/f.xml" ) then local rooti = xmlLoadFile (":mode0/conf/f.xml") local factionroot = xmlFindChild (rooti,"factiones",0) if (factionroot) then for i,v in ipairs (xmlNodeGetChildren(factionroot)) do local name = xmlNodeGetAttribute (v,"name") -- local leader = tonumber(xmlNodeGetAttribute (v,"leader")) local fnum = tonumber(xmlNodeGetAttribute (v,"num")) local spawnx = xmlNodeGetAttribute (v,"posX") local spawny = xmlNodeGetAttribute (v,"posY") local spawnz = xmlNodeGetAttribute (v,"posZ") local rang1 = xmlNodeGetAttribute (v,"rang1") local rang2 = xmlNodeGetAttribute (v,"rang2") local rang3 = xmlNodeGetAttribute (v,"rang3") local rang4 = xmlNodeGetAttribute (v,"rang4") local rang5 = xmlNodeGetAttribute (v,"rang5") local skin1 = tonumber(xmlNodeGetAttribute (v,"skin1")) local skin2 = tonumber(xmlNodeGetAttribute (v,"skin2")) local skin3 = tonumber(xmlNodeGetAttribute (v,"skin3")) local skin4 = tonumber(xmlNodeGetAttribute (v,"skin4")) local skin5 = tonumber(xmlNodeGetAttribute (v,"skin5")) local ftype = tonumber(xmlNodeGetAttribute (v,"type")) local fmoney = tonumber(xmlNodeGetAttribute (v,"money")) local r = tonumber(xmlNodeGetAttribute (v,"r")) local g = tonumber(xmlNodeGetAttribute (v,"g")) local b = tonumber(xmlNodeGetAttribute (v,"b")) if spawnx then --outputDebugString(i.. "x "..spawnz) end factions[i]={name,1,fnum,spawnx,spawny,spawnz,rang1,rang2,rang3,rang4,rang5,skin1,skin2,skin3,skin4,skin5,ftype,fmoney,r,g,b} teams[i]=name team[i]=createTeam(name,r,g,b) --local dx,dy,dz = factions[i][1],factions[i][4], factions[i][5] outputDebugString(name .." "..fnum .." "..spawnx .." "..spawny .." "..spawnz .." "..rang1 .." "..rang2 .." "..rang3 .." "..rang4 .." "..rang5 .." "..skin1 .." "..skin2 .." "..skin3 .." "..skin4 .." "..skin5 .." "..ftype .." "..fmoney .." "..r .." "..g .." "..b) teams[i]=name local f=tonumber(i) -- outputDebugString( tonumber(factions[f][4]) .. "!!!") outputDebugString(tostring(team[i]) .. "load2") end else outputDebugString ("Factions no loaded!") end outputDebugString ("Factions loaded!") else outputDebugString ("404") end end код spawna function spawnf(sourcec,ff,r) local f if (ff) then f=ff --outputDebugString ("200 " ..f.." ") --outputDebugString ("200 " ..f.." ") end local r2 sourcea=getPlayerAccount(sourcec) if sourcea then outputDebugString("acc find") end if (not getAccountData(sourcea,"team")) then local status = setAccountData(sourcea,"team",f) else f=tonumber( getAccountData(sourcea,"team")) outputDebugString ("200 " ..f.." ") end --local f2 =tonumber if not r then r2=7 else r2=7+r end outputChatBox( "gg " ..factions[f][4].."," ..factions[f][5] .."," .." "..factions[f][6].."team" .. getTeamName(team[f]) .."!", sourcec,255,255,255,true) -- spawnPlayer (s, factions[f][4], factions[f][5], factions[f][6], 0, factions[f][7], 0, 0, team[f]) -- spawns player with random skin spawnPlayer (sourcec, factions[f][4], factions[f][5], factions[f][6]) if team[f] then setPlayerTeam ( sourcec,team[f]) outputDebugString ( "gg " ..factions[f][4].."," ..factions[f][5] .."," .." "..factions[f][6].."team" .. getTeamName(team[f]) .."!") end setCameraTarget (source, source) fadeCamera (source, true) setElementData(source,"fnum",f) setElementData(source,"frank",r) end
  20. function spawnf(ff,r) local f if ff then --outputDebugString ("200 " ..f.." ") f=ff end local r2 sourcea=getPlayerAccount(source) if sourcea then outputDebugString("acc find") end if (not getAccountData(sourcea,"team")) then local status = setAccountData(sourcea,"team",f) else f=getAccountData(sourcea,"team") outputDebugString ("200 " ..f.." ") end --local f2 =tonumber if not r then r2=7 else r2=7+r end outputChatBox( "gg " ..factions[f][4].."," ..factions[f][5] .."," .." "..factions[f][6].."team" .. getTeamName(team[f]) .."!", source,255,255,255,true) -- spawnPlayer (s, factions[f][4], factions[f][5], factions[f][6], 0, factions[f][7], 0, 0, team[f]) -- spawns player with random skin spawnPlayer (source, factions[f][4], factions[f][5], factions[f][6]) if team[f] then setPlayerTeam ( source,team[f]) outputDebugString ( "gg " ..factions[f][4].."," ..factions[f][5] .."," .." "..factions[f][6].."team" .. getTeamName(team[f]) .."!") end setCameraTarget (source, source) fadeCamera (source, true) setElementData(source,"fnum",f) setElementData(source,"frank",r) end addEventHandler("onPlayerLogin", root,function(thePreviousAccount, theCurrentAccount) if (not getAccountData(theCurrentAccount,"team")) then --local teams --for i, v in ipairs(factions[i][1]) do --teams[i]=tostring(v) --end triggerClientEvent ( source, "regt", getRootElement(), teams )-- return 0 else spawnf(source,getAccountData(theCurrentAccount,"team")) outputDebugString (tostring( getAccountData(theCurrentAccount,"team"))) end end )
  21. я получаю координаты спавна из хмл координаты верные но я спавнюсь в нулях вот код outputChatBox( "gg " ..factions[f][4].."," ..factions[f][5] .."," .." "..factions[f][6].."team" .. getTeamName(team[f]) .."!", source,255,255,255,true) spawnPlayer (source, factions[f][4], factions[f][5], factions[f][6]) вывод дебага INFO: gg 2227.3000488281,-1180.5, 25.89999961853teamРусская Мафия!
  22. Google Translate --- sorry me that I have created topic help me find the errors I created a matrix a part of code it work factions[i]={name,leader,fnum,spawnx,spawny,spawnz,rang1,rang2,rang3,rang4,rang5,skin1,skin2,skin3,skin4,skin5,ftype,fmoney,r,g,b} team[i]=createTeam(name,r,g,b) outputDebugString(tostring(factions[i][1]) .. "load") end error: [2011-11-01 01:30:26] WARNING: [gamemodes]/mode0/score.lua:270: Bad argument @ 'getAccountData' [Expected account at argument 1, got nil] [2011-11-01 01:30:26] ERROR: [gamemodes]/mode0/score.lua:272: attempt to index field '?' (a nil value) code line 263-283: addEventHandler("onPlayerLogin", root,function() if (not getAccountData(theCurrentAccount,"team")) then local team for i, v in ipairs(factions[i][1]) do team[i]=tostring(v) end triggerClientEvent ( source, "regt", getRootElement(), team )-- return 0 else spawnf(source,getAccountData(theCurrentAccount,"team")) outputDebugString (tostring( getAccountData(theCurrentAccount,"team"))) end end )
×
×
  • Create New...