Jump to content

manve1

Retired Staff
  • Posts

    1,283
  • Joined

  • Last visited

Everything posted by manve1

  1. I first have to use guiGridListSetItemText and then guiGridListSetItemData so i got no way of making it? as if i set the text on gridlist first it comes up on all rows with only 1 number, and i want for different row, different number.
  2. like for the first row, i would want gd1 number in it, for second row i want gd2 number in it ... ect.
  3. How could i re-make my script that it gives out a specific number per a certain row? (( Everything is made and works, i just can't figure out how to make a specific number per row )) numberBK = 1 numberGC = 2 local sd1 = setElementData( gridGinklai, 'BK', numberBK ) local sd2 = setElementData( gridGinklai, 'GC', numberGC ) local gd1 = getElementData( gridGinklai, 'BK' ) local gd2 = getElementData( gridGinklai, 'GC' ) for g,i in ipairs( ginklai ) do rowGinklai = guiGridListAddRow( gridGinklai ) guiGridListSetItemText( gridGinklai, rowGinklai, 2, i, false, false ) guiGridListSetItemText( gridGinklai, rowGinklai, 3, gd1, false, true ) guiGridListSetItemText( gridGinklai, rowGinklai, 3, gd2, false, true ) end P.S.I'm using element data as i want to change some numbers in it during the game, and when server restarts i know element data resets to default.
  4. freeroam resource is in "MTA San Andreas 1.3\server\mods\deathmatch\resources\[gameplay]\freeroam" folder
  5. you can divide/subtract the timer time that it takes for 1 person to take the turf, but multiply/add the time when someone from other team goes in the turf. but you can get elements within the colshape and then if its equal you can simply stop the ticking of the timer
  6. yes, everything is fine? as in my code "player" returns player element and "team" returns the team with a name of "Off Duty" whereas in Max+ code "team" returns players team with a name of "Off Duty", but the player doesn't have a group that occupied him with a name of "Off Duty". Do you get what i mean?
  7. addEvent('endshift', true) addEventHandler('endshift', root, function ( player ) if (not getPlayerTeam(getTeamFromName('Off Duty')) then setAccountData ( getPlayerAccount ( player ), "offduty", true ) local team = getTeamFromName('Off Duty') setPlayerTeam(player, team) local r, g, b = getTeamColor ( team ) setPlayerNametagColor ( player, r, g, b ) end end )
  8. did you trigger it?
  9. you only had to replace 1 line, but here it's how it should be in full script: ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names = {"Guest Team","Ultra Pro Skills Staff","|High Class|","NFS Team"} local tags = {"%%","%~UpS%~","%|HC%|","%[NFS%]"} local colors = {"#e6e6e6","#ff6600","#32ffcc","#cc0000"} local acls = {"none","none","none","none"} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",getRootElement(),loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",getRootElement(),moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",getRootElement(),nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",getRootElement(),join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",getRootElement(),quit) ------------------------------------ ---------Login--------------------- function login() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogin",getRootElement(),login) ------------------------------------ ---------Logout--------------------- function logout() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogout",getRootElement(),logout) ------------------------------------ ----------blip-------------- function blip(player) local team = getPlayerTeam(player) if team then for v,blip in pairs(getAttachedElements(player)) do if getElementType(blip)=="blip" then local r,g,b =getTeamColor(team) setBlipColor(blip,r,g,b,255) setVehicleColor ( blip,r,g,b) end end end end function timer() setTimer(blip,3000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa ) If it doesn't work, it might be the problem of "Guest Team", just delete it and the try again.
  10. that because you didn't read file called "readme.txt". The problem is in here: local tags ={"","~UpS~","|HC|","[NFS]"} as you forgot to read the file, you don't know that in the clan tags you should have % in this case it should look like this: local tags ={"%%","%~UpS%~","%|HC%|","%[NFS%]"} NOTE: Im not sure about the "Guest Team" tag, as it might not work and you can easily make your own script for guest teams. (( This script is in the community ))
  11. thats because your using "value" argument which in "for" function gets every single player
  12. I tested CaptainZ. code and i found few errors on it, so i fixed it and it works perfectly sx,sy = guiGetScreenSize() textsToDraw = {} maxrange = 20 addEventHandler("onClientRender",root, function() for a,b in pairs(textsToDraw) do x,y,z = b[1],b[2],b[3] scx,scy = getScreenFromWorldPosition (x,y,z) camX,camY,camZ = getCameraMatrix() if scx and scy and getDistanceBetweenPoints3D(camX,camY,camZ,x,y,z+5) <= maxrange then dxDrawFramedText(b[4],scx-0.5*dxGetTextWidth(b[4],0.30,"pricedown"),scy+30-0.5*dxGetFontHeight(0.30,"pricedown"),sx, sy+5,tocolor ( b[5], b[6], b[7], 255 ), 0.80,"pricedown") end end end ) function add3DText(x,y,z,text,r,g,b) table.insert(textsToDraw,{x,y,z,text,r,g,b}) end function dxDrawFramedText ( message , left , top , width , height , color , scale , font , alignX , alignY , clip , wordBreak , postGUI , frameColor ) color = color or tocolor ( 255 , 255 , 255 , 255 ) frameColor = frameColor or tocolor ( 0 , 0 , 0 , 255 ) scale = scale or 1 alignX = alignX or "left" alignY = alignY or "top" clip = clip or false wordBreak = wordBreak or false postGUI = postGUI or false dxDrawText ( message , left , top , width , height , color , scale , font , alignX , alignY , clip , wordBreak , postGUI ) end add3DText( 1177.9,-1328.4,15.3, "Test", 6, 183, 248 )
  13. Robbster, another way you can make it is with saving data or getting destroyed all of them by model.
  14. won't work when the person is in a marker, as he won't have any vehicle occupied
  15. addEvent ( "spawnDodo", true) addEventHandler ("spawnDodo", root, function () if (dodo) then destroyElement( dodo ) end local dodo = createVehicle ( 593, 1580.09619, 1358.62195, 16, 0, 0,180 ) warpPedIntoVehicle( source, dodo ) outputChatBox ("#00CD66You will now take your first flight! Go to the blip marked on your map to pickup your first passenger.", source,24,116,205, true) fixVehicle ( dodo ) outputChatBox ("#EE9A00Please make your way to the terminal to pick the passnegers.", source,24,116,205, true) --destroyElement ( getRootElement() ) end )
  16. addEvent ( "spawnDodo", true) addEventHandler ("spawnDodo", root, function () local dodo = createVehicle ( 593, 1690.14868, 1453.82971, 10.76650, 0, 0, 0 ) warpPedIntoVehicle( source, dodo ) outputChatBox ("#FF0000You will now take your first flight! Go to the blip marked on your map to pickup your first passenger.", getRootElement(), 255, 0, 0, true ) end )
  17. addEventHandler ("onResourceStart", getResourceRootElement(), function () huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90) huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) --local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) end ) for i = 0,65534 do setElementDimension (huette1, i) setElementDimension (huette2, i) setElementDimension (huette3, i) setElementDimension (huette4, i) end
  18. I personally use notepad++ because you can get a plugin for MTA in it so you can see where you done some mistakes on function names.
  19. I am, and i ain't making scripts for people who don't try, i can help with errors in scripts, but not make full scripts.
  20. That's just rude by telling a person to use his scripting knowledge and his personal time for making scripts for free which I'm sure he is not going to do it. Learn scripting yourself or go on MTA community and you might have luck. Good Luck.
  21. manve1

    Stupid Timer

    isTimer gets a specific timer, example of how to get rid of a timer: time = 30 timer = setTimer( function() time = time - 1 outputChatBox( time, root, 255, 255, 255 ) if ( time == 0 ) then killTimer( timer ) end end, 1000, 0 ) You're welcome after all.
  22. manve1

    Stupid Timer

    you can use killTimer to get rid of a timer, and the code i gave you after massive amounts of people walk in the col shape, it will create that many timers, so it might create lag.
  23. manve1

    Stupid Timer

    function triggerBlow( thePlayer, matchingDimension ) setTimer( function( ) if thePlayer then if isElementWithinColShape ( thePlayer, dragarr ) then triggerClientEvent ( root ,"killIntruder", thePlayer ) end end end, 1000, 0 ) end addEventHandler ( "onColShapeHit", root, triggerBlow ) try this.
×
×
  • Create New...