-
Posts
605 -
Joined
-
Last visited
-
Days Won
1
Everything posted by JeViCo
-
addEventHandler('onPlayerLogin', root, function () local rot = 90 -- spawn rotation local skinID = 170 -- skin id spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) local acc = getPlayerAccount(source) if not getAccountData(acc,"player:register") then -- set money if player joined the server for first time setPlayerMoney(source, 800) setAccountData(acc,"player:register",true) end fadeCamera(source, true) setCameraTarget(source, source) end) @xXGhostXx
-
EncodeString/DecodeString *updated functions i tried to protect it using raw data + temporary file but if i delete it, html won't work. Saving files on own website unsafe too
-
If player joins the server for first time and get 5000$, you should look for givePlayerMoney or setPlayerMoney functions in your other resources because default value is 0 default skin is 0 (CJ) so that's normal Also you can make this shorter. Replace this spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) setPlayerSkin(source, 170) with this local rot = 90 -- spawn rotation local skinID = 170 spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) I also added +math.random(-1,1). It prevents players being stuck (when 2+ players spawn at the same time)
-
oops, my fault i have some difficulties with it. I guess i'm totally wrong here local sortfnc = [[ local arg = {...} local a = arg[1] local b = arg[2] local column = dgsElementData[self].sortColumn local texta,textb = a[column][1],b[column][1] local texta,textb = tonumber(string.gsub(texta,"%#","")),tonumber(string.gsub(textb,"%#","")) return texta < textb ]]
-
ok then. Replace 'onPlayerJoin' with 'onPlayerLogin'. I thought players spawn when they join the server and respawn again after they login
-
@xXGhostXx remove this part of code and it'll solve your problem addEventHandler('onPlayerJoin', root, function () spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) fadeCamera(source, true) setCameraTarget(source, source) end) this functions should be in your login-panel resource
-
Also this code f = addEventHandler("OnDgsGridListSelect",getRootElement(),chooseStickGrid) print(f) always returns false and of course chooseStickGrid function doesn't work. I tried to put gridlist variable instead of getRootElement() but got same result and FINALLY gridlist sort "#"..number items like this and i can't understand how to fix it
-
you're probably using default 'play' gamemode. It always spawns player when he/she joins the server. You should remove it and spawn players after you login in your login-panel resource. Don't forget about onClientPlayerWasted event to respawn player and return camera @xXGhostXx
-
Try to use onClientElementStreamIn event to replace animation and onClientElementStreamOut event to restore it (better than detect each player joining/leaving the server) @Lalalu
-
thanks to @samr46. I didn't know that i can use string pixels, manage it and convert to image back using dxConvertPixels
-
that's not stealing. This shader still can be found as example on wiki page @MonSteRDM, you should create a shader for this car with dxCreateShader function, apply it on any vehicle texture (your overlay. Mostly "remap" or "vehiclegrunge128") to replace it in future using engineApplyShaderToWorldTexture function. Then you should use dxSetShaderValue to add a texture and that's it. Also you need setElementData, engineRemoveShaderFromWorldTexture functions and onClientElementStreamIn, onClientElementStreamOut to synchronize it with other players
-
@thisdp Hello again) Could you help me? function scr(new, old) if source == dgsGridListGetScrollBar(gridlist)[1] then dgsGridListSetScrollPosition(gridlist,old) end end addEventHandler("onDgsScrollBarScrollPositionChange",root,scr) i tried to make something like cancelEvent() but dgs resource gives an error: "C stack overflow"
-
Hello :3 How about setObjectComponentPosition/setObjectComponentRotation or setObjectComponentVisible functions? All of this will allow to add animations for objects. For example you you have a house object right? You will able to interact with doors, windows, doorknobs, furniture like closet etc. I described only house stuff but i know that it has much more possibilities
-
Hello everyone! How about expanding raw data abilities? For example you can use raw data in dxCreateShader, dxCreateTexture to read files and make them more secure?
-
not really. I made a camera angle looking towards the ped. This camera is not moving at all - just staying still (static in general). I want to make this: when i press and hold right mouse button ped will rotate. If i move a mouse right, ped'll rotate clockwise, left - counterclockwise. Also i want to make a limit - player can be rotated until it reach: original_rotation + 30 degrees OR original_rotation - 30 degrees Sorry if you can't understand something cuz i'm not english-speaking really @Jayceon
-
function respawnPlayer() fadeCamera(source, true) setTimer( function(pl) setCameraTarget(pl,pl) spawnPlayer(pl,1286.17578125, -1329.16015625, 13.55211353302,0 , getPedSkin(pl), 0, 0) fadeCamera(pl, false) end, 3000, 1, source) end addEventHandler("onPlayerWasted", getRootElement(), wasted) setTimer 3-rd argument must be a number (times to execute), setTimer additional arguments missing (player element) -> player is not defined in timer setTimer( respawnPlayer, 3000, source ) this won't work ( 1-st remark ). If you write it correct it will execute function each 3 seconds infinite times @xXGhostXx
-
#optimized guests = {} addEventHandler("onPlayerJoin", root, function() local newName = "Guest#"..math.random(9999) if not guests[newName] then setPlayerName(source, newName) guests[newName] = true end end ) addEventHandler("onPlayerLogin", root, function(_,account) guests[getPlayerName(source)] = nil local accountName = getAccountName(account) setPlayerName(source, tostring(accountName)) end ) addEventHandler("onPlayerChangeNick", root, function() cancelEvent() end ) @xXGhostXx
-
@SSKE try to use this: addEventHandler("onClientPlayerWeaponFire",getRootElement(),function(weap) if source == localPlayer -- you can remove it if you want if weap == 25 then -- check if the weapon was shotgun -- your stuff end end end) and use set/getElementData to count shots
-
@IStarkI every time you switch the any weapon, model will be replaced again and again + message in chat will appear too removed elementData function podmiankibronki (_, slot) local bronka = getPlayerWeapon ( localPlayer ) if slot == 5 and getPedWeapon(localPlayer) == 31 then -- 5 - rifle slot, 31 - m4 id (you said your weapon id is 356 and this is an M4 engineImportTXD ( txd, 356 ) engineReplaceModel ( dff, 356 ) --outputChatBox ( "wczytano ak47" ) end end addEventHandler( "onClientPlayerWeaponSwitch", localPlayer, podmiankibronki ) Are you trying to make several models per weapon or what?