Ramboo Posted October 7, 2011 Posted October 7, 2011 Hey yo guys. I ve got a problem. my blips change and get attached to player, when script restarts, or player log in or out. BUT it doesn't work when map restarts. Code : function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler ( "onMapStarting", root, loadMap )
codeluaeveryday Posted October 7, 2011 Posted October 7, 2011 addEventHandler ( "onMapStarting", root, loadMap ) [/lua] Um, thats for RACE, and needs to be added by adding addEvent('onMapStarting') function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler('onMapStarting') addEventHandler ( "onMapStarting", root, loadMap ) Not tested, but this will only work on race, and i recommend you use onResourceStart as the event. eg.. function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler ( "onResourceStart", root, loadMap ) Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
HunT Posted October 7, 2011 Posted October 7, 2011 Call The Function loadMap With setTimer and event "onPlayerSpawn" @Huntone_
Ramboo Posted October 7, 2011 Author Posted October 7, 2011 Call The Function loadMap With setTimer and event "onPlayerSpawn" Give me the example pls. im new in scriptint csmit195, thx, ill try to use resources
HunT Posted October 7, 2011 Posted October 7, 2011 Call The Function loadMap With setTimer and event "onPlayerSpawn" Give me the example pls. im new in scriptint csmit195, thx, ill try to use resources Sorry but now job . . Later i give u the code no problem. (reply with iphone) @Huntone_
Ramboo Posted October 7, 2011 Author Posted October 7, 2011 Call The Function loadMap With setTimer and event "onPlayerSpawn" Give me the example pls. im new in scriptint csmit195, thx, ill try to use resources Sorry but now job . . Later i give u the code no problem. (reply with iphone) Ty. waitin:P
HunT Posted October 7, 2011 Posted October 7, 2011 function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end function blips() setTimer(loadMap,500,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),blips) Anyway i use this for admin Blip function setAdminBlip(player) local theAccount=getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 3, 255, 100, 0, 255, 0, 99999 ) end end end function spawnAdmin() setTimer(setAdminBlip,500,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),spawnAdmin) Server Side @Huntone_
Castillo Posted October 7, 2011 Posted October 7, 2011 addEventHandler ( "onMapStarting", root, loadMap ) [/lua] Um, thats for RACE, and needs to be added by adding addEvent('onMapStarting') function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler('onMapStarting') addEventHandler ( "onMapStarting", root, loadMap ) You put addEventHandler not addEvent("onMapStarting",true), that won't work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Ignition Posted October 7, 2011 Posted October 7, 2011 addEventHandler ( "onMapStarting", root, loadMap ) [/lua] Um, thats for RACE, and needs to be added by adding addEvent('onMapStarting') function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler('onMapStarting') addEventHandler ( "onMapStarting", root, loadMap ) You put addEventHandler not addEvent("onMapStarting",true), that won't work. Extactly. LOL At This. Lmfao.
JR10 Posted October 7, 2011 Posted October 7, 2011 Extactly. What's the point of that post? Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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