Filescript help! [+REP]
#4

There pal:
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_players>

#define COLOR_RED 0xff0000a7
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

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

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    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;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buygun", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,160,DIALOG_STYLE_LIST,"Weapon System [By Gregory]","Brass Knuckles\nGolf Club\nNightstick\nKnife\nBaseball Bat\nShovel\nSprayCan\nPool Cue\nKatana\nChainsaw\nDouble-ended Dildo\nDildo\nVibrator\nSilver Vibrator\nFlowers\nCane\nParachute\nTear Gas\n9mm\nSilenced 9mm\nDesert Eagle\nShoutgun\nCombat Shotgun\nMicro SMG/UZI\nMP5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle","Buy","Cancel");
        return 1;
    }
    if (strcmp("/prices", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "___________________________________________________________________________");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}Brass Knuckles ({09FF00}25${FFFFF}) |  Golf Club ({09FF00}50${FFFFF}) | Nightstick ({09FF00}100${FFFFF}) | Knife ({09FF00}200${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}Baseball Bat ({09FF00}150${FFFFF}) | Shovel ({09FF00}100${FFFFF}) | SprayCan ({09FF00}500${FFFFF}) | Pool Cue ({09FF00}30${FFFFF}) | Katana ({09FF00}100${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}Chainsaw ({09FF00}1000${FFFFF}) | Double-ended Dildo ({09FF00}500${FFFFF}) | Dildo ({09FF00}450${FFFFF}) | Vibrator ({09FF00}300${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}Silver Vibrator ({09FF00}350${FFFFF}) | Flowers ({09FF00}10${FFFFF}) | Cane ({09FF00}30${FFFFF}) | Parachute ({09FF00}100${FFFFF}) | Tear Gas ({09FF00}1000${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}9mm ({09FF00}1500${FFFFF}) | Silenced 9mm ({09FF00}1600${FFFFF}) | Desert Eagle ({09FF00}3000${FFFFF}) | Shotgun ({09FF00}2800${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}Combat Shotgun ({09FF00}3500${FFFFF}) | Micro SMG/UZI ({09FF00}2500${FFFFF}) | MP5 ({09FF00}5000${FFFFF}) | AK-47 ({09FF00}4500${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "{FFFFF}M4 ({09FF00}5000${FFFFF}) | Tec-9 ({09FF00}3000${FFFFF}) | Country Rifle ({09FF00}6000${FFFFF}) | Sniper Rifle ({09FF00}7000${FFFFF})");
        SendClientMessage(playerid, COLOR_RED, "________________________________________________________");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 160)
    {
        if(response)
        switch(listitem)
        {
            case 0:
            {
            GivePlayerWeapon(playerid, 1, 1);
            GivePlayerMoney(playerid, -25);
            }

            case 1:
            {
            GivePlayerWeapon(playerid, 2, 1);
            GivePlayerMoney(playerid, -50);
            }

            case 3:
            {
            GivePlayerWeapon(playerid, 3, 1);
            GivePlayerMoney(playerid, -100);
            }

            case 4:
            {
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerMoney(playerid, -200);
            }

            case 5:
            {
            GivePlayerWeapon(playerid, 5, 1);
            GivePlayerMoney(playerid, -150);
            }

            case 6:
            {
            GivePlayerWeapon(playerid, 6, 1);
            GivePlayerMoney(playerid, -100);
            }

            case 7:
            {
            GivePlayerWeapon(playerid, 41, 500);
            GivePlayerMoney(playerid, -500);
            }

            case 8:
            {
            GivePlayerWeapon(playerid, 7, 1);
            GivePlayerMoney(playerid, -30);
            }

            case 9:
            {
            GivePlayerWeapon(playerid, 8, 1);
            GivePlayerMoney(playerid, -100);
            }

            case 10:
            {
            GivePlayerWeapon(playerid, 9, 1);
            GivePlayerMoney(playerid, -1000);
            }

            case 11:
            {
            GivePlayerWeapon(playerid, 10, 1);
            GivePlayerMoney(playerid, -500);
            }

            case 12:
            {
            GivePlayerWeapon(playerid, 11, 1);
            GivePlayerMoney(playerid, -450);
            }

            case 13:
            {
            GivePlayerWeapon(playerid, 12, 1);
            GivePlayerMoney(playerid, -300);
            }

            case 14:
            {
            GivePlayerWeapon(playerid, 13, 1);
            GivePlayerMoney(playerid, -350);
            }

            case 15:
            {
            GivePlayerWeapon(playerid, 14, 1);
            GivePlayerMoney(playerid, -10);
            }

            case 16:
            {
            GivePlayerWeapon(playerid, 15, 1);
            GivePlayerMoney(playerid, -30);
            }

            case 17:
            {
            GivePlayerWeapon(playerid, 46, 1);
            GivePlayerMoney(playerid, -100);
            }

            case 18:
            {
            GivePlayerWeapon(playerid, 17, 500);
            GivePlayerMoney(playerid, -1000);
            }

            case 19:
            {
            GivePlayerWeapon(playerid, 22, 500);
            GivePlayerMoney(playerid, -1500);
            }

            case 20:
            {
            GivePlayerWeapon(playerid, 23, 500);
            GivePlayerMoney(playerid, -1600);
            }

            case 21:
            {
            GivePlayerWeapon(playerid, 24, 500);
            GivePlayerMoney(playerid, -3000);
            }

            case 22:
            {
            GivePlayerWeapon(playerid, 25, 500);
            GivePlayerMoney(playerid, -2800);
            }

            case 23:
            {
            GivePlayerWeapon(playerid, 27, 500);
            GivePlayerMoney(playerid, -3500);
            }

            case 24:
            {
            GivePlayerWeapon(playerid, 28, 500);
            GivePlayerMoney(playerid, -2500);
            }

            case 25:
            {
            GivePlayerWeapon(playerid, 29, 500);
            GivePlayerMoney(playerid, -5000);
            }

            case 26:
            {
            GivePlayerWeapon(playerid, 30, 500);
            GivePlayerMoney(playerid, -4500);
            }

            case 27:
            {
            GivePlayerWeapon(playerid, 31, 500);
            GivePlayerMoney(playerid, -5000);
            }

            case 28:
            {
            GivePlayerWeapon(playerid, 32, 500);
            GivePlayerMoney(playerid, -3000);
            }

            case 29:
            {
            GivePlayerWeapon(playerid, 33, 500);
            GivePlayerMoney(playerid, -6000);
            }

            case 30:
            {
            GivePlayerWeapon(playerid, 34, 500);
            GivePlayerMoney(playerid, -7000);
            }
            }
        return 1;
        }
    return 0;
}
I used to set the rounds of round weapons to 500.
Reply


Messages In This Thread
Filescript help! [+REP] - by Gogorakis - 17.11.2013, 20:08
Re: Filescript help! [+REP] - by Gogorakis - 17.11.2013, 20:22
Re: Filescript help! [+REP] - by StuartD - 17.11.2013, 20:27
Re: Filescript help! [+REP] - by Wizzy951 - 17.11.2013, 20:28
Re: Filescript help! [+REP] - by Gogorakis - 17.11.2013, 20:29
Re: Filescript help! [+REP] - by StuartD - 17.11.2013, 20:31
Re: Filescript help! [+REP] - by iPrivate - 17.11.2013, 20:31
Re: Filescript help! [+REP] - by Wizzy951 - 17.11.2013, 20:32
Re: Filescript help! [+REP] - by Gogorakis - 17.11.2013, 20:37

Forum Jump:


Users browsing this thread: 4 Guest(s)