-
Posts
4,144 -
Joined
-
Last visited
-
Days Won
1
Everything posted by dzek (varez)
-
--remove this line addEventHandler("onClientResourceStart",getResourceRootElement(),GUIEditor_Window[1]) --add this line on the last line of your script addEventHandler("onClientResourceStart",getResourceRootElement(),CreateRulesWindow) --next: --add this line as the last line of CreateRulesWindow function openLoginWindow() not tested, but should work if everything else is correct (i not looked through all the script) next time put your code in [lua ] [/lua ] tags, not the greets
-
why not mysql - not my server, mysql server not installed there, and remote mysql-ing is too slow. if i do SELECT * FROM foo ORDER BY Score DESC LIMIT bar i will get a score, some settings assigned to player, etc, but not the rank.. the "position" on the result.. now i can do something like that to get "rank": local playerNameThatImLookingFor = "dzek" local sQuery = "SELECT * FROM scores ORDER BY score DESC" local players = executeSQLQuery(sQuery) local rowExist = #players if (rowExist~=nil and rowExist~=0) then local ii=0 for key,val in ipairs(players) do ii=ii+1 if playerNameThatImLookingFor == val.nick then local playerRank = ii outputChatBox(playerRank) end end end but doing that with 1000 or more rows could be killing for the server. with my MySQL way it will be something like: local sQuery = "SET @rank=0; SELECT rank FROM ( SELECT @rank:=@rank+1 AS rank FROM scores ORDER BY score DESC) AS tmptable WHERE nick = 'dzek'" local players = executeSQLQuery(sQuery) local rowExist = #players if (rowExist~=nil and rowExist~=0) then for key,val in ipairs(players) do local playerRank = val.rank outputChatBox(playerRank) end end its better to do get one row with one column, than getting 1000+ rows, then looping through the result for every player to get their rank..
-
How I can do something like GameTextForPlayer on SA:MP in M?
dzek (varez) replied to CTCCoco's topic in Scripting
tell us how that works in SAMP -
its a mess.. bad eventhandler ( handler looks like table, not function ) at line 88 and that handler is inside a function, so it will never run.. that all i can spot by looking at your code for 3 seconds
-
well, nope.. i need to get a "rank" of player.. i could do something like that, then loop through the result, adding to temp variable +1, until i found that record, and get a "rank", but i think this will need more resources (mean RAM etc), than creating a nice query like the one i wrote above.. im php programmer and working with MySQL everyday.. so i know what i want.. but i cannot use MySQL (i cannot install that module - nevermind why), and SQLite seems to be a .. lite version of MySQL. and it looks like i cannot set temporary variables (like my "rank") in SQLite, or i dont know how
-
im talking about developement, not about the playing like that
-
chat apperance can be changed in settings menu in mta
-
hi, im looking to optimal, and the fastest way to get a player rank from table that contains nick and score. in mysql theres no problem, but sqlite dont allowing me use SET (and i cant use mysql) my code for mysql: SET @rank=0; SELECT rank FROM ( SELECT @rank:=@rank+1 AS rank FROM scores ORDER BY score DESC ) AS tmptable WHERE nick = 'player' ''any help?
-
watch out for pressing ESC key - it can stop clicking to work. when reinstalling - totally delete mta folder, then install the newer available version (1.0.3)
-
if you scripting - run mta in window, not fullscreen its faster, better, and no bugs like that
-
i like the new editor more than the old one
-
wow, 1st topic about offering not looking for
-
sounds to me like a place where he want a lot of teleport-markers WallMart, i will make a simple script for teleport markers soon (today at evening? or tommorow) and put it in community, especially for you
-
hmm, pressing everything at once gives the best results in games like Virtua Fighter, or Street Fighter
-
do you know google, or search function on forum? MUCH FASTER than registering and creating a topic.. solution is here for example: https://forum.multitheftauto.com/viewtop ... 04&t=26533
-
overlaying checkpoints shouldnt be a problem
-
DarkDragon, how its protected? it MUST be possible in some way (and probably not too hard) - everything is crackable. remember times when steam was created?
-
addEvent ("RodytiLanga", true) on serverside isnt needed and clientside probably hangs on 28 line becouse of adding event handler to unexisting button (MygtUzdaryti dont exist at time of firing up the script). so the rest not working on client: you should create window, hide it, and just showing when somebody hits the marker, now, if this will be corrected, it will be creating more and more windows, staying in client RAM when somebody hit marker more than once.. ingame open console (f8) and type "debugscript 3" .. it will help you ps. and you can create a marker client-side too ps2. nad it is good idea to make english name of variables and functions (im not talking about the gui messages)
-
you cannot do a one-click convert. community.multitheftauto.com - search and download and about your .map file - its a half-life .bsd probably, right?
-
i think it will be faster to search on wiki.multitheftauto.com instead of waiting for somebody to search it there for you.. so if gui is done: addEvent addEventHandler triggerServerEvent setPedSkin getPedSkin and if you want to be able to clothe CJ skin: getBodyPartName getClothesByTypeIndex getClothesTypeName getTypeIndexFromClothes addPedClothes getPedClothes removePedClothes
-
well, the biggest problem of open source is that anybody can modify it. i had the guy who disabled data file checking on client side in 1.0.3 (as i wrote a script that was dont allowing some players to connect until upgrade to 1.0.3, becouse they dont want to remove their handling mods) and changed his serial etc..
-
it has nothing to do with httpdownloadurl, i m not using this, and have the same problem (at least it happen once per day, so i dont care)
-
theres no "InMarker" event (until you create one) Server and Client Events: https://wiki.multitheftauto.com/wiki/Server_Scripting_Events https://wiki.multitheftauto.com/wiki/Client_Scripting_Events You should use onMarkerHit if this is server side and onClientMarkerHit if this is client side (your scripts looks like server side, so you will need to use onMarkerHit)
-
50p, dont forget that you must exit the game after the show and quiz to register via their site to play
-
remove mta, then install, dont overwrite. it happend to me too when i removed a lot of resources that i didnt need.
