[FilterScript] Dia das crianзas/Minigame
#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


Messages In This Thread
Dia das crianзas/Minigame - by zqkRazer - 12.10.2014, 13:57
Re: Dia das crianзas/Minigame - by DogeMan - 12.10.2014, 14:02
Re: Dia das crianзas/Minigame - by zqkRazer - 12.10.2014, 14:12
Re: Dia das crianзas/Minigame - by Alwe - 12.10.2014, 14:38
Re: Dia das crianзas/Minigame - by zqkRazer - 12.10.2014, 14:41
Re: Dia das crianзas/Minigame - by Jimmmy - 12.10.2014, 15:00
Re: Dia das crianзas/Minigame - by RiqueP - 12.10.2014, 15:29
Re: Dia das crianзas/Minigame - by rjjj - 12.10.2014, 15:46
Re: Dia das crianзas/Minigame - by Don_Speed - 13.10.2014, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)