ViRuZGamiing Posted January 1, 2014 Share Posted January 1, 2014 Hello, I'm using Customblips and Playerblips but I want to change the player's blip to a customblip. Playerblips: root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end function onPlayerSpawn ( spawnpoint ) if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end function setBlipsColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } for id, player in ipairs( getElementsByType ( "player" ) ) do destroyBlipsAttachedTo ( player ) if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end function setBlipColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then destroyBlipsAttachedTo ( source ) players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) end end addCommandHandler ( "setblipscolor", setBlipsColor ) addCommandHandler ( "setblipcolor", setBlipColor ) addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) 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 Customblip exports.customblips:createCustomBlip ( x, y,32, "images/player.png", 50 ) How can I get it in? Link to comment
Moderators IIYAMA Posted January 1, 2014 Moderators Share Posted January 1, 2014 As far as I know. local blip = exports.customblips:createCustomBlip ( x, y,32, "images/player.png", 50 ) Link to comment
ViRuZGamiing Posted January 1, 2014 Author Share Posted January 1, 2014 This is from the basic script: createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) Does that become this: local blip = exports.customblips:createCustomBlip ( x, y,32, "images/player.png", 50 ) attachElements ( blip, players[source][1], players[source][2], players[source][3] ) and what with the x,y of the createcustomblip? Link to comment
TAPL Posted January 1, 2014 Share Posted January 1, 2014 https://forum.multitheftauto.com/viewtopic.php?f=91&t=66593 Link to comment
ViRuZGamiing Posted January 1, 2014 Author Share Posted January 1, 2014 Thx and also thx to Wassim. Link to comment
WASSIm. Posted January 1, 2014 Share Posted January 1, 2014 Thx and also thx to Wassim. You're Welcome Link to comment
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