-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
if you are using freeroam resource the command isn't sv it's cv
-
make it with two outputChatBox function connect() outputChatBox("Hello, i am your assistant. You can ask me questions and i will perform tasks.", source, 0, 255, 0) outputChatBox("You can even ask for a car, or weapon. You can also talk to me! Go ahead, have fun!", source, 0, 255, 0) end addEventHandler("onPlayerJoin", getRootElement(), connect)
-
function sendMessage2( messageclean, messageType) if (string.find(messageclean, "i") and string.find(messageclean, "love") and string.find(messageclean, "bot")) then outputChatBox("i love you too!", source, 191, 62, 255) end end addEventHandler("onPlayerChat",root,sendMessage2) function sendMessage2( messageclean, messageType) if (string.find(messageclean, "i") and string.find(messageclean, "hate") and string.find(messageclean, "bot")) then outputChatBox("Ill note that", source, 191, 62, 255) end end addEventHandler("onPlayerChat",root,sendMessage2) function sendMessage2( messageclean, messageType) if (string.find(messageclean, "hi") and string.find(messageclean, "bot")) then outputChatBox("Hello", source, 191, 62, 255) end end addEventHandler("onPlayerChat",root,sendMessage2) function sendMessage2( messageclean, messageType) if (string.find(messageclean, "how") and string.find(messageclean, "are") and string.find(messageclean, "bot")) then outputChatBox("I'm doing great", source, 191, 62, 255) end end addEventHandler("onPlayerChat",root,sendMessage2) function sendMessage2( messageclean, messageType) if (string.find(messageclean, "i") and string.find(messageclean, "a") and string.find(messageclean, "infernus")) then executeCommandHandler("sv", source, "infernus") end end addEventHandler("onPlayerChat",root,sendMessage2)
-
this because you're using createVehicle from client side , if you using them server side you will be able to enter the vehicle.
-
how you are calling the function check ?
-
it's 'aclGetGroup' not 'ACLGetGroup' function check() local acc = getPlayerAccount(source) local accName = getAccountName(acc) if isObjectInACLGroup("user."..acc, aclGetGroup("admin")) then atype = "admin" pname = getPlayerName(source) triggerClientEvent(source, "infosend", source, accName, atype, pname) end end
-
show all code in the file also did you download the last scoreboard from the link?
-
put it on the line '705' in file 'dxscoreboard_client.lua' and to be sure get the last scoreboard resource from here http://mtasa-resources.googlecode.com/f ... s-r825.zip exports.scoreboard:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home",":admin/client/images/flags/"..flag..".png") else setElementData(source,"Home","N/A") end end addEventHandler("onPlayerJoin",root,showcountry)
-
Stolen: https://community.multitheftauto.com/index.php?p= ... ls&id=3533 Original: https://community.multitheftauto.com/index.php?p= ... ils&id=492
-
-- Set vehicle color. function setVehiclesColor (thePlayer, cmd, color1, color2, color3, color4) if (hasObjectPermissionTo (thePlayer , "function.banPlayer", true)) then if (color1 and color2 and color3 and color4) then playerVeh = getPedOccupiedVehicle (thePlayer) if (playerVeh) then setVehicleColor (playerVeh, color1, color2, color3, color4) else outputConsole ( "You must be in a vehicle to use this function.", thePlayer, 255, 0, 0) end end end end addCommandHandler ( "setvehcolor", setVehiclesColor ) addEventHandler("onVehicleExplode", getRootElement(), respawnVeh)
-
No, because the functions: getAccountName getPlayerAccount isObjectInACLGroup aclGetGroup is server-side, and the event 'onClientPlayerDamage' is Client-side
-
no it's not work, the event can't be canceled. https://wiki.multitheftauto.com/wiki/OnPlayerDamage It should also be noted that canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.
-
does it work good if you rejoin to the server? lol
-
i don't even find a nitro with id 2010 https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades it's should be 1010 not 2010 addEventHandler("onPlayerJoin",root, function () bindKey(source,"mouse1","down",nitro) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"mouse1","down",nitro) end end) function nitro ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then local id = 1010 local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " dodane.", thePlayer ) else outputConsole ( "Nieudana próba dodania nitro.", thePlayer ) end else outputConsole ( "Musisz być w pojeździe !", thePlayer ) end end addCommandHandler ( "nitro", nitro )
-
addEventHandler("onResourceStart", resourceRoot, function() setTimer(expcalculate, 20000, 0) end) function expcalculate() for i, player in ipairs(getElementByType("players")) do setElementData(player, "EXP",tonumber(getElementData(player, "EXP"))+1) end end
-
client-side function expcalculate () setElementData(localPlayer, "EXP",tonumber(getElementData(localPlayer, "EXP"))+1) end setTimer(expcalculate, 20000,0)
-
function pAccess (thePlayer) if (police[getElementModel(source)]) and getTeamName(getPlayerTeam(thePlayer)) == "Cop" then cancelEvent() outputChatBox("you are not a Police officer", thePlayer) end end addEventHandler("onVehicleStartEnter",root,pAccess)
-
post your code here and we will see what is wrong and help you to fix it
-
really? MAKE IT BY YOUR SELF https://wiki.multitheftauto.com/wiki/CreatePed https://wiki.multitheftauto.com/wiki/GiveWeapon https://wiki.multitheftauto.com/wiki/SetPedAnimation
-
show the function warpMe and this is Server-Side addCommandHandler("lockwarp", function(player) setElementData(player,"IsWarpLocked",true) end) addCommandHandler("unlockwarp", function(player) setElementData(player,"IsWarpLocked",false) end) if you want it client side addCommandHandler("lockwarp", function() setElementData(localPlayer,"IsWarpLocked",true) end) addCommandHandler("unlockwarp", function() setElementData(localPlayer,"IsWarpLocked",false) end) and don't put this code in any other resources, only in file 'fr_server' and line '250' if getElementData(targetPlayer,"IsWarpLocked") then outputChatBox("Not allowed Warp to this player, he is locked warp.") return end
-
function createMissionPed() createPed ( 50 ,2467.9096679688, -1647.623046875, 13.469927787781, 184.5916595459 ) end addEventHandler ( "onClientResourceStart", resourceRoot, createMissionPed ) infoMission1 = guiCreateWindow(239,172,364,326,"Mission 1",false) guiSetVisible ( infoMission1, false ) label1 = guiCreateLabel(13,24,339,18,"Hello , i have a problem. Can you help me?",false,infoMission1) guiLabelSetColor(label1,255,034,022) label2 = guiCreateLabel(10,67,147,36,"The Mission :",false,infoMission1) guiSetFont(label2,"sa-header") label3 = guiCreateLabel(73,112,283,26,"|OBJECTIVE| : Kill a person",false,infoMission1) guiSetFont(label3,"clear-normal") label4 = guiCreateLabel(73,139,272,22,"|REWARD| : 3000$ in CASH",false,infoMission1) buttonAccept = guiCreateButton(14,209,116,39,"I accept the job.",false,infoMission1) buttonReject = guiCreateButton(185,210,120,40,"I reject the job.",false,infoMission1) function guiSetVisibleTrue () guiSetVisible ( infoMission1 , true ) end addEvent( "showMission1", true ) addEventHandler( "showMission1", root, guiSetVisibleTrue ) function guiSetVisibleFalse () guiSetVisible ( infoMission1 , false ) end addEvent( "unshowMission1", true ) addEventHandler( "unshowMission1", root, guiSetVisibleFalse )
-
I'M Not IN YOUR HEAD put this if getElementData(targetPlayer,"IsWarpLocked") then outputChatBox("Not allowed Warp to this player, he is locked warp.") return end in file 'fr_server' line '250' it will be function warpMe(targetPlayer) if getElementData(targetPlayer,"IsWarpLocked") then outputChatBox("Not allowed Warp to this player, he is locked warp.",source) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox('No free seats left in ' .. getPlayerName(targetPlayer) .. '\'s vehicle.', source, 255, 0, 0) end local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end
-
Creating a script which reloads a resource at a certain time
TAPL replied to Thomas_Matthew's topic in Scripting
restartResource startResource stopResource [url=https://wiki.multitheftauto.com/wiki/OnResourceStart]https://wiki.multitheftauto.com/wiki/OnResourceStart[/url] [url=https://wiki.multitheftauto.com/wiki/OnResourceStop]https://wiki.multitheftauto.com/wiki/OnResourceStop[/url]