[FilterScript] Dia das crianзas/Minigame
#1

Oi galera, esse й o meu 1 FS que faзo para o evento dia das crianзas й meio simples mais ta aн :d
Fiz do 0

Код:
#include <a_samp>
#if defined FILTERSCRIPT

public OnFilterScriptExit()
{
	print("\n-------------------------------------------------------------");
	print("                 Minigame descarregado");
	print("-------------------------------------------------------------\n");
	return 1;
}

#else
#endif

//PICKUP'S DO EVENTO NO TOTAL = 24
new
	EventoPickup,
	EventoPickup2,
	EventoPickup3,
	EventoPickup4,
	EventoPickup5,
	EventoPickup6,
	EventoPickup7,
	EventoPickup8,
	EventoPickup9,
	EventoPickup10,
	EventoPickup11,
	EventoPickup12,
	EventoPickup13,
	EventoPickup14,
	EventoPickup15,
	EventoPickup16,
	EventoPickup17,
	EventoPickup18,
	EventoPickup19,
	EventoPickup20,
	EventoPickup21,
	EventoPickup22,
	EventoPickup23,
	EventoPickup24;
	
public OnFilterScriptInit()
{
print("\n-------------------------------------------------------------");
print("                         Minigame carregado");
print("By: ._Razer ");
print("-------------------------------------------------------------\n");

//3D TEXTLABEL
Create3DTextLabel("Objetivo do evento\nProcure por presentes pelo rancho й ganhe recompenзa por isso.",0x0083ADFF,-718.2695,965.6483,12.1328,50,24,0);

//PICKUP'S DO EVENTO
EventoPickup = CreatePickup(19054, 2, -840.3419,1118.3044,29.8419, 24);
EventoPickup2 = CreatePickup(19054, 2, -880.5095,1334.1071,26.1335, 24);
EventoPickup3 = CreatePickup(19054, 2, -718.2695,965.6483,12.1328, 24);
EventoPickup4 = CreatePickup(19054, 2, -810.1018,801.1245,18.0936, 24);
EventoPickup5 = CreatePickup(19054, 2, -881.0496,1334.5405,26.1186, 24);
EventoPickup6 = CreatePickup(19054, 2, -1003.9171,1617.3367,32.4112, 24);
EventoPickup7 = CreatePickup(19054, 2, -1055.8950,1554.3326,39.1442, 24);
EventoPickup8 = CreatePickup(19054, 2, -729.2738,700.8897,11.1303, 24);
EventoPickup9 = CreatePickup(19054, 2, -950.7937,998.3418,23.2815, 24);
EventoPickup10 = CreatePickup(19054, 2, -865.7163,983.2141,22.2771, 24);
EventoPickup11 = CreatePickup(19054, 2, -798.8811,938.8962,-0.6825, 24);
EventoPickup12 = CreatePickup(19054, 2, -826.5522,889.7665,20.8002, 24);
EventoPickup13 = CreatePickup(19054, 2, -735.4982,691.8247,11.8582, 24);
EventoPickup14 = CreatePickup(19054, 2, -807.5048,1093.4156,34.4177, 24);
EventoPickup15 = CreatePickup(19054, 2, -774.6145,1121.2927,45.2282 ,24);
EventoPickup16 = CreatePickup(19054, 2, -866.3885,1157.6340,26.2912 ,24);
EventoPickup17 = CreatePickup(19054, 2, -1267.5446,965.9575,133.0514 ,24);
EventoPickup18 = CreatePickup(19054, 2, -1120.0264,1124.0267,11.8622 ,24);
EventoPickup19 = CreatePickup(19054, 2, -1023.3453,1426.0414,39.6019 ,24);
EventoPickup20 = CreatePickup(19054, 2, -894.3983,1610.7483,25.1735 ,24);
EventoPickup21 = CreatePickup(19054, 2, -773.8418,1436.5110,13.7891 ,24);
EventoPickup22 = CreatePickup(19054, 2, -644.0309,1096.6350,14.8833 ,24);
EventoPickup23 = CreatePickup(19054, 2, -598.9437,957.2907,1.5884 ,24);
EventoPickup24 = CreatePickup(19054, 2, -659.1655,873.5908,0.4232 ,24);
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{

if(pickupid == EventoPickup)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+ 20000$", 6000, 5);
GivePlayerMoney(playerid, 25000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup2)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+90 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 90);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup3)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+14000$", 6000, 5);
GivePlayerMoney(playerid, 14000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup4)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1$", 6000, 5);
GivePlayerMoney(playerid, 1);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup5)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+150000$", 6000, 5);
GivePlayerMoney(playerid, 150000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup6)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+632001$", 6000, 5);
GivePlayerMoney(playerid, 632001);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup7)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1200 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1200);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup8)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup9)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+520000$", 6000, 5);
GivePlayerMoney(playerid, 520000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup10)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1000$", 6000, 5);
GivePlayerMoney(playerid, 1000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup11)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup12)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100000$", 6000, 5);
GivePlayerMoney(playerid, 100000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup13)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+450 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 450);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup14)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+20000$", 6000, 5);
GivePlayerMoney(playerid, 20000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup15)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1200 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1200);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup16)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup17)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+520000$", 6000, 5);
GivePlayerMoney(playerid, 520000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup18)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1000$", 6000, 5);
GivePlayerMoney(playerid, 1000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup19)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup20)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+100000$", 6000, 5);
GivePlayerMoney(playerid, 100000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup21)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+450 score", 6000, 5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 450);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup22)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+20000$", 6000, 5);
GivePlayerMoney(playerid, 20000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup23)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+14000$", 6000, 5);
GivePlayerMoney(playerid, 14000);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

