Need Help Guys: [FILTERSCRIPT]
#1

Reason i use it for death match my server :

PAWN CODE:
pawn Код:
// TEST FilterScript by Dr.Ghost
// use commands /dc ammount
//#define FILTERSCRIPT

#include <a_samp>
#define FILTERSCRIPT

#include <sscanf>// credits by ******
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define MSGFAIL_COLOR 0xff55aaff
#define MSGCOMM_COLOR 0x55aaff77

//Pickup IDs used
#define MoneyPack       1212
#define MoneyBag        1550

const PickupsMax=120;
new Pickups=0;
new PUMoney[PickupsMax];
new PUAmount[PickupsMax];

public OnFilterScriptInit()
{
    Pickups=0;
    return 1;
}

public OnFilterScriptExit()
{
    for (new p=1;p<PickupsMax;p++)
    {
        DestroyPickup(PUMoney[p]);
    }
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" BETA [FS]Tester By Dr.Ghost");
    print("----------------------------------\n");
}

#endif

public OnFilterScriptInit()
{
    Pickups=0;
    return 1;
}

public OnFilterScriptExit()
{
    for (new p=1;p<PickupsMax;p++)//Move this under OnGameModeExit
    {
        DestroyPickup(PUMoney[p]);
    }
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

forward OnPlayerDeath(playerid);
public OnPlayerDeath(playerid)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    new Amount=GetPlayerMoney(playerid)/10;
    if(Amount>0)
    {
        DropPickupMoney(playerid,Amount);
    }
    return 1;
}

forward DropPickupMoney(playerid,Amount);
public DropPickupMoney(playerid,Amount)

{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    Pickups++;
    PUAmount[Pickups]=Amount;
    GivePlayerMoney(playerid,-Amount);
    if(Amount<150000)
    {
        PUMoney[Pickups]=CreatePickup(MoneyPack,3,X+2,Y+2,Z,-1);
    }
    else
    {
        PUMoney[Pickups]=CreatePickup(MoneyBag,3,X+2,Y+2,Z,-1);
    }
    new string[48];
    format(string,sizeof(string),"~r~~h~you dropped~n~~y~$ ~g~~h~%d",Amount);
    GameTextForPlayer(playerid,string,2000,5);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(DC, 2, cmdtext);
    return 0;
}

dcmd_DC(playerid,cmdtext[])
{
    new Amount;
    if (sscanf(cmdtext,"d",Amount))
    {
        SendClientMessage(playerid,MSGCOMM_COLOR, "Usage: \"/DC <Amount>\"");
    }
    else
    {
        if(GetPlayerMoney(playerid)<Amount)
        {
            return SendClientMessage(playerid,MSGFAIL_COLOR,"You dont have that much money!");
        }
        if(Amount>0)
        {
            DropPickupMoney(playerid,Amount);
        }
        else
        {
            SendClientMessage(playerid,MSGFAIL_COLOR,"You cant drop negative money!");
        }
    }
    return 1;
}

forward OnPlayerPickUpPickup(playerid,pickupid);
public OnPlayerPickUpPickup(playerid,pickupid)
{
    for (new p=0;p<PickupsMax;p++)
    {
        if (pickupid==PUMoney[p] && PUAmount[p]>0)
        {
            new string[64];
            format(string,sizeof(string),"~w~you found~n~~y~$ ~g~~h~%d",PUAmount[p]);
            GameTextForPlayer(playerid,string,4000,5);
            GivePlayerMoney(playerid,PUAmount[p]);
            DestroyPickup(PUMoney[p]);
        }
    }
    return 1;
}
AFTER COMPILE IT I GOT:
CODE:
Quote:

C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(37) : error 026: no matching "#if..."
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(46) : error 026: no matching "#if..."
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(49) : error 021: symbol already defined: "OnFilterScriptInit"
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(55) : error 021: symbol already defined: "OnFilterScriptExit"
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(76) : warning 219: local variable "Amount" shadows a variable at a preceding level
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(85) : warning 219: local variable "Amount" shadows a variable at a preceding level
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(107) : error 025: function heading differs from prototype
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(107) : error 029: invalid expression, assumed zero
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(109) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(110) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(113) : error 001: expected token: ")", but found "&"
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(113) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(113 -- 116) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]MoneyBag2.pwn(113 -- 116) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


