Ma5ter Posted June 29, 2014 Posted June 29, 2014 Was trying to make a script that hides my blip but it doesnt hide my blip, nor did it output any chat in the chatbox. root = getRootElement () players = { } resourceRoot = getResourceRootElement ( getThisResource () ) addCommandHandler ( hideme, function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then destroyBlipsAttachedTo ( source ) outputChatBox ( "You are hidden.", source, 255, 255, 255, true ) end end end true, true) function destroyBlipsAttachedTo(player) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end
Memory Posted June 29, 2014 Posted June 29, 2014 Where found you this code? addCommandHandler ( hideme, function ( ) for id, player in ipairs( getElementsByType ( "player" ) ) do local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then destroyBlipsAttachedTo ( player ) outputChatBox ( "You are hidden.", player, 255, 255, 255, true ) end end end) function destroyBlipsAttachedTo( player ) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end or only for you: addCommandHandler ( hideme, function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then destroyBlipsAttachedTo ( thePlayer ) outputChatBox ( "You are hidden.", thePlayer, 255, 255, 255, true ) end end) function destroyBlipsAttachedTo( player ) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end Ingame name: [sV]Kostya Name in scripts: Kostya
Ma5ter Posted June 30, 2014 Author Posted June 30, 2014 Code didnt work, here's the warning, also yeah I got the code from the playerblips resource since i'm still new to this. WARNING: [gameplay]\bliphider\playerblips.lua:2: Bad arguement @ "addCommandHandler" [Expected String at argument 1, got nil]
Max+ Posted June 30, 2014 Posted June 30, 2014 it should be string , addCommandHandler( 'hide' , - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
_DrXenon Posted June 30, 2014 Posted June 30, 2014 The first parameter of addCommandHandler is thePlayer who typed it. So resource para is the player. ( parameters name doesnt matter) ●●● Rage Gaming Society Coming Soon ●●●
Ma5ter Posted July 3, 2014 Author Posted July 3, 2014 The script isnt hiding my blip, I did change the parameter to a string and players can still see my blip.
Grafu Posted July 3, 2014 Posted July 3, 2014 addCommandHandler("hidemyblip", function(player) local account = getPlayerAccount(player) if not isGuestAccount(account) and isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Admin")) then for index, element in ipairs(getAttachedElements(player)) do if getElementType(element) == "blip" then destroyElement(element) end end outputChatBox("You are now invisible on the radar", player) end end) • Grafuroam on Facebook • Grafuroam on Youtube • Support us •
Grafu Posted July 3, 2014 Posted July 3, 2014 The script still isnt hiding my blip. Cover the blip with your finger then and you won't see it. >.> Here is an useful link for you, might help: https://wiki.multitheftauto.com/wiki/Sc ... troduction • Grafuroam on Facebook • Grafuroam on Youtube • Support us •
Max+ Posted July 3, 2014 Posted July 3, 2014 Try This , addCommandHandler ( "blip", function ( thePlayer ) for index, element in ipairs ( getAttachedElements ( thePlayer ) ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now