trying to send variables to other player?

Posted by zabujard
hello! basically im trying to send a variable so that the other player receives it. for example

you die and then tell the other player that he has gained a kill!

can any of you help with this?

i have been trying everything i can think of...

global.livess -=1;


gms_statistic_set("global.livess", gms_statistic_get("global.livess") - 1);

var strings;

strings = gms_other_get_string("global.livess", "");

show_message ((strings) + "ENEMY LIVES LEFT");

gms_chat("LIVES LEFT = " + gms_other_get_string("", "global.livess"), c_red);


nothing works arg~!

Replies (3)

Last message on 10 Oct 2015

zabujard (Topicstarter) on 9 Oct 2015, 07:19:00
also tried

var i, player;
for(i = 0; i < gms_other_count(); i += 1)
player = gms_other_find(i);


var strings;
strings = gms_instance_get_real(player, "global.livess") ;

draw_text(view_xview[0],(view_yview[-0]+280+30*i )+view_hview[0]-string_height(strings),strings)

its coming up as zero <:O
Size43 (Administrator) on 9 Oct 2015, 14:53:53
You can use gms_self_set to set the variables of the player. You can then use gms_other_get to read those variables again. For global variables, you'll need to use gms_global_*.
zabujard (Topicstarter) on 10 Oct 2015, 13:27:18
thanks man!