if(pickupid == EventoPickup24)
{
GameTextForPlayer(playerid,"~r~presente:~n~~y~+1$", 6000, 5);
GivePlayerMoney(playerid, 1);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
return 1;
}

return 1;}
Бs pickups, text3d fica no WORLD 24
Nas coordenadas: -706.5253,954.1293,12.4395

Vlw :d
Reply
#2

new
EventoPickup,
EventoPickup2,
EventoPickup3,
EventoPickup4,
EventoPickup5,
EventoPickup6,
EventoPickup7,
EventoPickup8,
EventoPickup9,
EventoPickup10,
EventoPickup11,
EventoPickup12,
EventoPickup13,
EventoPickup14,
EventoPickup15,
EventoPickup16,
EventoPickup17,
EventoPickup18,
EventoPickup19,
EventoPickup20,
EventoPickup21,
EventoPickup22,
EventoPickup23,
EventoPickup24;

Tudo isso acima podia ser reduzido a isso:
new EventoPickup[24];

Mesmo assim, legal
Reply
#3

AHUEAHE vlw
Reply
#4

Sistema legal.. Concordo com o DogeMan, e queria dar minha opniгo !
Da pra melhorar mais um pouco.. como por exemplo, colocar um comando para ativar/desativar essas pickups, pois se seu servidor estiver cheio, terб que colocar o FS, reiniciar, e depois quando acabar terб de reiniciar novamente ??
Reply
#5

/Rcon loadfs Minigame

/Rcon unloadfs Minigame

Mais vlw pela ideia vou fazer um comando pra isso daqui 5 min coloco novo codigo
Reply
#6

Simples , mais ta legalzinho parabens .

@~~DogeMan

ConcordoІ
Reply
#7

@DogeMan

Concordo tambйm!

@TOPIC

Nem sempre o primeiro FS й dos melhores, mas jб й uma grande conquista. Parabйns!
Reply
#8

Fiz modificaзхes no seu FS a fim de praticar otimizaзгo de cуdigos .



Este novo cуdigo deve ser ъtil para estudos :


pawn Код:
#include <a_samp>



//PICKUP'S DO EVENTO NO TOTAL = 24
new EventoPickup[24];



