/servername - problem - 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: /servername - problem (
/showthread.php?tid=391349)
/servername - problem -
Akcent_Voltaj - 10.11.2012
i look over most gamemodes.. that i type /servername and the server gets new name....
Re: /servername - problem -
Faisal_khan - 10.11.2012
Gets new name?
Something like this?
https://sampforum.blast.hk/showthread.php?tid=273353
Re: /servername - problem -
Akcent_Voltaj - 10.11.2012
no so if i type /servername [ new servername] get it??and the server name changes..
Re: /servername - problem -
Faisal_khan - 10.11.2012
Yeah then go to the link I mentioned.
Re: /servername - problem -
DBan - 10.11.2012
pawn Код:
SendRconCommand("hostname [name]");
https://sampwiki.blast.hk/wiki/Advanced_...#RCON_Commands
Re: /servername - problem -
JaKe Elite - 10.11.2012
Untested
pawn Код:
if(strcmp(cmdtext, "/servername", true) == 0)
{
new str[50];
if(sscanf(cmdtext, "s[30]", cmdtext)) return SendClientMessage(playerid, -1, "Usage: /servername [Name]");
format(str, sizeof(str), "hostname %s", cmdtext);
SendRconCommand(str);
return 1;
}
Re: /servername - problem -
Akcent_Voltaj - 10.11.2012
well..i want to type /servername [ new servername] and i can put anyname to the server just like the rcon thing..but i want the owners to change servername..the link up is to change automaticly..
Re: /servername - problem -
Lordzy - 10.11.2012
pawn Код:
CMD:servername(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You must login as RCON admin to use this command.");
new srvname[60];
if(sscanf(params,"s[60]",srvname)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /servername [new server name]");
if(strlen(srvname) > 3) return SendClientMessage(playerid, 0xFF0000FF, "Minimum character level:4");
SendRconCommand("hostname %s", srvname);
return 1;
}
Re: /servername - problem -
Akcent_Voltaj - 10.11.2012
Quote:
Originally Posted by Lordz™
pawn Код:
CMD:servername(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You must login as RCON admin to use this command."); new srvname[60]; if(sscanf(params,"s[60]",srvname)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /servername [new server name]"); if(strlen(srvname) > 3) return SendClientMessage(playerid, 0xFF0000FF, "Minimum character level:4"); SendRconCommand("hostname %s", srvname); return 1; }
|
warning 203: symbol is never used: "servername"
Re: /servername - problem -
Lordzy - 10.11.2012
You must have zcmd include and sscanf2 include+plugin.
Also that symbol, you might have created before. So just remove it.