Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
Example: client only function arrestPlayer(criminal, cop) attachElements(criminal, cop) setElementFrozen(criminal, true) setElementCollidableWith(criminal, cop, false) setElementCollidableWith(cop, criminal, false) end
-
Instead of following cop, you can attach the elements and make them collidable by using setElementCollidableWith.
-
rot = 50 addEventHandler("onClientRender", root, function() if rot > 360 then state = 1 else state = 2 end if state ==1 then rot = rot-5 else rot = rot+5 end end ) dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) Not realy sure but shud worok
-
Oh I got it what you were trying to mean by telling it fake.
-
1. getPlayerMoney is synced from server side as far as I know so don't talk. 2. If he has then sure. 3. I support you, #ZA7F is writing something bullshit. It will spam because you are using onClientRender event! When a new map starts you can stop the script by using table methods. client: lp = getPlayerMoney(localPlayer) addEventHandler("onClientMapStopping", resourceRoot, function() setPlayerMoney(localPlayer, lp) end )
-
Sir DevO, Do you know even what you posted? It will give a error @ Dentos There's a typo and local functions mistake. color = { 0, 255, 0 } resourceRoot = getResourceRootElement ( getThisResource () ) players = { } function onResourceStart ( ) for i, plr in ipairs(getElementsByType("player")) do local team = getPlayerTeam ( plr ) if team then local r, g, b = getPlayerNametagColor(plr) -- here is one typo fix players [ plr ] = createBlipAttachedTo ( plr, 0, 2, r, g, b, 255 ) end end end function onPlayerSpawn ( ) local team = getPlayerTeam ( source ) local r, g, b = getPlayerNametagColor( source ) if team then players [ source ] = createBlipAttachedTo ( source, 0, 2, r, g, b, 255 ) end end addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) function destroyBlips ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", root, destroyBlips ) addEventHandler ( "onPlayerWasted", root, destroyBlips ) function destroyBlipsAttachedTo ( player ) local attached = getAttachedElements ( player ) if ( attached ) then for _, element in ipairs ( attached ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end end
-
pizzas = 8 refmarker = createMarker ( -1805, 944, 23.9, "cylinder", 1.5, 255, 25, 0, 170 ) refblip = createBlipAttachedTo(refmarker, 29) pizzasLeft = guiCreateLabel (0.82, 0.5, 5, 3.5, "Pizzas: "..pcount.."/8", true) function pay() if ( source == marker ) then pizzas = pizzas - 1 givePlayerMoney(5000) guiSetText(pizzasLeft, "Pizzas: " ..tostring(pizzas).."/8") destroyElement(marker) destroyElement(blip) destroyElement(pizzabox) outputChatBox("Get in a Pizza Boy to get a new mission", 255, 204, 0) end end addEventHandler ( "onClientMarkerHit", getRootElement(), pay ) function refill() if ( source == refmarker ) then if ( not pizzas == 8 ) then pizzas = 8 local pcount = tostring(pizzas) guiSetText(pizzasLeft, "Pizzas: " ..pcount.."/8") destroyElement(refmarker) destroyElement(refblip) end end end addEventHandler ( "onClientMarkerHit", getRootElement(), refill )
-
I'll tell you what to do. I don't want to post code and make a mistake. Do you see the if statment? Add a = after player. It should be if player == team instead of if player = team!
-
-------------------------------------------------------------------- --* Command vh respawn system *------------------------------------- --* main_s.lua *---------------------------------------------------- --* Made by kimmis *------------------------------------------------ --* Do not remove this box *--------------------------------- -------------------------------------------------------------------- function respawn() local accountname = getAccountName (getPlayerAccount(source or client)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Owner" ) ) then outputChatBox("***Respawning ALL Empty Vehicles In 10 Secs, get to your car to keep it***") local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end end end function doRespawn() for k,v in ipairs(getElementsByType("player")) do respawn(v) end end setTimer(doRespawn, 10000, 1) addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn ) function ByeBye() setTimer(destroyElement, 5000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), ByeBye) function checkEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
What nounsense are you talking? getPlayerMoney is not fake.
-
function respawn() local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end end setTimer(respawn, 10000, 1) addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn ) function ByeBye() setTimer(destroyElement, 5000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), ByeBye) function checkEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end, 10000, 1) addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn ) function ByeBye() setTimer(destroyElement, 5000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), ByeBye) function checkEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
30$ is enough. Don't you see it looks so awesome? You are commenting just like that I bet. It looks so awesome when you zoom out and rotate.
-
I just put spaces? OH woah. You can't even fix a simple error. You don't even know how simple is it to fix the error. THE ERROR TELLS THAT ONE END IS MISSING SO I ADDED IT BY INDENTING THE CODE SO IT IS CLEAN.
-
function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(player) amount = tonumber(amount) if targetplayer then if string.find(tostring(amount), "-", true) then return outputChatBox("Sorry, you are not allowed to send negative money!", player ) end if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You Were Given #00FF00$"..tostring(amount).." #006400 From #FF0000"..getPlayerName(player) , targetplayer, 0, 100, 0, true) outputChatBox("You Gave #00FF00$"..tostring(amount).."#006400 To #FF0000"..getPlayerName(targetplayer), player, 0, 100, 0, true) else outputChatBox("You Don't Have Enough Money !" , player, 255, 0, 0) end end end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
-
function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(player) amount = tonumber(amount) if targetplayer then if string.find(tostring(amount), "-", true) then return outputChatBox("Sorry, you are not allowed to send negative money!", player ) end if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You Were Given #00FF00$"..tostring(amount).." #006400 From #FF0000"..getPlayerName(player) , targetplayer, 0, 100, 0, true) outputChatBox("You Gave #00FF00$"..tostring(amount).."#006400 To #FF0000"..getPlayerName(targetplayer), player, 0, 100, 0, true) else outputChatBox("You Don't Have Enough Money !" , player, 255, 0, 0) end end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
-
function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(player) amount = tonumber(amount) if targetplayer then if string.find(tostring(amount), "-", true) then return outputChatBox("Sorry, you are not allowed to send negative money!", player ) end if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You Were Given #00FF00$"..tostring(amount).." #006400 From #FF0000"..getPlayerName(player) , targetplayer, 0, 100, 0, true) outputChatBox("You Gave #00FF00$"..tostring(amount).."#006400 To #FF0000"..getPlayerName(targetplayer), player, 0, 100, 0, true) else outputChatBox("You Don't Have Enough Money !" , player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
-
--------------------------- -- Fighting style window --------------------------- wndFighting = { 'wnd', text = 'Set Fighting style', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='fighting', width=230, height=290, columns={ {text='style', attr='name'} }, rows={xml='fighting.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyFightingStyle }, {'btn', id='Set', onclick=applyFightingStyle}, {'btn', id='Close', closeswindow=true} } } local numbers = { 4, 5, 6, 7, 15, 16 } addCommandHandler('setstyle', function(s, cmd, style) style = style or tonumber(style) outputed = false for k,v in ipairs(numbers) do if style =~ nil and style =~ false and style == v and not outputed then setPedFightingStyle(s, style) else outputed = true return outputChatBox("Invalid fighting style ID or not entered. Valid fighting id's: 4, 5, 6, 7, 15, 16!", s) end end end )
-
Code removed by Anubhav as this problem is solved.
-
A: ME will dance me will troll Q: What would you do if me will dance me will troll? No tell nothing here.
-
playerBlibs = {} function updateGPS () local gangname = getElementData(getLocalPlayer(),"gang") for i, blip in ipairs(playerBlibs) do destroyElement(blip) end if getElementData(getLocalPlayer(),"gang") == "None" then return end playerBlibs = {} for i, player in ipairs(getElementsByType("player")) do if gangname == getElementData(player,"gang") then playerBlibs[player] = createBlipAttachedTo(player,0,2,22,255,22) setBlipVisibleDistance(playerBlibs[player],1000) end end end setTimer(updateGPS,10000,0)