12 Errors.

need help..
If work Sent me at http://uppit.com/ upload it Then Give me that LINK:

*****TRY DOWNLOAD AND TRY FIX IT: ***ALSO THANKS FOR U ALL GUYS..anybody for HELP!!
HERE ARE DOCUMENT PAWN FOR FILTERSCRIPT FAILED TO COMPILE:
Reply
#2

this is very hard to read.

use [pawn] [ /pawn]
Reply
#3

sorry guys
Reply
#4

pawn Код:
// TEST FilterScript by Dr.Ghost
// use commands /dc ammount
//#define FILTERSCRIPT

#include <a_samp>
#define FILTERSCRIPT

#include <dcmd>// credits by ******
//#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define MSGFAIL_COLOR 0xff55aaff
#define MSGCOMM_COLOR 0x55aaff77

//Pickup IDs used
#define MoneyPack       1212
#define MoneyBag        1550

const PickupsMax=120;
new Pickups=0;
new PUMoney[PickupsMax];
new PUAmount[PickupsMax];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    Pickups=0;
    return 1;
}

public OnFilterScriptExit()
{
    for (new p=1;p<PickupsMax;p++)
    {
        DestroyPickup(PUMoney[p]);
    }
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" BETA [FS]Tester By Dr.Ghost");
    print("----------------------------------\n");
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

forward OnPlayerDeath(playerid);
public OnPlayerDeath(playerid)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    new Amount=GetPlayerMoney(playerid)/10;
    if(Amount>0)
    {
        DropPickupMoney(playerid,Amount);
    }
    return 1;
}

forward DropPickupMoney(playerid,Amount);
public DropPickupMoney(playerid,Amount)

{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    Pickups++;
    PUAmount[Pickups]=Amount;
    GivePlayerMoney(playerid,-Amount);
    if(Amount<150000)
    {
        PUMoney[Pickups]=CreatePickup(MoneyPack,3,X+2,Y+2,Z,-1);
    }
    else
    {
        PUMoney[Pickups]=CreatePickup(MoneyBag,3,X+2,Y+2,Z,-1);
    }
    new string[48];
    format(string,sizeof(string),"~r~~h~you dropped~n~~y~$ ~g~~h~%d",Amount);
    GameTextForPlayer(playerid,string,2000,5);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(DC, 2, cmdtext);
    return 0;
}

dcmd_DC(playerid,cmdtext[])
{
    new Amount;
    if (sscanf(cmdtext,"d",Amount))
    {
        SendClientMessage(playerid,MSGCOMM_COLOR, "Usage: \"/DC <Amount>\"");
    }
    else
    {
        if(GetPlayerMoney(playerid)<Amount)
        {
            return SendClientMessage(playerid,MSGFAIL_COLOR,"You dont have that much money!");
        }
        if(Amount>0)
        {
            DropPickupMoney(playerid,Amount);
        }
        else
        {
            SendClientMessage(playerid,MSGFAIL_COLOR,"You cant drop negative money!");
        }
    }
    return 1;
}

forward OnPlayerPickUpPickup(playerid,pickupid);
public OnPlayerPickUpPickup(playerid,pickupid)
{
    for (new p=0;p<PickupsMax;p++)
    {
        if (pickupid==PUMoney[p] && PUAmount[p]>0)
        {
            new string[64];
            format(string,sizeof(string),"~w~you found~n~~y~$ ~g~~h~%d",PUAmount[p]);
            GameTextForPlayer(playerid,string,4000,5);
            GivePlayerMoney(playerid,PUAmount[p]);
            DestroyPickup(PUMoney[p]);
        }
    }
    return 1;
}
Remove the '#define dcmd' stuff.
Change the '#include <sscanf>' to '#include <dcmd>' and add this include:
http://rpdsamp.nl/get/gta/sa/mp/serv...e/dcmd.inc.zip

Then the errors will be gone
Reply
#5

guys i got erro again:

PAWN CODE:
pawn Код:
// TEST FilterScript by Dr.Ghost
// use commands /dc ammount
//#define FILTERSCRIPT

#include <a_samp>
#define FILTERSCRIPT

#include <dcmd>// credits by ******
//#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define MSGFAIL_COLOR 0xff55aaff
#define MSGCOMM_COLOR 0x55aaff77

//Pickup IDs used
#define MoneyPack       1212
#define MoneyBag        1550

const PickupsMax=120;
new Pickups=0;
new PUMoney[PickupsMax];
new PUAmount[PickupsMax];

public OnFilterScriptInit()
{
    Pickups=0;
    return 1;
}

public OnFilterScriptExit()
{
    for (new p=1;p<PickupsMax;p++)
    {
        DestroyPickup(PUMoney[p]);
    }
    return 1;
}

forward OnPlayerDeath(playerid);
public OnPlayerDeath(playerid)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    new Amount=GetPlayerMoney(playerid)/10;
    if(Amount>0)
    {
        DropPickupMoney(playerid,Amount);
    }
    return 1;
}

forward OnPlayerPickUpPickup(playerid,pickupid);
public OnPlayerPickUpPickup(playerid,pickupid)
{
    for (new p=0;p<PickupsMax;p++)
    {
        if (pickupid==PUMoney[p] && PUAmount[p]>0)
        {
            new string[64];
            format(string,sizeof(string),"~w~you found~n~~y~$ ~g~~h~%d",PUAmount[p]);
            GameTextForPlayer(playerid,string,4000,5);
            GivePlayerMoney(playerid,PUAmount[p]);
            DestroyPickup(PUMoney[p]);
        }
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(DC, 2, cmdtext);
    return 0;
}

dcmd_DC(playerid,cmdtext[])
{
    new Amount;
    if (sscanf(cmdtext,"d",Amount))
    {
        SendClientMessage(playerid,MSGCOMM_COLOR, "Usage: \"/DC <Amount>\"");
    }
    else
    {
        if(GetPlayerMoney(playerid)<Amount)
        {
            return SendClientMessage(playerid,MSGFAIL_COLOR,"You dont have that much money!");
        }
        if(Amount>0)
        {
            DropPickupMoney(playerid,Amount);
        }
        else
        {
            SendClientMessage(playerid,MSGFAIL_COLOR,"You cant drop negative money!");
        }
    }
    return 1;
}

forward DropPickupMoney(playerid,Amount);
public DropPickupMoney(playerid,Amount)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    Pickups++;
    PUAmount[Pickups]=Amount;
    GivePlayerMoney(playerid,-Amount);
    if(Amount<100000)
    {
        PUMoney[Pickups]=CreatePickup(MoneyPack,3,X+2,Y+2,Z,-1);
    }
    else
    {
        PUMoney[Pickups]=CreatePickup(MoneyBag,3,X+2,Y+2,Z,-1);
    }
    new string[48];
    format(string,sizeof(string),"~r~~h~you dropped~n~~y~$ ~g~~h~%d",Amount);
    GameTextForPlayer(playerid,string,2000,5);
    return 1;
}
AFTER COMPILE:

CODE:
Quote:

C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(42) : warning 219: local variable "Amount" shadows a variable at a preceding level
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(67) : error 025: function heading differs from prototype
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(67) : error 029: invalid expression, assumed zero
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(69) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(70) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(73) : error 001: expected token: ")", but found "&"
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(73) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(73 -- 76) : error 010: invalid function or declaration
C:\Documents and Settings\USER\Desktop\[FS]Money.pwn(73 -- 76) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.

Reply
#6

Omg I don't have any errors when I compile it...
Reply
#7

Maybe he has wrong sscanf version
Reply
#8

I'm using the stock of sscanf... and the dcmd line and that works fine...
Reply
#9

Kwarde please give me the u succes compile it.. plss ... upload it to http://uppit.com/
ok? upload with PWN and AMX thanks
Reply
#10

I hope this is good too:

http://www.rpdsamp.nl/get/gta/sa/mp/...__Dr.Ghost.zip

It includes:

filterscripts/ffff.amx
filterscripts/ffff.pwn
pawno/include/a_samp.inc
pawno/include/dcmd.inc


Just copy everything to your SAMP folder.
If you want, rename the ffff.pwn and the ffff.amx.
After that, try to compile ffff.pwn -> No errors? > YIPPIE <> Errors? > Try to upgrade to the newest SA:MP version <0.3b R2> if you didn't done that yet. ( http://files.sa-mp.com/samp03bsvr_R2_win32.zip )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)