[HELP] Using SendRconCommand
#1

Ok i'm having tricky issues with this.

I thought i could do this;

SendRconCommand("mapname %s", mapname );
(mapname is already defined)

but i'm doing this wrong aren't i?
is there another way of doing this with SendRconCommand(s) ?

Код:
warning 202: number of arguments does not match definition
and
then i added new mapname[50]; and;
Код:
warning 219: local variable "mapname" shadows a variable at a preceding level
... ? ?
Reply
#2

pawn Код:
new string[32];
format(string, sizeof(string), "mapname %s",mapname);
SendRconCommand(string);
Reply
#3

pawn Код:
new cmd[128],idx,tmp[100];
cmd = strtok(cmdtext,idx);
if(!strcmp(cmd, "/map", true))
{
   new map;
   tmp = strtok(cmdtext,idx);
   map = strval(tmp);
   if(!strlen(tmp)) return 0;
   else SendRconCommand(mapname tmp);
   return 1;
}
Reply
#4

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
pawn Код:
new string[128];
format(string, sizeof(string), "%s",mapname);
SendRconCommand(string);
Jeeeeez.

pawn Код:
new
       m_Name[32]
;
format(m_Name, sizeof(m_Name), "mapname %s", mapname);
SendRconCommand(m_Name);
Reply
#5

Quote:
Originally Posted by hanzen
Посмотреть сообщение
Jeeeeez.

pawn Код:
new
       m_Name[32]
;
format(m_Name, sizeof(m_Name), "mapname %s", mapname);
SendRconCommand(m_Name);
Tsss... moron.
Reply
#6

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Tsss... moron.
Why? Your code won't work.
Reply
#7

Quote:
Originally Posted by hanzen
Посмотреть сообщение
Why? Your code won't work.
I know, I forgot... mapname.
And I don't really know what's the limit of MAPNAME.
People can do a mistake, you know.
Reply
#8

You didn't correct me, you were "Jeeezing" me.
Reply
#9

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
You didn't correct me, you were "Jeeezing" me.
Calm down, it was a big jeez.
Reply
#10

wow, dont fight LOL

and

Код:
	new m_string[30];
	format(m_string, sizeof(m_string), "mapname %s",mapname);
	SendRconCommand(m_string);
and wow i'm an idiot... ^

Works +1 - thanks guys ....
You both helped lol
1: for code and 2nd for giving me an idea to change string name, since it has already but isn't giving me a error or warning about it- thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)