Fist
Members-
Posts
433 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Fist
-
i posted image above already. http://prntscr.com/eiy10n see there are images with corner parts.
-
yes it actually would work, but i want to draw corner images aswell but in your code there are only top-bottom and left-right. How about right-top corner, left-top corner, etc.
-
you can kick them like this addCommandHandler("kickserial",function(source,cmd,serial,reason) for _,v in ipairs(getElementsByType("player") do local playerSerial = getPlayerSerial(v); if (serial == playerSerial) then kickPlayer(v,source,reason); end end end); then just do /kickserial serial reason
-
here is example how images would be http://prntscr.com/eiy10n
-
I can recommend you to use my DayZ Admin panel, it has built-in duty mode which works way better than just setting blood to 999... also you can fly when you're on duty. + some other admin features. https://community.multitheftauto.com/index.php?p=resources&s=details&id=14187
-
yeah but it's only for rectangle, no images whatsoever.
-
anyone? I mean't draw image and then around it would be bordered with images that would connect to each other to no matter what size box is.
-
hello! I barerly know anything about dxDraw that's why im here, So far i have used only ceGui but i want to learn how i can make dxDraw box with image parts that automaticly make box no matter what kind of size from images that are splitted into several images which contains box all together.
-
There is everything fine about your script. There could be something wrong with your gamemode instead but if you want to add ouputchatbox to everyone to see you'll have to do it through server side, you can just trigger server side pre-made function for this specific script that would output chat to everyone. Also i don't understand, why do you use setTimer instead of addEventHandler? function System () if getElementData(getLocalPlayer(),"level") == 2 then setElementData(localPlayer,"Winchester 1866", 1) setElementData(localPlayer,"7Rnd. 1866 Slugs", 14) triggerServerEvent("levelUpAnnouncement",resourceRoot,getElementData(localPlayer,"level")) elseif getElementData(getLocalPlayer(),"level") == 3 then setElementData(localPlayer,"Sawn-Off Shotgun", 1) setElementData(localPlayer,"2Rnd. Slug", 14) triggerServerEvent("levelUpAnnouncement",resourceRoot,getElementData(localPlayer,"level")) end end setTimer(System,100,0) -- THIS IS SERVER SIDE function levelUpAnnouncement(level) outputChatBox("Player "..source.." is level "..tostring(level).." now.",root) end addEvent("levelUpAnnouncement",true) addEventHandler("levelUpAnnouncement",resourceRoot,levelUpAnnouncement)
-
That's actually good idea, thanks gonna try that. yeah ik 'bout that. Playing on that server player was more responsive when doing something and wasn't that crappy if that makes sense.
-
Hey! One day i played on 1 server and i noticed that it had better feel of character movement, like it was faster and more responsible to actions and was way better feeling playing with those animations. Could anyone tell me how i can implement such thing on my own server? Thanks in advance!
-
Scripting forum itself not Tutorial subforum which is under Scripting. In this subforum tutorials are here only ^^
-
should work --THIS CHECKS ALL ZOMBIES EVERY SECOND TO SEE IF THEY ARE IN SIGHT function zombie_check () if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPedDead ( getLocalPlayer () ) == false ) and (getElementModel(getLocalPlayer()) ~= 293) then local zombies = getElementsByType ( "ped",getRootElement(),true ) local id = getElementModel (localPlayer) local Px,Py,Pz = getElementPosition( getLocalPlayer () ) if isPedDucked ( getLocalPlayer ()) then local Pz = Pz-1 end for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then local Zx,Zy,Zz = getElementPosition( theZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then if (getElementData (theZomb, "zombie") == true) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", getLocalPlayer() ) table.insert( myZombies, theZomb ) --ADDS ZOMBIE TO PLAYERS COLLECTION table.remove( zombies, theKey) zombieradiusalert (theZomb) end elseif (getElementData(theZomb,"status") == "chasing") and (getElementData(theZomb,"target") == nil) then --CHECKS IF AN AGGRESSIVE LOST ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "target", getLocalPlayer() ) isthere = "no" for k, ped in pairs( myZombies ) do if ped == theZomb then isthere = "yes" end end if isthere == "no" then table.insert( myZombies, theZomb ) --ADDS THE WAYWARD ZOMBIE TO THE PLAYERS COLLECTION if id = 293 then table.insert( myZombies, id ) end table.remove( zombies, theKey) end end elseif ( getElementData ( theZomb, "target" ) == getLocalPlayer() ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST YOU, MAKES IT REMEMBER YOUR LAST COORDS setElementData ( theZomb, "target", nil ) triggerServerEvent ("onZombieLostPlayer", theZomb, oldPx, oldPy, oldPz) end end end end end end --this second half is for checking peds and zombies local nonzombies = getElementsByType ( "ped",getRootElement(),true ) local id = getElementModel (localPlayer) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then local Zx,Zy,Zz = getElementPosition( theZomb ) for theKey,theNonZomb in ipairs(nonzombies) do if (getElementData (theNonZomb, "zombie") ~= true) and (id ~= 293) then -- if the ped isnt a zombie local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false ) if (isclear == true) and ( getElementHealth ( theNonZomb ) > 0) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", theNonZomb ) zombieradiusalert (theZomb) elseif ( getElementData ( theZomb, "status" ) == "chasing" ) and ( getElementData ( theZomb, "target" ) == nil) then triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", theNonZomb ) end end end if ( getElementData ( theZomb, "target" ) == theNonZomb ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT OF THE PED local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz+1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST THE PED, MAKES IT REMEMBER the peds LAST COORDS triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", nil ) end end end end end end end end end for k, ped in pairs( myZombies ) do if (isElement(ped) == false) then table.remove( myZombies, k) end end oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) end
-
Did you even read comments on code? replace your pedAnim table with this pedAnim = { {"fatwalk","ped","WALK_fatold"} } then do /action fatwalk
-
you have to give a command name for ped {"COMMANDNAME TO CALL ANIMATION","ped","WALK_fatold"), then just do /action "name which u chosed"
-
i tested code, did quite some mistakes. Here is working version -- all server code peds = { {120,-234.089,-1662.847,2.476}, -- here add as many peds as you want in any location as you please. example: {120,-22122,2355,52} } pedAnim = { {"dead","wuzi","cs_dead_guy"}, -- "command to call animation (can be any)","animation blocks name","animation name itself (has to be 100% correct or else it won't work" } function pedArmy() for _,v in ipairs(peds) do local rot,x,y,z = unpack(v); createPed(rot, x, y, z) -- this will make peds from table. end end addCommandHandler("spawnpeds",pedArmy) -- this will spawn all peds from table with /spawnpeds function doAnim(source,cmd,anim) if (anim) then for _,v in ipairs(pedAnim) do local animName,animBlock,actualAnimName = unpack(v); if (tostring(anim) == animName) then for _,p in ipairs(getElementsByType("ped")) do setPedAnimation(p,animBlock,actualAnimName) end end end end end addCommandHandler("action",doAnim) -- to call any animation from table do /action (animation name which you named in pedAnim table)
-
spawn as many peds as u want and create command handler /action which will select all those selected peds and put any animation u want to. to spawn ped with this code do /actio (anim name) you'll have to add your own animations into table and peds itself in ped table. I'm not sure or it works, but should. Haven't tested. But if it doesn't just quote me i'll fix it. -- all server code peds = { {name,rot,x,y,z}, -- here add as many peds as you want in any location as you please. example: {ped1,120,-22122,2355,52} } pedAnim = { {"dead","cs_dead_guy"}, -- "command to call animation (can be any)","animation name itself (has to be 100% correct or else it won't work" } function pedArmy() for _,v in ipairs(peds) do local name,rot,x,y,z = unpack(v); name = createPed(rot, x, y, z) -- this will make peds from table. end end addCommandHandler("spawnpeds",pedArmy) -- this will spawn all peds from table with /spawnpeds function doAnim(source,command) if (command) then for _,v in ipairs(pedAnim) do local animName,actualAnimName = unpack(v); if (command == animName) then for _,p in ipairs(peds) do local pName = unpack(p); setPedAnimation(pName,"ped",actualAnimName) end end end end end addCommandHandler("action",doAnim) -- to call any animation from table do /action (animation name which you named in pedAnim table)
-
thank you guys, works perfectly.
-
yeah, but is it possible to cancel kick on player joins if he's banned? If so then it's not that complicated.
-
But if i do that in that way, how i can pass table to client side? I'm doingi t like this -- passing to client triggerClientEvent(source,"updatePlayerInvites",source,invitations) -- then this is how i get it on client side guiGridListClear(inviteListGridlist) for _,v in ipairs(invitations) do local player,team = v; -- here im not sure how to receive those data if (player == localPlayer) then local row = guiGridListAddRow(inviteListGridlist) guiGridListSetItemText(inviteListGridlist, row, 1, team, false, false ) end end
-
Hello guys ! I want to know how i can remove specific data from such table as this -- table invitations = {} -- this is how i instert data into it later i just pass whole table and get specific information by unack(invitations) then i get "player" and "team" data table.insert(invitations,{player,team}) -- but i need somehow remove/delete that "team" data which is packed like code above, is there any way to do it?
-
Found exact topic which is like your's with some code (maybe it has all code in it not sure) check it maybe it works
-
Just when player joins game do cancelEvent() then set his camera location wherever you want and add that information on screen. edit: actually nvm, you will have to make completly custom ban system seprate from MTA's built-in.
-
Handy tool for DayZ servers, very easy to use and neatlooking DayZ Admin Panel. It's completly open sourcefeel free to edit it to your likings but please do notremove original author (me) also credit goes to Supermanaddon creator Ryden, without him this handy tool wouldnot be so cool. Default open bind is OOnce you go in Duty Mod you are invincible and you can fly.==-- To doInventory inspectorSuperAdmin featuresBan List (also unbaning)Report systemSpectate (maybe?)==-- FeaturesDuty Mode, Kick, Ban, Mute, Freeze, Warp,Warp Player To, Set Stats, Change Weather, Kill Player,Spawn Items, Spawn Vehicles, Send Global Message,Fix Car, Destroy Car, Blow Car, See Stats about player. If you find any bug report here or pm me, i'll fix it as soon as possible. Download Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14187