commands in the console?!
#1

Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"help",true))
    {
        clearconsole();
        print("Welcome to the admin control panel of guards vs the assassin!");
        print("The server is can be fully controlled in this window!");
        print("Your commands are the following:");
        print("clearconsole, ");
        return 1;
    }
    else if(!strcmp(cmd,"clearconsole",true))
    {
        clearconsole();
        return 1;
    }
    return 0;
}
When i type "help" nothing happens same thing for "clearconsole"
Reply
#2

try that

Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd,"help",true))
    {
        clearconsole();
        print("Welcome to the admin control panel of guards vs the assassin!");
        print("The server is can be fully controlled in this window!");
        print("Your commands are the following:");
        print("clearconsole, ");
        return 1;
    }
    else if(!strcmp(cmd,"clearconsole",true))
    {
        clearconsole();
        return 1;
    }
    return 0;
}
Reply
#3

Don't use that as it will clear it if you do /help, and it doesn't actually register the /clearconsole CMD, try this:
pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"help",true))
    {
        print("Welcome to the admin control panel of guards vs the assassin!");
        print("The server is can be fully controlled in this window!");
        print("Your commands are the following:");
        SendRconCommand("clearconsole");
        return 1;
    }
    if(!strcmp(cmd,"clearconsole",true))
    {
        clearconsole();
        return 1;
    }
    return 0;
}
Reply
#4

https://sampwiki.blast.hk/wiki/OnRconCommand

Strcmp returns 0 if the strings are the same, so that code won't work Blackazur.
Reply
#5

@RealCop228
1: Sorry for getting mad about your posts, that was very childish of me. I shouldn't have asked for that from you guys.
2: In the code I gave him it's if(!strcmp(cmd, "CMD", true)) as I know it returns 0 if they are the same.
Reply
#6

Still doesnt work guys please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)