How can I do this?
#6

Quote:
Originally Posted by [M]onsieur
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/nextmode", true, 9) && IsPlayerAdmin(playerid))
    {
        if(strlen(cmdtext) < 9)
        {
            return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /nextmode [name]");
        }

        static
                 string[128]
        ;

        format(string, sizeof(string), "changemode %s", str, cmdtext[10]);

        return SendRconCommand(string), true;
    }
    return false;
}
Why did you use a static? It's not exactly good here... As far as I know, statics are meant to be used outside the function, unlike new. So basically if he has "string" somewhere else, it will shadow a variable and return a warning.
Reply


Messages In This Thread
How can I do this? - by Tigerbeast11 - 11.09.2011, 14:51
Re: How can I do this? - by Gertin - 11.09.2011, 14:57
Re: How can I do this? - by Tigerbeast11 - 11.09.2011, 15:02
Re: How can I do this? - by Mean - 11.09.2011, 16:44
Re: How can I do this? - by [M]onsieur - 11.09.2011, 16:59
Re: How can I do this? - by Mean - 11.09.2011, 17:02
Re: How can I do this? - by Tigerbeast11 - 11.09.2011, 17:32
Re: How can I do this? - by Mean - 11.09.2011, 18:00
Re: How can I do this? - by scottyishere - 11.09.2011, 18:20
Re: How can I do this? - by Tigerbeast11 - 11.09.2011, 21:30

Forum Jump:


Users browsing this thread: 1 Guest(s)