SA-MP Forums Archive
Set hostname to something defined - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Set hostname to something defined (/showthread.php?tid=454834)



Set hostname to something defined - Sellize - 30.07.2013

I did

#define ServerName "poop"

And then I did

SendRconCommand("hostname " + ServerName);

But that gives me this error

C:\Users\x3990.003\Desktop\Rp Server\gamemodes\rp.pwn(177) : error 001: expected token: "-string end-", but found "-identifier-"


Re: Set hostname to something defined - JimmyCh - 30.07.2013

I'm guessing you wrongly formatted it, try the following:
pawn Код:
new string[256];
format(string,sizeof(string), "hostname %s", ServerName);
SendRconCommand(string);