Jump to content

Ayush Rathore

Members
  • Posts

    156
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Ayush Rathore

  1. you want to make player non collidable or an area
  2. local timer = {} function setWantedLevel(player) local wantedLevel = getElementData(player,"wantedLevel") if wantedLevel == 10 then setElementData(player,"wantedLevel",10,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level is "..wantedLevel..".",localPlayer) else setElementData(player,"wantedLevel",wantedLevel+1,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level increased to "..(wantedLevel+1)..".",localPlayer) if getElementData(player,"wantedLevel") == 3 then triggerServerEvent("setCriminalJob",player,player) end end if timer[player] == false then timer[player] = setTimer(function() local wantedLevel = getElementData(player,"wantedLevel") if wantedLevel == 0 then killTimer(timer[player]) timer[player] = false else setElementData(player,"wantedLevel",wantedLevel-1,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level decreased to "..(wantedLevel-1)..".",player) end end,5000,0) else killTimer(timer[player]) timer[player] = false setWantedLevel(player) end end function load() timer[source] = false end addEventHandler("onPlayerJoin", getRootElement(), load) Try This
  3. local timer = {} function setWantedLevel(player) local wantedLevel = getElementData(player,"wantedLevel") if wantedLevel == 10 then setElementData(player,"wantedLevel",10,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level is "..wantedLevel..".",localPlayer) else setElementData(player,"wantedLevel",wantedLevel+1,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level increased to "..(wantedLevel+1)..".",localPlayer) if getElementData(player,"wantedLevel") == 3 then triggerServerEvent("setCriminalJob",player,player) end end if timer[player] == false then timer[player] = setTimer(function() local wantedLevel = getElementData(player,"wantedLevel") if wantedLevel == 0 then killTimer(timer[player]) timer[player] = false else setElementData(player,"wantedLevel",wantedLevel-1,true) exports.SASCnotifications:drawNotification("#FF0000[Wanted Level System]#FFFFFF Wanted level decreased to "..(wantedLevel-1)..".",player) end end,5000,0) end end function load() timer[source] = false end addEventHandler("onPlayerJoin", getRootElement(), load) Try this when you will run this it will decrease wanted level by 1 every 5 sec till it reaches 0 and will not make it infinite
  4. function loadAccounts() if source then local serial = getPlayerSerial(source) local result = dbQuery(database, "SELECT * FROM accounts WHERE serial = ?", serial) if result then local row = dbPoll(result,-1) setElementPosition(source, row.x, row.y, row.z) setElementInterior(source, row.intterior) setElementDimension(source, row.demension) setElementModel(source, row.skin) setElementHealth(source, row.health) setPedArmor(source, row.armor) setPlayerWantedLevel(source, row.wanted) setPlayerTeam(source, row.team) if #row > 0 then setPlayerMoney(source, poll[1]["money"]) end end end end addEventHandler("onPlayerJoin", getRootElement(), loadAccounts) try this it will work error is : you haven't read function returning values and calling same function two times Read this : https://wiki.multitheftauto.com/wiki/DbPoll
×
×
  • Create New...