Patrick2562

Members
  • Content Count

    188
  • Joined

  • Last visited

  • Days Won

    1

Patrick2562 last won the day on April 3

Patrick2562 had the most liked content!

Community Reputation

42 Good

2 Followers

About Patrick2562

  • Rank
    Mark

Details

  • Gang
    SkyTeam

Recent Profile Visitors

1,183 profile views
  1. Patrick2562

    setPedAnimation not working with createPed

    "but for some reason using your 100 works"
  2. Patrick2562

    setPedAnimation not working with createPed

    setTimer(function () setPedAnimation (charPed[1], "ped", "SEAT_idle", -1, true, false, false ) end, 100, 1) and setTimer(setPedAnimation, 100, 1, charPed[1], "ped", "SEAT_idle", -1, true, false, false) are same.
  3. Patrick2562

    setPedAnimation not working with createPed

    I have no idea.
  4. Patrick2562

    setPedAnimation not working with createPed

    setTimer(setPedAnimation, 100, 1, charPed[1],"ped","seat_idle",-1,false) Use a little delay after createPed.
  5. Patrick2562

    Trigger a table from client-side....

    skinsShaders = { { skinTo = "RIP", texture = "jpg2/278", worldname = "Sbmotr2", skinID = 134 }, { skinTo = "RIP", texture = "jpg2/298", worldname = "swmotr5", skinID = 230 }, } function sendDatas() triggerClientEvent("applyTheShaderOnSkin", root, skinsShaders) end setTimer(sendData, 5000, 1) addEvent("applyTheShaderOnSkin", true) function applyTheShaderOnSkin(table) for _, value in ipairs(table) do local skinTo = value.skinTo local textureName = value.worldname local texturePath = value.texture -- use variables end end addEventHandler("applyTheShaderOnSkin", root, applyTheShaderOnSkin)
  6. Patrick2562

    [HELP] How to stop this?

    It's looks good. But the onClientRender is missing. addEventHandler("onClientRender", root, panel)
  7. Patrick2562

    [HELP] How to stop this?

    You want to define the default page? Example: the login page? local pageName = "login" function render() if pageName == "login" then -- draw login page elseif pageName == "register" then -- draw register page elseif pageName == "news" then -- draw news page end end addEventHandler("onClientRender", root, render) function addPanel(clickpanel, state) if clickpanel == "left" and state == "down" then if cursorPosition(x*213, y*64, x*240, y*140) then pageName = "news" elseif cursorPosition(x*213, y*206, x*240, y*140) then pageName = "login" elseif cursorPosition(x*213, y*348, x*240, y*140) then pageName = "register" end end end addEventHandler("onClientClick", getRootElement(), addPanel)
  8. Patrick2562

    How to use multidimensional tables?

    -- SERVER SIDE rules = { [1] = {description = "Trash talking", punishment = "kick"}, [2] = {description = "Lot of trash talking", punishment = "ban"}, } addCommandHandler("punish", function(player, cmd, ruleID, targetPlayerName) local ruleID = tonumber(ruleID) if rules[ruleID] then -- valid rule id local targetPlayerElement = getPlayerFromName(targetPlayerName) if targetPlayerElement then -- target found local description = rules[ruleID].description local punishment = rules[ruleID].punishment local adminName = getPlayerName(player) if punishment == "kick" then kickPlayer(targetPlayerElement) outputChatBox(targetPlayerName.." kicked from server! (Reason: "..description..")", root) elseif punishment == "ban" then banPlayer(targetPlayerElement) outputChatBox(targetPlayerName.." banned from server! (Reason: "..description..")", root) end else outputChatBox("target player not found", player) end else outputChatBox("invalid rule id", player) end end)
  9. Patrick2562

    [HELP] How to stop this?

    Do not quite understand
  10. Patrick2562

    [HELP] How to stop this?

    I said, you call the addEventHandler 2 times. Find where you call it 2th time. But I think a better solution if you use only 1 clientRender. Like this: local pageName = false function render() if pageName == "login" then -- draw login page elseif pageName == "register" then -- draw register page elseif pageName == "news" then -- draw news page end end addEventHandler("onClientRender", root, render) function addPanel(clickpanel, state) if clickpanel == "left" and state == "down" then if cursorPosition(x*213, y*64, x*240, y*140) then pageName = "news" elseif cursorPosition(x*213, y*206, x*240, y*140) then pageName = "login" elseif cursorPosition(x*213, y*348, x*240, y*140) then pageName = "register" end end end addEventHandler("onClientClick", getRootElement(), addPanel)
  11. Patrick2562

    [HELP] How to stop this?

    You called the addEventHandler twice. Example: You open the login page with the news, BUT the news already handled. It's not critical error, only spamming the debug with warning.
  12. Patrick2562

    ID SYSTEM SCRIPT. PTBR/EU

    local ids = {} function assignID()  for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() ids = {} for _, player in ipairs(getElementsByType("player")) do local id = getElementData(player,"id") if id then ids[id] = player end end end addEventHandler("onResourceStart",resourceRoot,startup) function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerID ( player ) return getElementData( player, "id") end function getPlayerFromId ( theID ) if theID then local theID = tonumber(theID) for _,player in ipairs(getElementsByType("player")) do if getElementData(player ,"id") == theID then return player end end return false else return false end end
  13. Patrick2562

    Custom mute system

    muteTimers = {} interval = 20000 function findPlayerBySerial(serial) for _, player in ipairs(getElementsByType("player")) do if getPlayerSerial(player) == serial then return player end end return false end addEvent("mutePlayer", true) addEventHandler("mutePlayer", root, function() local name = getPlayerName(source) local serial = getPlayerSerial(source) outputChatBox(name.." has been muted by console for spamming.", root, 255, 100, 100) setPlayerMuted(source, true) muteTimers[serial] = setTimer(function() local player = findPlayerBySerial(serial) if player then setPlayerMuted(player, false) local name = getPlayerName(player) outputChatBox(name.." has been unmuted by console.", root, 100, 255, 100) end end, interval, 1) end) addEventHandler("onPlayerJoin", root, function() local serial = getPlayerSerial(source) if isTimer(muteTimers[serial]) then local name = getPlayerName(source) outputChatBox(name.." has been muted by console.", root, 255, 100, 100) setPlayerMuted(source, true) end end)
  14. Patrick2562

    [HELP] Glass light problem

    You can only remove it with script. removeWorldModel And you can find the model id and the pos with SA:MP Editor.
  15. Patrick2562

    Syntax Error

    You used a point instead of a comma. "INSERT INTO vehicles (model, x, y, z) VALUES (?,?,?,?)"