-
Posts
814 -
Joined
-
Last visited
Everything posted by Wei
-
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
-
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
-
Thanks, it's working now!
-
at the bottom of the script like addPlayerAchievement(getPlayerFromName("Wei."), "Macola debela")
-
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 )
-
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)
-
How do you remove event ?
-
You could set timer to delay removeEventHandler
-
createPickup "onClientPickupHit" "onClientPickupLeave" dxDrawText
-
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
-
-- 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
-
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
-
function drawOnRowClick() row = guiGridListGetSelectedItem() name = guiGridListGetItemText(weapon, row, 1) if (name) then addEventHandler("onClientRender", root, draw1) end end addEventHandler("onClientGUIClick", weapon, drawOnRowClick)
-
Yes it is safe, but players will have to download scripts every time they come to server....
-
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
-
Yes, they are basicaly the same
-
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)
-
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