Help me out here (;
#1

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;
}
Reply
#2

it will send "[0.3d]L.A. Noire RPG Cops and Robbers "version" %s" and this isnt SAMP Rcon command..

You must put

pawn Код:
hostname
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;
}
Reply
#3

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;
}
Reply
#4

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;
}
Reply
#5

Lol ye, sorry, I resolved this problem on IRC :b thanks anyways!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)