Help me out here (; - 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: Help me out here (; (
/showthread.php?tid=306748)
Help me out here (; -
FireCat - 27.12.2011
When I type /setupdate hello it doesn't update the server name! ):
Why?
pawn Код:
CMD:setupdate(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
static text[65];
if(sscanf(params,"s[64]",text)) return SendHelpMessage(playerid,"/setupdate <text>","It will set the server name.");
static string[300];
format(string,sizeof string,"[0.3d]L.A. Noire RPG Cops and Robbers "version" %s",text);
SendRconCommand(string);
return 1;
}
Re: Help me out here (; -
kizla - 27.12.2011
it will send "[0.3d]L.A. Noire RPG Cops and Robbers "version" %s" and this isnt SAMP Rcon command..
You must put
if front of this or else, depeading what you want to change
and here is command
pawn Код:
CMD:setupdate(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
static text[64];
if(sscanf(params,"s[64]",text)) return SendHelpMessage(playerid,"/setupdate <text>","It will set the server name.");
static string[300];
format(string,sizeof(string),"hostname [0.3d]L.A. Noire RPG Cops and Robbers "version" %s",text);
SendRconCommand(string);
return 1;
}
Re: Help me out here (; -
Scenario - 27.12.2011
I'm a bit confused by your code, because I'm not exactly sure what you're trying to do. I think I got it though:
pawn Код:
CMD:setupdate(playerid,params[])
{
new text[65];
if(!IsPlayerAdmin(playerid))
return 0;
if(sscanf(params,"s[64]",text))
return SendHelpMessage(playerid,"/setupdate <text>","It will set the server name.");
new string[100];
format(string, sizeof(string), "hostname [0.3d]L.A. Noire RPG Cops and Robbers version %s", text);
SendRconCommand(string);
return 1;
}
Re: Help me out here (; -
Seven_of_Nine - 27.12.2011
You meant like so?
pawn Код:
CMD:setupdate(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new iVersion[64];
if(sscanf(params,"s[64]",iVersion)) return SendHelpMessage(playerid,"/setupdate <text>","It will set the server name.");
new iUpdate[300];
format(iUpdate,sizeof(iUpdate),"hostname [0.3d]L.A. Noire RPG Cops and Robbers %s",iVersion);
SendRconCommand(iUpdate);
return 1;
}
Re: Help me out here (; -
FireCat - 28.12.2011
Lol ye, sorry, I resolved this problem on IRC :b thanks anyways!