Another problem occoured :(
#1

I don't know if its bad to post 3 threads within an hour, but here is my question. I just made my first filterscript ever, so i don't really get how it works yet with filterscripts. I have removed the // before #DEFINE_FILTERSCRIPT on the top of the script itself. I also defined a few colours. Here is what i have added to my script:
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "FT Bot:"#COL_GREEN"Welcome to Fantasy RPG Trucking! We hope you have a great time!");
    SendClientMessage(playerid, COLOR_YELLOW, "FT Bot:"#COL_GREEN"Please read the /rules and /cmds before asking admins how to do it! Thanks!");
    return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, COLOR_YELLOW, "FT Bot:"#COL_GREEN"You have died!");
    return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/heal", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an Admin!");
        SetPlayerHealth(playerid,100);// heal the player
        SendClientMessage(playerid, COLOR_YELLOW, "FT Bot: "#COL_GREEN"You have been healed!");
        return 1;
    }
    return 0;
}
Those are the three things i edited in my script. When compiling i get no single error.
But as soon as i try to use /heal it won't work. I also discovered that none of the commands work, i use PPC_Trucking5 as gamemode, from PowerPc603.

I hope to get help with this issue
Reply
#2

change OnGameModeInit to OnFilterScriptInit and OnGameModeExit to OnFilterScriptExit
Reply
#3

Thanks im trying it out now, i will edit if it worked.

EDIT: i did what you said, but i got these warnings:
Код:
C:\Users\Gebruiker\Desktop\HealFSdoordahley.pwn(71) : warning 235: public function lacks forward declaration (symbol "OnFilterscriptInit")
C:\Users\Gebruiker\Desktop\HealFSdoordahley.pwn(79) : warning 235: public function lacks forward declaration (symbol "OnFilterscriptExit")
Are they safe or did i do something wrong?
Reply
#4

pawn Код:
forward OnFilterscriptInit();
forward OnFilterscriptExit();
??
Reply
#5

Hehe where do i put it? like i said it's my first FS :P
Reply
#6

put it at the top of your filterscript so you can find it easier (make sure it's not in a function/public)
Reply
#7

Alright i will keep you updated

EDIT:
I added the forward OnFilterscriptInit(); and forward OnFilterscriptExit();
but it still wont work :S
heres my code:
pawn Код:
#define FILTERSCRIPT
#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COL_GREEN          "{6EF83C}"
#define COL_EASY           "{FFF1AF}"
#define COL_DGREEN         "{0E8C00}"
#define COL_LOGIN          "{98E090}"
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{F9B857}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LBLUE          "{298ACF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{9FE4AA}"
#define COL_LRED           "{DA7272}"
#define COL_LRED2          "{C77D87}"
#define COL_DYELLOW        "{FAFA52}"
#define COL_BROWN          "{8C703F}"
#define COL_SBLACK         "{474747}"
#define COL_SGREY          "{ADADAD}"
#define COL_SBLUE          "{3660D1}"
#define COL_ACTION         "{E087D9}"
#define COL_DBLUE          "{3030BA}"
#define COL_DGREY          "{5E5E5E}"

#include <a_samp>

#if defined FILTERSCRIPT
forward OnFilterscriptInit();
forward OnFilterscriptExit();

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" FT Bot Loaded!(By Dahley)");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif
Reply
#8

The public name is same forward name,
like
pawn Код:
forward OnFilterScriptInit();
public OnFilterScriptInit()
ok? you has used 'OnFilterscriptInit();' and 'OnFilterScriptInit()' can you see the error now?
Reply
#9

pawn Код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COL_GREEN          "{6EF83C}"
#define COL_EASY           "{FFF1AF}"
#define COL_DGREEN         "{0E8C00}"
#define COL_LOGIN          "{98E090}"
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{F9B857}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LBLUE          "{298ACF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{9FE4AA}"
#define COL_LRED           "{DA7272}"
#define COL_LRED2          "{C77D87}"
#define COL_DYELLOW        "{FAFA52}"
#define COL_BROWN          "{8C703F}"
#define COL_SBLACK         "{474747}"
#define COL_SGREY          "{ADADAD}"
#define COL_SBLUE          "{3660D1}"
#define COL_ACTION         "{E087D9}"
#define COL_DBLUE          "{3030BA}"
#define COL_DGREY          "{5E5E5E}"

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" FT Bot Loaded!(By Dahley)");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
Reply
#10

thanks my friends it worked!

EDIT:aaah noo, the commands in game still wont work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)