• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to use local player? [JASS]

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
Alright guys, im making a system currently, but what i want to know is how do i get a local player to be able to play a sound for him and only him. i remember long time ago someone used an
JASS:
if local player p ==
or something like that, so help me out please, +rep ofcourse.
 
Level 16
Joined
Jun 25, 2008
Messages
1,043
JASS:
if (GetLocalPlayer()) == GetOwningPlayer(GetTriggerUnit()) then
that's one example, the GetOwningPlayer stuff can be changed, of course.


then do your stuff, end with
JASS:
endif

as far as i know.
This can also be used in GUI custom scripts

example:
  • Custom script: if (GetLocalPlayer()) == GetOwningPlayer(GetTriggerUnit()) then
  • Environment - Set fog to style Linear, z-start 500.00, z-end 2000.00, density 0.10 and color (0.00%, 20.00%, 0.00%)
  • Custom script: endif
 
Level 10
Joined
Sep 21, 2007
Messages
517
hey man can u tell me whats wrong with this line, cus i think it sohuld work fine but does compile error:
  • Custom script: if (GetLocalPlayer()) == LoadPlayerHandleBJ(0, GetHandleIdBJ(GetExpiredTimer())) then
thanks a bunch, i owe you, so please do ask me about any thing you need to do in GUI and il tell you how, owe you that much atleast xD <not used to using JASS alot but says invalid number of arguements even though i wrote it correctly x.x>
 
Level 10
Joined
Sep 21, 2007
Messages
517
unbelievable compilter roflmao, it says "Invalid number of arguements"
this is what i put:
  • Custom script: if GetLocalPlayer() == LoadPlayerHandleBJ(0, GetHandleIdBJ(GetExpiredTimer()))
+rep tho, urs seems more optimized t.t
Edit~~ Im thinking of setting the player in a local variable and then comparing it, ima try
Nvm i didnt put then.... lol... still didnt work o.o
ok it seems the compiler doesnt register the
JASS:
LoadPlayerHandleBJ(0, GetHandleIdBJ(GetExpiredTimer()))
Maybe its from normal WE? (btw i think u added an extra bracket, i removed it but then compiler says "Expected ' ") as with the extra bracket it says "Invalid number of arguements".
 
Last edited:
Level 10
Joined
Sep 21, 2007
Messages
517
hahahaha ofc im using gui man :p trust me im not a nabcake xD
EDIT~~ FIXED THE PROBLEM, TO MEKC, THERE WAS PARAMATER VALUE MISSING, YOU GAVE WRONG PARAMETERS THATS WHY ITS OPTIMIZED XDDDDDDDD
Thanks for help guys, couldnt have done the local without u!
 
Last edited:
Status
Not open for further replies.
Top