gms_p2p_send

Usage: gms_p2p_send ( id, player_id_to, arg0, arg1, arg2... )

Description

Sends the P2P-message with id 'id' to player_id_to.

Replies (4)

Last message on 16 Apr 2017

Dublann on 3 Apr 2017, 20:51:32
Hey,

Im trying to use it as follows:
gms_p2p_send(0string(global.amigo5000), "5000")]/code]
But this error appears:
[code]ERROR in
action number 1
of Async Event: Dialog
for object obj_donar_5000:

Wrong gml type for buffer type
 at gml_Script_XGms_cache_player_write (line 24) -     buffer_write(global.__send_buffer, buffer_u32, argument1);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XGms_cache_player_write (line 24)
called from - gml_Script_XServer_p2p_send (line 3) - XGms_cache_player_write(_b, argument1);
called from - gml_Script_gms_p2p_send (line 11) - XServer_p2p_send(argument[0], argument[1]);
called from - gml_Object_obj_donar_5000_WebUserInteractionEvent_1 (line 10) -           gms_p2p_send(0string(global.amigo5000), "5000")


I tried to use string and real as argument and as, but still receiving the same error. THX
Dublann on 3 Apr 2017, 20:52:54
Hey,

Im trying to use it as follows:
gms_p2p_send(0string(global.amigo5000), "5000")

But this error appears:
ERROR in
action number 1
of Async Event: Dialog
for object obj_donar_5000:
Wrong gml type for buffer type
 at gml_Script_XGms_cache_player_write (line 24) -     buffer_write(global.__send_buffer, buffer_u32, argument1);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XGms_cache_player_write (line 24)
called from - gml_Script_XServer_p2p_send (line 3) - XGms_cache_player_write(_b, argument1);
called from - gml_Script_gms_p2p_send (line 11) - XServer_p2p_send(argument[0], argument[1]);
called from - gml_Object_obj_donar_5000_WebUserInteractionEvent_1 (line 10) -           gms_p2p_send(0string(global.amigo5000), "5000")


I tried to use string and real as argument and as, but still receiving the same error. THX
Dublann on 4 Apr 2017, 20:30:57
Size, I think I solved it. Now Im not getting this error.

The code Im having now in dialog event(async) in one button object is:
global.amigo5000 = ds_map_find_value(async_load, "result");//got from get_string_async
idplayer=gms_other_find_by_name(global.amigo5000)
show_message(idplayer)
gms_p2p_send(5,idplayer,5000)


But the problem is that the idplayer is always -1 and Im getting the server sided error. Why is it giving me -1?

Thx
Size43 (Administrator) on 16 Apr 2017, 16:24:58
-1 means it could not find a player with the name you gave.