ID:141775
 
Code:
mob
MouseEntered()
for(var/mob/m)
if(m.Village=="Leaf")
flick('mouse.dmi',client.mouse_pointer_icon) //show another icon
flick("leaf",client.mouse_pointer_icon)//show leaf state
if(m.Village=="Mist")
flick('mouse.dmi',client.mouse_pointer_icon) //show another icon
flick("mist",client.mouse_pointer_icon)//show mist state
if(m.Village=="Sand")
flick('mouse.dmi',client.mouse_pointer_icon) //show another icon
flick("sand",client.mouse_pointer_icon)//show sand state


Problem description:

ok i know the code above may not even be close to what i have in mind but its all i could come up with.
Trying to make it so it tells the usr what village the person he is looking at is in

mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")
usr.mouse_pointer_icon=/obj/pointer/leaf
if(src.Village=="Mist")
usr.mouse_pointer_icon=/obj/pointer/mist
if(src.Village=="Sand")
usr.mouse_pointer_icon=/obj/pointer/sand
MouseExited()//when you dont hover it anymore
usr.mouse_pointer_icon=null
obj
pointer
icon='mouse.dmi'
leaf
icon_state="leaf"
sand
icon_state="sand"
mist
icon_state="mist"


Hope i helped =)
In response to Danny Kenobi
ok erm it compiles but the cursor doesnt change when its on someone.

Code:

mob
var
mouse_pointer_icon='mouse.dmi'

mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")
usr.mouse_pointer_icon=/obj/pointer/leaf
if(src.Village=="Mist")
usr.mouse_pointer_icon=/obj/pointer/mist
if(src.Village=="Sand")
usr.mouse_pointer_icon=/obj/pointer/sand
MouseExited()//when you dont hover it anymore
usr.mouse_pointer_icon=null
obj
pointer
icon='mouse.dmi'
leaf
icon_state="leaf"
sand
icon_state="sand"
mist
icon_state="mist"

In response to Rapmaster
mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")
usr.client.mouse_pointer_icon=/obj/pointer/leaf
if(src.Village=="Mist")
usr.client.mouse_pointer_icon=/obj/pointer/mist
if(src.Village=="Sand")
usr.client.mouse_pointer_icon=/obj/pointer/sand
MouseExited()//when you dont hover it anymore
usr.client.mouse_pointer_icon=null
obj
pointer
icon='mouse.dmi'
leaf
icon_state="leaf"
sand
icon_state="sand"
mist
icon_state="mist"


Forgot mouse_pointer_icon is a client variable and not a mob one, my bad.
In response to Danny Kenobi
ok i changed the code. It works but it doesnt change icon to the leaf,sand and mist ones it only shows the /obj/pointer icon.


Code:

client
mouse_pointer_icon=/obj/pointer

mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")
usr.client.mouse_pointer_icon=/obj/pointer/leaf
if(src.Village=="Mist")
usr.client.mouse_pointer_icon=/obj/pointer/mist
if(src.Village=="Sand")
usr.client.mouse_pointer_icon=/obj/pointer/sand
MouseExited()//when you dont hover it anymore
usr.client.mouse_pointer_icon=null
obj
pointer
icon='mouse.dmi'
leaf
icon_state="leaf"
sand
icon_state="sand"
mist
icon_state="mist"
In response to Rapmaster
Huh, what the heck do you mean?
In response to Danny Kenobi
when i hover over players it doesnt change the icon for the mouse. it uses the same one everytime.

client
mouse_pointer_icon=/obj/pointer

mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")//it doesnt check what village
usr.client.mouse_pointer_icon=/obj/pointer/leaf
if(src.Village=="Mist")
usr.client.mouse_pointer_icon=/obj/pointer/mist
if(src.Village=="Sand")
usr.client.mouse_pointer_icon=/obj/pointer/sand
MouseExited()//when you dont hover it anymore
usr.client.mouse_pointer_icon=null//this works
obj
pointer
icon='mouse.dmi'//when you hover a player it only shows this
leaf
icon_state="leaf"//doesnt show this icon
sand
icon_state="sand"//""
mist
icon_state="mist"//""
In response to Rapmaster
Well, then put all the mouse sprites in different files, 'sandM.dmi' - 'mistM.dmi' - 'leafM.dmi' and put no icon state under them just leave them empyt and use this code:

mob
MouseEntered()
/* src is the guy beging hover
and usr is the one who hovers someon else
*/

if(src.Village=="Leaf")
usr.client.mouse_pointer_icon='leafM.dmi'
if(src.Village=="Mist")
usr.client.mouse_pointer_icon='mistM.dmi'
if(src.Village=="Sand")
usr.client.mouse_pointer_icon='sandM.dmi'
MouseExited()//when you dont hover it anymore
usr.client.mouse_pointer_icon=null
In response to Danny Kenobi
it worked thanks alot you want creds :)