You could make a char array like that:

[username][0][password][0]

memcpy() is a windows function. It copies the the content of the array of the second parameter into the array of the first parameter. The third parameter determines the size of the content that should be copied.

So you could do it like that:

Code:
function login_start(var sender, STRING* msg)
{
   char temp_array[100];

   inkey(username);
   inkey(password);

   memcpy(temp_array, username, str_len(username)+1); //also copies the zero termination of username
   memcpy(&temp_array[str_len(username)], password, str_len(password)+1); //also copies the zero termination of password

   enet_clsend_event(19, temp_array, str_len(username)+str_len(password)+2, SERVER);
}

function ev_username(var sender, STRING* msg, var size)
{
   char temp_array[100];
   char username[30];
   char password[30];

   memcpy(temp_array,_CHR(msg),size);

   str_cpy(username, temp_array); //copies everything to the first zero termination
   str_cpy(password, &temp_array[str_len(temp_array)+1]); //copies everything to the second zero termination
}



It's not shorter, but has the advantage that you can use "," in the username and password.
Btw. it's not tested, so I can't guarantee that it's working.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version