-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
You need to call bone_attach resource like this: function onGivePlayerPizzaBox (player) if (not isElement(player)) then return end if isPedInVehicle (player) then return end local pname = getPlayerName(player) if not (pname == "[sR]PlayAkoya") then outputChatBox("Du bist nicht befugt den Test Command zu nutzen!", player, 200, 0, 0) return end burger = createObject(2880, 0, 0, 0) setElementDimension(burger, getElementDimension (player)) export.bone_attach:attachElementToBone(burger, player, 12, 0, 0, 0, 0, -90, 0) outputChatBox("Debug: PIZZA FIXSIERT!",player, 200, 200, 0) end addCommandHandler("pizza", onGivePlayerPizzaBox)
-
All what you need is: setTimer() getElementsByType() getPlayerIdleTime() setElementAlpha()
-
Try to use sth like this : local db = dbConnect("sqlite", "databaseName.db") -- Put your database here. function getNewID() local result = dbPoll(dbQuery(db, "SELECT ID FROM YourTable ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then -- ID column newID = i break end end if newID then return newID else return #result + 1 end end
-
Don't follow him he already gave you a bad example. you need to replace client with source . the source of this event onPlayerSpawn is the player that just spawned.
-
let him learn from his mistakes. he can find every thing here : playSound
-
wrong Argument you dont need to use player just put it like this local sound = playSound("hit.mp3") setSoundVolume(sound, 0.5)
-
You can find every thing here: https://wiki.multitheftauto.com/wiki/Anti-cheat_guide
-
check my tut here : LUA Strings
-
replace onClientRender with onClientHUDRender. setPlayerHudComponentVisible()
-
you can replace it from your /Multi Theft Auto 1.5/MTA/cgui/images/ folder
-
Code 1: function rewardTimer() local skinId = getElementModel(source) if not skinId == 201 then return end Timer = setTimer ( rewardOnRun, 100, 1,source ) givePlayerMoney (source, 1000 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), rewardTimer ) or function rewardTimer (_,_,_,_,_,skin) if not tonumber(skin) == 201 then return end Timer = setTimer ( rewardOnRun, 100, 1,source ) givePlayerMoney (source, 1000 ) end addEventHandler ( "onPlayerSpawn", getRootElement(),rewardTimer)
-
Remove local here local Timer = setTimer ( rewardOnRun, 100, 1,player )
-
because you are checking the player stats only onClientResourceStart just try to add a commandHandler. Example function functionName() triggerServerEvent ("onGetPlayerRaceStats", localPlayer) end addCommandHandler("stats",functionName Try now and it will update the player stats everytime you use the stats command.
-
You create all of this and you can't fix it lol , leacked resource.
-
You can find every thing here :Wiki page Yes you can do it. try to do it by yourself then post your code here.
-
you need to use guiSetEnabled() -- Example function functionName (vipPlayer) if (vipPlayer) then guiSetEnabled (yourButtonHere, false ) else guiSetEnabled (yourButtonHere, true ) end end
-
check this RESTRICTING ACCESS TO WEB PAGES
-
function FunctionName(playerSource) local playerAccount = getPlayerAccount(playerSource) if playerAccount and not isGuestAccount(playerAccount) then if getAccountData(playerAccount,"vip") then triggerClientEvent(playerSource,"checkVipPlayer",playerSource) end end end addCommandHandler("vip",FunctionName) then do what you want on the client side.
-
replace playerSource with root (triggerClientEvent).
-
it should be like this function testt ( playerSource, commandName ) local text = "You text here" triggerClientEvent (playerSource, "test",playerSource, text) end addCommandHandler ( "test", testt ) only who type the command can see it.
-
try to do it by yourself then post your code here
-
ah sorry i forgot to change the function name to nyanCommand. -- from addCommandHandler ( "fools", foolsCommand ) --To addCommandHandler ( "fools", nyanCommand ) that's all -- Server side function nyanCommand ( playerSource, commandName ) local acc = getPlayerAccount (playerSource) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local theTriggerer = getPlayerName ( playerSource ) if commandName == "nyan" then triggerClientEvent (playerSource, "playMusicEvent", playerSource,"nyan" ) outputChatBox ( theTriggerer .. "#E45800 Is a Nyan Cat !", getRootElement(), 255, 255, 255, true ) elseif commandName == "fools" then triggerClientEvent (playerSource, "playMusicEvent", playerSource,"fools" ) outputChatBox ( theTriggerer .. "#E45800 Is Killing Fools!", getRootElement(), 255, 255, 255, true ) end end end end addCommandHandler ( "nyan", nyanCommand ) addCommandHandler ( "fools", nyanCommand) -- Client side function playMusic (songName) if sound and isElement(sound) then stopSound(sound) end if songName == "nyan" then sound = playSound("Nyan.mp3") elseif soungName == "fools" then sound = playSound("Killingfools.mp3") end setSoundVolume(sound, 1) end addEvent("playMusicEvent", true ) addEventHandler("playMusicEvent", getRootElement(), playMusic )