Jump to content

Ludo

Members
  • Posts

    66
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Ludo's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. Ludo

    Help..

    function enterWaterfish() local playerSkin = getElementModel(source) if playerSkin == 45 then if isElementInWater(source) then setElementHealth(source, 100) end end end addEventHandler("onPlayerDamage", getRootElement(), enterWaterfish) This should work
  2. Ludo

    [Tables]

    You are welcome Good luck with your gamemode!
  3. Ludo

    [Tables]

    localID = { {1.30,1.22,5,20,"<<<-"}, {2.90,1.22,5,20,"->>>"}, {1.80,1.22,5,20,"Ready!"} } You have to put a "," after a row of a table. Anyway you must use {} to define a table with multiple values, as you can get it with double table pointer: for i, value in ipairs(localID) do guiCreateButton(localID[value][1], localID[value][2], localID[value][3], localID[value][4], localID[value][5], false) -- I copied Mr.Pres[T]ege's post values, but you can edit them end
  4. This function shows the blips of alive players TO alive players and blips of in-training players TO in-training players rotationRotator = 0 addEventHandler("onClientHUDRender", getRootElement(), function() showPlayerHudComponent("radar", false) local px, py, pz = getElementPosition(localPlayer) local pr = getPedRotation(localPlayer) local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawImage(posx,posy,height,height, "img/radar.png") dxDrawImage(posx,posy,height,height, "img/north.png", north) for id, player in ipairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(player) local dimension = getElementDimension(player) if getElementData(player, "state") == getElementData(localPlayer, "state") then if player ~= localPlayer then local _,_,rot = getElementRotation(veh) local ex, ey, ez = getElementPosition(veh) local dist = getDistanceBetweenPoints2D(px,py,ex,ey) if dist > range then dist = tonumber(range) end local angle = 180-north + findRotation(px,py,ex,ey) local cblipx, cblipy = getDistanceRotation(0, 0, height*(dist/range)/2, angle) local blipx = centerleft+cblipx-blipsize/2 local blipy = centertop+cblipy-blipsize/2 local yoff = 0 local r,g,b,a = 255,255,255,255 if getPlayerTeam(player) then r,g,b = getTeamColor( getPlayerTeam(player) ) end local img = "img/blip.png" if (ez - pz) >= 5 then img = "img/blipup.png" elseif (ez - pz) <= -5 then img = "img/blipdown.png" end if tonumber(getElementModel(veh)) == 425 then img = "img/hunter.png" end dxDrawImage(blipx, blipy, blipsize, blipsize, img, north-rot+45, 0, 0, tocolor(r,g,b,a)) if img == "img/hunter.png" then rotationRotator = rotationRotator + 1.25 dxDrawImage(blipx, blipy, blipsize, blipsize, "img/rotor.png", north-rot+45+rotationRotator, 0, 0) end end end local vehicle = getPedOccupiedVehicle(localPlayer) dxDrawImage(centerleft - lpsize/2, centertop - lpsize/2, lpsize,lpsize, "img/local.png", north-pr,0,0,tocolor(255,255,255,255)) end end )
  5. Ludo

    Table .

    Where to you define that "Ped" (in the "if" line)?
  6. has no errors but the beeps(blips) of players who are in training appears to them that are with state alive Of course, because here in line 65 you put: if getElementData(localPlayer, "state") == "alive" or getElementData(localPlayer, "state") == "Training" and veh and dimension and player ~= localPlayer then that creates the blips for both in-training and alive player, so you just have to replace it with: if getElementData(localPlayer, "state") == "alive" and veh and dimension and player ~= localPlayer then
  7. This only cancels /nick But how to cancel changing from settings should I cancel onClientPlayerChangeNick ? Man, changing the nick from "settings" or using /nick command should be the same, as you change your nick and then send it to the server, so you can use onPlayerChangeNick and then cancel the event, you won't have any problem.
  8. Ludo

    arrest ?

    What do you mean with "arreste" (i think you misspelled, you mean "arrest")? Anyway if you mean "stop the player" then you can use setElementVelocity Exactly that's what i'm looking for thanks man . You're welcome
  9. Can you please tell us what does your /debugscript 3 say?
  10. Ludo

    arrest ?

    What do you mean with "arreste" (i think you misspelled, you mean "arrest")? Anyway if you mean "stop the player" then you can use setElementVelocity
  11. That' s because you first set Health and Armor and THEN spawn the player. Opposite thing should be made. Try this, it should work. function playerstats(nick) -- nick is from client where player wrote his login base= mysql_connect("x", "x", "x", "x") getPlayerData= mysql_query(base, "SELECT * FROM players WHERE Nick='".. nick .."'") table= mysql_fetch_assoc(getPlayerData) local player = getPlayerFromName(table.Nick) setPlayerMoney(player, table.Money) local team = getTeamFromName(table.Team) setPlayerTeam (player, team ) spawnPlayer( player, 2930.6001, -2042, 3.5 ) fadeCamera( player, true ) setCameraTarget( player, player) setElementHealth(player, table.Health) setPedArmor(player, table.Armour) mysql_free_result(getPlayerData) end
  12. That's because the source of that event is the root element, so you aren't gonna get the resource that outputs the message.
  13. That won't work, as the wiki says "This event is triggered when a player chats inside the chat box." So it won't work for resources' messages
×
×
  • Create New...