new Float:CoordenadasPickups[24][3] =
{
    {-840.3419, 1118.3044, 29.8419},
    {-880.5095, 1334.1071, 26.1335},
    {-718.2695, 965.6483, 12.1328},
    {-810.1018, 801.1245, 18.0936},
    {-881.0496, 1334.5405, 26.1186},
    {-1003.9171, 1617.3367, 32.4112},
    {-1055.8950, 1554.3326, 39.1442},
    {-729.2738, 700.8897, 11.1303},
    {-950.7937, 998.3418, 23.2815},
    {-865.7163, 983.2141, 22.2771},
    {-798.8811, 938.8962, -0.6825},
    {-826.5522, 889.7665, 20.8002},
    {-735.4982, 691.8247, 11.8582},
    {-807.5048, 1093.4156, 34.4177},
    {-774.6145, 1121.2927, 45.2282},
    {-866.3885, 1157.6340, 26.2912},
    {-1267.5446, 965.9575, 133.0514},
    {-1120.0264, 1124.0267, 11.8622},
    {-1023.3453, 1426.0414, 39.6019},
    {-894.3983, 1610.7483, 25.1735},
    {-773.8418, 1436.5110, 13.7891},
    {-644.0309, 1096.6350, 14.8833},
    {-598.9437, 957.2907, 1.5884},
    {-659.1655, 873.5908, 0.4232}
};



new EventoPremios[24][11] =
{
    {"20000$"},
    {"90 score"},
    {"14000$"},
    {"1$"},
    {"150000$"},
    {"632001$"},
    {"1200 score"},
    {"100 score"},
    {"520000$"},
    {"1000$"},
    {"100 score"},
    {"100000$"},
    {"450 score"},
    {"20000$"},
    {"1200 score"},
    {"100 score"},
    {"520000$"},
    {"1000$"},
    {"100 score"},
    {"100000$"},
    {"450 score"},
    {"20000$"},
    {"14000$"},
    {"1$"}
};



public OnFilterScriptInit()
{
    print("\n-------------------------------------------------------------");
    print("                         Minigame carregado");
    print("By: ._Razer ");
    print("-------------------------------------------------------------\n");
   
    //3D TEXTLABEL
    Create3DTextLabel("Objetivo do evento:\nPasse por presentes que vocк achar e ganharб recompenзas por isso.", 0x0083ADFF, -718.2695, 965.6483, 12.1328, 50.0, 24, 0);

    //PICKUP'S DO EVENTO
    for(new x = 0; x < 24; x++)
    {
        EventoPickup[x] = CreatePickup(19054, 2, CoordenadasPickups[x][0], CoordenadasPickups[x][1], CoordenadasPickups[x][2], 24);
    }
    return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/testarevento", true))
    {
        SetPlayerVirtualWorld(playerid, 24);
        SetPlayerPos(playerid, -700.9950, 959.7983, 12.3534);
        SetPlayerFacingAngle(playerid, 74.3507);
        SetCameraBehindPlayer(playerid);
        return 1;
    }
    return 0;
}



public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new x = 0; x < 24; x++)
    {
        if(pickupid == EventoPickup[x])
        {
            new Premio[30] = "~r~presente:~n~~y~+";
            strcat(Premio, EventoPremios[x]);
            GameTextForPlayer(playerid, Premio, 6000, 5);
            strdel(Premio, 0, 19);
            new TipoPremio = strfind(Premio, " score");
            if(TipoPremio != -1)
            {
                strdel(Premio, TipoPremio, sizeof(Premio));
                SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Premio));
            }
            else
            {
                strdel(Premio, strfind(Premio, "$"), sizeof(Premio));
                GivePlayerMoney(playerid, strval(Premio));
            }
            PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
        }
    }
    return 1;
}



public OnFilterScriptExit()
{
    print("\n-------------------------------------------------------------");
    print("                 Minigame descarregado");
    print("-------------------------------------------------------------\n");
    return 1;
}


Espero ter ajudado .
Reply
#9

Vou deixar uma ideia aqui para quem tem mais tempo , esse msm sistema mas com uma diferenзa , o jogador teria que obter todos as icones para ganhar um mega premio , sempre tem isso no Convoy Trucking , mas sua fs teve a ideia boa mas os codigos deixou a desejar.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)