Hi,
i have a problem with g_gents[arg0]. I do the same like in the creating plugin topic.
Код
C_DLLEXPORT int JASS_syscall(int cmd, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12)
{
if (cmd == G_LOCATE_GAME_DATA)
{
g_gents = (gentity_t*)arg0;
g_gentsize = arg2;
g_clients = (gclient_t*)arg3;
g_clientsize = arg4;
}
JASS_RET_IGNORED(1);
}
After this i make a command in the main.
Код
C_DLLEXPORT int JASS_vmMain(int cmd, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11)
{
[....]
if(!strcmp(command,"myname"))
{
g_syscall(G_SEND_SERVER_COMMAND,arg0,JASS_VARARGS("print \"Test: My
name is %s\n\"",g_gents[arg0].client->pers.netname));
}
[....]
}
but it crash after using this commad. It works only on the first client on the server. If the next connected client use this command he will crash the server.
Im sure that i forget something, but what?