+ if (sv.time < host_client->nametime)
+ {
+ SV_ClientPrintf("You can't change name more than once every 5 seconds!\n");
+ return;
+ }
+
+ host_client->nametime = sv.time + 5;
+
+ // point the string back at updateclient->name to keep it safe
+ strlcpy (host_client->name, newName, sizeof (host_client->name));
+ host_client->edict->fields.server->netname = PRVM_SetEngineString(host_client->name);
+ if (strcmp(host_client->old_name, host_client->name))
+ {
+ if (host_client->spawned)
+ SV_BroadcastPrintf("%s changed name to %s\n", host_client->old_name, host_client->name);
+ strcpy(host_client->old_name, host_client->name);
+ // send notification to all clients
+ MSG_WriteByte (&sv.reliable_datagram, svc_updatename);
+ MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
+ MSG_WriteString (&sv.reliable_datagram, host_client->name);
+ }
+}
+
+/*
+======================
+Host_Playermodel_f
+======================
+*/
+cvar_t cl_playermodel = {CVAR_SAVE, "_cl_playermodel", ""};
+// the old cl_playermodel in cl_main has been renamed to __cl_playermodel
+void Host_Playermodel_f (void)
+{
+ int i, j;
+ char newPath[sizeof(host_client->playermodel)];
+
+ if (Cmd_Argc () == 1)
+ {
+ Con_Printf("\"playermodel\" is \"%s\"\n", cl_playermodel.string);
+ return;
+ }
+
+ if (Cmd_Argc () == 2)
+ strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
+ else
+ strlcpy (newPath, Cmd_Args(), sizeof (newPath));
+
+ for (i = 0, j = 0;newPath[i];i++)
+ if (newPath[i] != '\r' && newPath[i] != '\n')
+ newPath[j++] = newPath[i];
+ newPath[j] = 0;
+
+ if (cmd_source == src_command)
+ {
+ Cvar_Set ("_cl_playermodel", newPath);
+ if (cls.state == ca_connected)
+ Cmd_ForwardToServer ();
+ return;
+ }
+
+ /*
+ if (sv.time < host_client->nametime)
+ {
+ SV_ClientPrintf("You can't change playermodel more than once every 5 seconds!\n");
+ return;
+ }
+
+ host_client->nametime = sv.time + 5;
+ */
+
+ // point the string back at updateclient->name to keep it safe
+ strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
+ if( eval_playermodel )
+ PRVM_GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PRVM_SetEngineString(host_client->playermodel);
+ if (strcmp(host_client->old_model, host_client->playermodel))
+ {
+ strcpy(host_client->old_model, host_client->playermodel);
+ /*// send notification to all clients
+ MSG_WriteByte (&sv.reliable_datagram, svc_updatepmodel);
+ MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
+ MSG_WriteString (&sv.reliable_datagram, host_client->playermodel);*/
+ }
+}
+
+/*
+======================
+Host_Playerskin_f
+======================
+*/
+cvar_t cl_playerskin = {CVAR_SAVE, "_cl_playerskin", ""};
+void Host_Playerskin_f (void)
+{
+ int i, j;
+ char newPath[sizeof(host_client->playerskin)];
+
+ if (Cmd_Argc () == 1)
+ {
+ Con_Printf("\"playerskin\" is \"%s\"\n", cl_playerskin.string);
+ return;
+ }
+
+ if (Cmd_Argc () == 2)
+ strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
+ else
+ strlcpy (newPath, Cmd_Args(), sizeof (newPath));
+
+ for (i = 0, j = 0;newPath[i];i++)
+ if (newPath[i] != '\r' && newPath[i] != '\n')
+ newPath[j++] = newPath[i];
+ newPath[j] = 0;
+
+ if (cmd_source == src_command)
+ {
+ Cvar_Set ("_cl_playerskin", newPath);
+ if (cls.state == ca_connected)
+ Cmd_ForwardToServer ();
+ return;
+ }
+
+ /*
+ if (sv.time < host_client->nametime)
+ {
+ SV_ClientPrintf("You can't change playermodel more than once every 5 seconds!\n");
+ return;
+ }
+
+ host_client->nametime = sv.time + 5;
+ */
+
+ // point the string back at updateclient->name to keep it safe
+ strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
+ if( eval_playerskin )
+ PRVM_GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PRVM_SetEngineString(host_client->playerskin);
+ if (strcmp(host_client->old_skin, host_client->playerskin))
+ {
+ if (host_client->spawned)
+ SV_BroadcastPrintf("%s changed skin to %s\n", host_client->name, host_client->playerskin);
+ strcpy(host_client->old_skin, host_client->playerskin);
+ /*// send notification to all clients
+ MSG_WriteByte (&sv.reliable_datagram, svc_updatepskin);
+ MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
+ MSG_WriteString (&sv.reliable_datagram, host_client->playerskin);*/
+ }