KiffShark Posted November 12, 2012 Share Posted November 12, 2012 (edited) Well... Hi everybody! I need some help to do this script, I want a key (n) for set on/off invisivility (alpha 255->20; 20->255) only if you're in team "PSG" This is what I have done, but it isn't works, I know how set it on/off with different commands or binds (but i want the same bindkey to "on" and "off") function invisible() for i, player in ipairs(getElementsByType("player")) do genTeam=getPlayerTeam(player) if getTeamName(genTeam)=="PSG" then if (getElementAlpha(player) == 255) then setElementAlpha(getLocalPlayer(), 20) outputChatBox ( "*Activado*", player, 255, 0, 0) else setElementAlpha(getLocalPlayer(), 255) outputChatBox ( "*Desactivado*", player, 255, 0, 0) end else end end end addCommandHandler ( "invi", invisible ) bindKey ("n", "down", "invi") I've tried it in 10000 ways before... -.- some help please? (I'm noob scripting so...) thank! sorry for my english Edited November 20, 2012 by Guest Link to comment
Charlie_Jefferson Posted November 12, 2012 Share Posted November 12, 2012 Uhhm? Maybe because after "down" in the bindkey, it must be the function's name, which is invisible? Why am I saying maybe... Well anyway, that's why it isn't working. Link to comment
HunT Posted November 12, 2012 Share Posted November 12, 2012 https://wiki.multitheftauto.com/wiki/BindKey bindKey ("n", "down", invisible) Link to comment
KiffShark Posted November 12, 2012 Author Share Posted November 12, 2012 thanks!! Solved! I have got a question... if the script is type="client" people can see other people in invisibility mode? only i will be invisible in my screen? or for all players? Link to comment
./BlackBird# Posted November 12, 2012 Share Posted November 12, 2012 thanks!! Solved!I have got a question... if the script is type="client" people can see other people in invisibility mode? only i will be invisible in my screen? or for all players? i think you only will be invisible in your screen Link to comment
myonlake Posted November 12, 2012 Share Posted November 12, 2012 As MFNONFIK said, it will only be seen by the client. Use server-side to sync for all clients. For example use a server event trigger. Link to comment
KiffShark Posted November 12, 2012 Author Share Posted November 12, 2012 thaaanks! I had this question since a lot of time I'm so grateful thank you all! 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