Can't use command in FS
#1

Hi!

I made a command in SF and the command won't work it just says: Server unknown command..

Code:


pawn Код:
public OnFilterScriptInit()
{
    public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid,0);
        SendClientMessage(playerid,0xF00E69FF, "TEST");
        return 1;
    }
    return 0;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" ");
    print("----------------------------------\n");
}

#endif
Thanks!

Maybe I just forgot some easy thing! ^^...

Edit: And it works in a GM.
Reply
#2

You cant put that function under OnFilterScriptInit.. do it like this:
pawn Код:
public OnFilterScriptInit()
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" ");
    print("----------------------------------\n");
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid,0);
        SendClientMessage(playerid,0xF00E69FF, "TEST");
        return 1;
    }
    return 0;
}
Weird that you have 2200+ posts and cant do this.
Reply
#3

Above^^
Reply
#4

Thanks!, I just remembered wrong then!..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)