SA-MP Forums Archive
/AFK System wont be marked on ServerFFS - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /AFK System wont be marked on ServerFFS (/showthread.php?tid=265875)



/AFK System wont be marked on ServerFFS - rooney12 - 02.07.2011

Hey, i just made my first Script! I know its easy.. But this is my first script.
So when i was gonna upload it on ServerFFS, and tryed to Enable it by Marking, it. Then i clicked Sace Configuration, it saved but my script wasnt marked anymore.
I got 0Errors when compiling. So here is my script.

pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendMessage(playerid,RED, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now AFK!");
   
    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now BACK!");
   
        return 1;
    }
    return 0;
}
#endif



Re: /AFK System wont be marked on ServerFFS - Skylar Paul - 02.07.2011

How did you not get any errors on that? Define your colors, and return 1 under the command "/AFK"


Re: /AFK System wont be marked on ServerFFS - rooney12 - 02.07.2011

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
How did you not get any errors on that? Define your colors, and return 1 under the command "/AFK"
Eh here is my code now, still same problem

pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendMessage(playerid,GREEN, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now AFK! ");
   
    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now BACK! ");
   
    }
    return 0;
}
#endif
0Bugs in Compile, and im a new scripter, sе if you can fix it. May you just fix it and set it in [pawn, or [Code]


Re: /AFK System wont be marked on ServerFFS - rooney12 - 02.07.2011

Bump, i need a fast asnwer please


Re: /AFK System wont be marked on ServerFFS - jameskmonger - 02.07.2011

pawn Код:
#include <a_samp>

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendMessage(playerid,GREEN, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now AFK! ");
   
    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now BACK! ");
   
    }
    return 0;
}



Re: /AFK System wont be marked on ServerFFS - rooney12 - 02.07.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
pawn Код:
#include <a_samp>

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,GREEN, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now AFK! ");
   
    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
    SendClientMessage(playerid,ORANGE," %s is now BACK! ");
   
    }
    return 0;
}
Ok i get these Errors, About colors, but there isnt any problems with the colors?

Код:
C:\Users\Usman\Desktop\Mac's AFK System.pwn(18) : error 017: undefined symbol "GREEN"
C:\Users\Usman\Desktop\Mac's AFK System.pwn(27) : error 017: undefined symbol "ORANGE"
C:\Users\Usman\Desktop\Mac's AFK System.pwn(31) : error 017: undefined symbol "ORANGE"
C:\Users\Usman\Desktop\Mac's AFK System.pwn(37) : error 030: compound statement not closed at the end of file (started at line 24)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: /AFK System wont be marked on ServerFFS - iPLEOMAX - 02.07.2011

This is how it should be..
pawn Код:
#include <a_samp>

#define COLOR_ONE 0xFF0000FF
#define COLOR_TWO 0x00FF00FF

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendMessage(playerid,GREEN, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
        new message[40], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(message,sizeof(message),"%s is now AFK!",name);
        SendClientMessage( playerid, COLOR_ONE, message);
        return 1;
    }

    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
        new message[40], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(message,sizeof(message),"%s is now BACK!",name);
        SendClientMessage( playerid, COLOR_TWO, message);
        return 1;
    }
    return 0;
}
Untested, but this should work. You can learn scripting by spending your time on SAMP Forums/Wiki.
Goodluck!


Re: /AFK System wont be marked on ServerFFS - jameskmonger - 02.07.2011

iPLEOMAX, you have defined "FILTERSCRIPT" when there is no need to.


Re: /AFK System wont be marked on ServerFFS - rooney12 - 02.07.2011

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
This is how it should be..
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_ONE 0xFF0000FF
#define COLOR_TWO 0x00FF00FF

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Mac's AFK System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendMessage(playerid,GREEN, " Loading Mac's AFK System! ");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/AFK", cmdtext, true, 10) == 1)
    {
        new message[40], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(message,sizeof(message),"%s is now AFK!",name);
        SendClientMessage( playerid, COLOR_ONE, message);
        return 1;
    }

    if (strcmp("/BACK", cmdtext, true, 10) == 1)
    {
        new message[40], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(message,sizeof(message),"%s is now BACK!",name);
        SendClientMessage( playerid, COLOR_TWO, message);
        return 1;
    }
    return 0;
}
Untested, but this should work. You can learn scripting by spending your time on SAMP Forums/Wiki.
Goodluck!
Thanks for helping, but this WONT work. ServerFFS dont let it be Marked.

Btw i learned to script like you saw, by videos on *******


Re: /AFK System wont be marked on ServerFFS - iPLEOMAX - 02.07.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
iPLEOMAX, you have defined "FILTERSCRIPT" when there is no need to.
o_O I never knew that, lol. Thanks for the info.