Jump to content

Wei

Members
  • Posts

    814
  • Joined

  • Last visited

Everything posted by Wei

  1. Wei

    SQLite

    executeSQLQuery("CREATE TABLE Persons(ID int NOT NULL AUTO_INCREMENT,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255),PRIMARY KEY (ID))") Try that that was directly copied from some mysql website, If it doesn't work it's maybe not supported by MTA executeSQLQuery
  2. Wei

    SQLite

    Try dropping table
  3. Wei

    SQLite

    executeSQLQuery("CREATE TABLE IF NOT EXISTS name (id INT NOT NULL AUTO_INCREMENT, other_stuff TEXT)") This should work, you didn't specify the id type
  4. Thanks, it's working now!
  5. at the bottom of the script like addPlayerAchievement(getPlayerFromName("Wei."), "Macola debela")
  6. Wei

    help pls..

    function nightvision() lTeam = getPlayerTeam(localPlayer) if (lTeam and getTeamName(lTeam) == "TEAMNAME") then if (getCameraGoggleEffect() == "normal") then setCameraGoggleEffect("nightvision") elseif (getCameraGoggleEffect() == "nightvision") then setCameraGoggleEffect("normal") end end end addEventHandler("onClientResourceStart", resourceRoot, nightvision )
  7. For some reason event is not added clientside, I checked meta and stuff everything is fine. I am starting to lose my mind with this script ... - server function addPlayerAchievement(player, achievement) if (getElementData(player, "loggedin")) then if (doesAchievementExsist(achievement)) then if (not doesPlayerHaveAchievement(player, achievement)) then triggerClientEvent(player, "Achievements.drawAchievement", player, achievement) end end end end - client function drawAchievement(achievement) outputChatBox(achievement) end addEvent("Achievements.drawAchievement", true) addEventHandler("Achievements.drawAchievement", root, drawAchievement)
  8. Wei

    doubt ..

    You can also complie it with mta complied wich is not possible to decomplie yet!
  9. Wei

    doubt ..

    Yes it prevents cliend sided scripts to save on hard drive
  10. How do you remove event ?
  11. You could set timer to delay removeEventHandler
  12. createPickup "onClientPickupHit" "onClientPickupLeave" dxDrawText
  13. If you make teams with admin panel teams will be removed when you restart server. You must add it to script so when script starts it will make a teams itself
  14. -- add teams here createTeam("Zombies", 255, 255, 255) createTeam("Players", 123, 123, 123) function onPlayerQuitSaveTeam() local sTeam = getPlayerTeam(source) local sAccount = getPlayerAccount(source) if (sTeam and not isGuestAccount(sAccount)) then setAccountData(sAccount, "team", getTeamName(sTeam)) end end addEventHandler("onPlayerQuit", root, onPlayerQuitSaveTeam) function onPlayerLoginSetTeam(_, curAccount) local pTeam = getAccountData(curAccount, "team") if (pTeam) then if (getTeamFromName(pTeam)) then -- ~~ Just to be sure setPlayerTeam(source, getTeamFromName(pTeam)) end end end addEventHandler("onPlayerLogin", root, onPlayerLoginSetTeam) Try that, didn't test it tho
  15. Answer #1: You must create your own saving system to save teams. Search for community/forum, there are plenty of savers... Answer #2: You must modify script to prevent creating teams again. Just remove createTeam function so it wont apear again! Answer #3: Just add createTeam("teamname", red, green, blue) to any serversided script
  16. Wei

    help gui panel

    function drawOnRowClick() row = guiGridListGetSelectedItem() name = guiGridListGetItemText(weapon, row, 1) if (name) then addEventHandler("onClientRender", root, draw1) end end addEventHandler("onClientGUIClick", weapon, drawOnRowClick)
  17. Yes it is safe, but players will have to download scripts every time they come to server....
  18. Wei

    help me

    You can't run videos in MTA... To make a moving ped you must use animations/toggleControl used with setTimer and setCameraMatrix. If you want a story you can make it with dxDrawings, and moving objects like planes with moveObject. Please explain better what you want
  19. Wei

    help

    I didn't know that this function even exsists. Anyways its working like: function onClientChatMessageHandler(text) if text == "login: You successfully logged in" then cancelEvent() end end addEventHandler("onClientChatMessage", getRootElement(), onClientChatMessageHandler)
  20. Wei

    How to:(?

    go to freeroam resource and open vehicles.xml, there you can edit vehicles!
  21. Wei

    help

    You can't unless you make your own login system, so you don't use logIn function
  22. Wei

    Help

    function doTask(thePlayer, cmd, taskId, playername, arg3, arg4) taskId = tonumber(taskId) if taskId then local player = getPlayerFromName(playername or "") if player then if taskId == 1 then local duration = (tonumber(arg3) or 0) * 60 * 1000 setPlayerMuted(player, true) outputChatBox("You have been muted for "..tostring(arg3).." mins.", player) setTimer( function() setPlayerMuted(player, true) outputChatBox("You have been unmuted.", player) end, duration, 1, player ) elseif taskId == 2 then local reason = tostring(arg3) kickPlayer(player, theClient, reason) elseif taskId == 3 then local duration = (tonumber(arg3) or 0) * 60 local reason = tostring(arg4) banPlayer(player, true, true, true, thePlayer, reason, duration) else -- wrong taskId end else --player not found end else --no taskId given end end addCommandHandler("task", doTask) Try this
×
×
  • Create New...