Post: Dvars?
02-22-2017, 05:09 AM #1
xTrevdizzle
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); How do I use dvars in a sprx menu? (if possible idk)

I tried using this:
    void(*SendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;

opd_s gs = { 0x002911A8, TOC };
const char*(*Dvar_GetString)(const char* Dvar) = (const char*(*)(const char*))&gs;

void SV_SendServerCommand(int client, char* command)
{
SendServerCommand(client, 0, command);
}
void SetDvar(int client, char* Dvar)
{
char buf[100];
Com_sprintf(buf, 100, "q \"%s%s", Dvar, "\"");
SendServerCommand(client, buf);
}


which I found somewhere in the mw3 section, but it doesn't seem to want to work for me. I can't find really any info on dvars except lists, so I don't even know if it's possible on ps3. Can anyone provide me with info on dvars and how to use them? I would do an appreciate.

Thanks in advance! :^)
Last edited by xTrevdizzle ; 02-22-2017 at 01:49 PM.
02-22-2017, 05:30 AM #2
Father Luckeyy
Retired - Lead Content Manager
Originally posted by xTrevdizzle View Post
How do I use dvars in a sprx menu? (if possible idk)

I tried using this:
    void(*SendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;

opd_s gs = { 0x002911A8, TOC };
const char*(*Dvar_GetString)(const char* Dvar) = (const char*(*)(const char*))&gs;

void SV_SendServerCommand(int client, char* command)
{
SendServerCommand(client, 0, command);
}
void SetDvar(int client, char* Dvar)
{
char buf[100];
Com_sprintf(buf, 100, "q \"%s%s", Dvar, "\"");
SendServerCommand(client, 1, buf);
}


which I found somewhere in the mw3 section, but it doesn't seem to want to work for me. I can't find really any info on dvars except lists, so I don't even know if it's possible on ps3. Can anyone provide me with info on dvars and how to use them? I would do an appreciate.

Thanks in advance! :^)


Also I accidentally posted this in the wrong section. Please move it. Sorry.


Thread Moved - Modern Warfare 3 Questions and Inquiries
03-31-2017, 06:18 PM #3
Originally posted by xTrevdizzle View Post
How do I use dvars in a sprx menu? (if possible idk)

I tried using this:
    void(*SendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;

opd_s gs = { 0x002911A8, TOC };
const char*(*Dvar_GetString)(const char* Dvar) = (const char*(*)(const char*))&gs;

void SV_SendServerCommand(int client, char* command)
{
SendServerCommand(client, 0, command);
}
void SetDvar(int client, char* Dvar)
{
char buf[100];
Com_sprintf(buf, 100, "q \"%s%s", Dvar, "\"");
SendServerCommand(client, buf);
}


which I found somewhere in the mw3 section, but it doesn't seem to want to work for me. I can't find really any info on dvars except lists, so I don't even know if it's possible on ps3. Can anyone provide me with info on dvars and how to use them? I would do an appreciate.

Thanks in advance! :^)


Did you figure this out ?
03-31-2017, 06:32 PM #4
SC58
Former Staff
Originally posted by UnholyTalonTSi View Post
Did you figure this out ?


this works fine

void SetClientDvar(int clientNum, const char *dvarName, const char *value)
{
SV_GameSendServerCommand(clientNum, SV_CMD_RELIABLE, va("q %s \"%s\"", dvarName, value));
}

The following user thanked SC58 for this useful post:

UnholyTalonTSi
03-31-2017, 06:47 PM #5
Originally posted by SC58 View Post
this works fine

void SetClientDvar(int clientNum, const char *dvarName, const char *value)
{
SV_GameSendServerCommand(clientNum, SV_CMD_RELIABLE, va("q %s \"%s\"", dvarName, value));
}


Yea. I was trying to help him out. Thanks. If you can please check this out and see if you can help. You must login or register to view this content.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo