Need Help Guys: [FILTERSCRIPT]
#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


Messages In This Thread
Need Help Guys: [FILTERSCRIPT] - by Dr.Ghost - 01.11.2010, 15:52
Re: Need Help Guys: [FILTERSCRIPT] - by Bessensap - 01.11.2010, 15:54
Re: Need Help Guys: [FILTERSCRIPT] - by Dr.Ghost - 01.11.2010, 15:57
Re: Need Help Guys: [FILTERSCRIPT] - by Kwarde - 01.11.2010, 16:04
Re: Need Help Guys: [FILTERSCRIPT] - by Dr.Ghost - 01.11.2010, 16:49
Re: Need Help Guys: [FILTERSCRIPT] - by Kwarde - 01.11.2010, 17:13
Re: Need Help Guys: [FILTERSCRIPT] - by alpha500delta - 01.11.2010, 17:16
Re: Need Help Guys: [FILTERSCRIPT] - by Mike_Peterson - 01.11.2010, 17:22
Re: Need Help Guys: [FILTERSCRIPT] - by Dr.Ghost - 01.11.2010, 17:26
Re: Need Help Guys: [FILTERSCRIPT] - by Kwarde - 01.11.2010, 17:47

Forum Jump:


Users browsing this thread: 2 Guest(s)