itHyperoX
Members-
Posts
522 -
Joined
-
Last visited
-
Days Won
1
Everything posted by itHyperoX
-
Now when i change my skin, i get "You cant use that skin!" on all skin..
-
Hello guys, i need a little help. I started to make a "Skin Protect" script. Here is the script. Debug Error: Bad argument @ 'getElementType' [Expected element at argument 1 got number '0'] What is the problem? addEventHandler("onElementModelChange",root,function(source) if (getElementType(source) == "player") then if getElementModel(source) == 0 or 40 or 50 then setElementModel(source,303) outputChatBox("You cant use that skin!",source) end end end)
-
Please someone?
-
function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#00FF00 Is now onduty NO DM !",root,255,255,255,true) setElementData(thePlayer,"dutyON",1) end end addCommandHandler("duty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#FF0000 Is now offduty",root,255,255,255,true) setElementData(thePlayer,"dutyON",0) end end addCommandHandler("offduty", bloodback) -- Client side! addEventHandler("onClientPlayerDamage", getRootElement(), function() if getElementData(localPlayer, "dutyON") == 1 then cancelEvent() end end )
-
Hello. I made a very simple createVehicle command, i need help with, how can i add to this "blocked" vehicles ? I dont know what should i do, i have to add table with vehicle id-s and with names? Or how can i block some vehicle which is can not be spawned? local vehicleSlotID = 0 addCommandHandler("makeveh",function(source,cmd,...) if not (...) then return outputChatBox("/"..cmd.." [ID/ VehicleName]",source) end local playerX, playerY, playerZ = getElementPosition(source) local vehicleName = table.concat({...}, "") local vehicleID = getVehicleModelFromName(vehicleName) local createdVehicle = createVehicle(vehicleID or vehicleName,playerX,playerY,playerZ) vehicleSlotID = vehicleSlotID+1 warpPedIntoVehicle(source, createdVehicle) end)
-
up
-
@Domingos MTA look https://community.multitheftauto.com/index.php?p=resources&s=details&id=12699 You can make like this
-
you can use shader 100%. Dont ask me how
-
Hello guys. I want to keep the old style map, i dont want to change that, i just need to know that, how can i replace the little map? I know there is so many png files because that not 1 peace. So now looks like this: I want to change that "png pieces" to this: The question is, how can i "cut" this image to little pieces for the little map?
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=10588 Tested, work
-
local X, Y, Z = 355.87365722656, 151.42892456055, 1025.7890625 local createdPickup = createPickup(X,Y,Z,3,0) setElementInterior(createdPickup,3) setElementDimension(createdPickup,1)
-
you just need add the *texture name* and the *ID* you dont need to wrtite .txd and .dff. Just: function loadMod (filename,id) if id and filename then if fileExists(filename..".txd") then txd = engineLoadTXD( filename..".txd" ) engineImportTXD( txd, id ) end if fileExists(filename..".dff") then dff = engineLoadDFF( filename..".dff", 0 ) engineReplaceModel( dff, id ) end if fileExists(filename..".col") then col = engineLoadCOL( filename..".col" ) engineReplaceCOL( col, id ) end end end addEventHandler("onClientResourceStart", resourceRoot, function() loadMod("files/vehicles/HotringRacer",494) loadMod("files/vehicles/infernus",411) loadMod("files/vehicles/jester",559) end)
-
Again you dude.. Thank you.
-
If you want you can use mine. function loadMod (filename,id) if id and filename then if fileExists(filename..".txd") then txd = engineLoadTXD( filename..".txd" ) engineImportTXD( txd, id ) end if fileExists(filename..".dff") then dff = engineLoadDFF( filename..".dff", 0 ) engineReplaceModel( dff, id ) end if fileExists(filename..".col") then col = engineLoadCOL( filename..".col" ) engineReplaceCOL( col, id ) end end end addEventHandler("onClientResourceStart", resourceRoot, function() loadMod("files/vehicles/HotringRacer",494) loadMod("YourFolder/FilesWhereisYourTXD/DFF",the ID) end)
-
Can you please help me with that? As i said, i'm new and keep learning, but no leaking..
-
The problem is, when i die, and reconnecting, on the server console i see so many debug errors (Pictures first comment). I'm 100% sure, the problem is the script not checking the player is on the server because of the timer!. So, i think i have to use cancelEvent if the player disconnect. So, how can i make that? I never saw these errors before.
-
But i just making a script, not opening server, is that hard to help ? Please dont comment here
-
I'm saving player datas. The problem is, when player reconnect while dead. I want to make that, when player login, and health 0, spawning the player instant Now i added this to the saving system if isPedDead(source) or (getElementHealth(source)) < 1 then setElementHealth(source,100) setAccountData(account,"acc.health",100) end Also, i added "if isElement(source) then .... so, how can i make that possible, if player disconnecting while dead, the system cancelEvent the setTimer addEventHandler("onPlayerWasted",root,function() if isElement(source) then exports["rc_core"]:takeMoney(source,5000) skin = getElementModel(source) or 0 setTimer(respawn,3000, 1, source) setTimer(setElementModel,3000,1,source,skin) end end) --< Respawn >-- function respawn(source) if isElement(source) then x, y, z = 2270.298828125, 1399.2269287109, 42.8203125 repeat until spawnPlayer(source,x+1, y+1,z, 0, math.random(1,1) ) setCameraTarget(source, player) fadeCamera(source, true) setElementRotation(source, 0, 0, -90) end end
-
Thank you. Why should i wipe that? Also, bad argument @ "setElementModel" [expected element at argument 1 ,got nil] Also2// Deleted the repeat until, but if i reconnect when im dead i'm getting a 100 hp.
-
Hello guys. I made a script, very simple onPlayerWasted respawn the player. When i'm disconnecting while im dead, and trying to logIn, the server just froze ("NETWORK TROUBLE"). And i get these debug messages: the screen is just black, and after a few seconds the player respawning. Whats the problem? Here is the code: addEventHandler("onPlayerJoin",root,function() spawn(source) end) --< Spawn >-- function spawn(source) x, y, z = 2028.4606933594, 1342.2176513672, 10.8203125 repeat until spawnPlayer(source,x+1,y+1,z, 0,303) setCameraTarget(source, player) fadeCamera(source, true) setElementRotation(source, 0, 0, -90) end addEventHandler("onPlayerWasted",root,function() exports["rc_core"]:takeMoney(source,5000) skin = getElementModel(source) or 0 setTimer(respawn, 5000, 1, source) setTimer(setElementModel,5000,1,source,skin) end) --< Respawn >-- function respawn(source) x, y, z = 2270.298828125, 1399.2269287109, 42.8203125 repeat until spawnPlayer(source,x+1, y+1,z, 0, math.random(1,1) ) setCameraTarget(source, player) fadeCamera(source, true) setElementRotation(source, 0, 0, -90) end
-
if you using setElementModel on client side, other players not seeing your new elementModel