Jump to content

[Tutorial] Jobul de "Programator" (by ARTIST)


ARTIST

Recommended Posts

V4_Ecw55e_Y84.jpg

 

 

 

Buna ziua stimati membri ai comunitatii SA-MP.RO

Astazi, spre atentia dumneavoastra voi prezenta un tutorial al jobului de Programator, pe care recent l-am elaborat.

Nu este un job complicat , sper sa fie pe placul dumneavoastra.

 

 

5imqr10.png

 

 

redstar.gifet1zga51pf1zr3mbrbfg6auipt4s1qo.png

 

Va puteti angaja in calitate de programator in incinta Primariei din Los Santos.

Odata angajat, va veti indrepta spre cabinetul de alaturi , la dulapul (marcat cu un checkpoint) din care veti lua valiza cu accesoriile necesare pentru serviciu.

Dupa ce veti primi toate cele necesare pentru lucru, veti urca la al 2-lea ataj al Primariei, unde se vor afla numeroase calculatoare (random) ce necesita sa fie reparate.

Sarcina dumneavoastra, e sa va apropiati de calculatorul defect (marcat cu un checkpoint), sa introduceti parola Bazei de Date (un cod din cifre random afisat in dialog), pentru a intra in sistemul de operare a acestuia si apoi sa il reparati.

Salariul il veti primi in functie de numarul de calculatoare reparate, la primul etaj, de unde ati primit valiza cu accesorii (in tutorial e 50$ pentru un calculator reparat).

 

 

 

HEar_R.png

 

 

z_USDn_TQ.png

 

 

sa_mp_000.jpg

sa_mp_003.jpg

sa_mp_004.jpg

sa_mp_005.jpg

sa_mp_006.jpg

sa_mp_007.jpg

sa_mp_008.jpg

sa_mp_009.jpg

sa_mp_010.jpg

sa_mp_011.jpg

 

 

HEar_R.png

 

 

redstar.gifkt4ze551pfosaedrcwog15mopt1s43mqqtozr3jy

La toate new vom adauga:


new ProgPic2;
new ProgPic;

 

 

La public OnPlayerPickUpPickup(playerid, pickupid):


    {
       if(PlayerData[playerid][pJob] == 2) return SendClientMessage(playerid, COLOR_GRAD1, "Sunteti deja angajat ca programator!");
       PlayerData[playerid][pJob] = 2;
       DeletePVar(playerid,"sumcomp");
       DeletePVar(playerid,"idcomp");
       SendClientMessage(playerid, COLOR_WHITE, "Ati fost angajat in calitate de programator.");
       SendClientMessage(playerid, COLOR_BLUE,"Luati toate cele necesare din dulap (marcat pe harta) si urmati instructiunile de mai departe.");
       SetPlayerCheckpoint(playerid,366.9657,216.7312,1008.3828,3.0);
    }
    if(pickupid == ProgPic2)
    {
        if(PlayerData[playerid][pJob] != 2) return SendClientMessage(playerid, COLOR_GREEN, "Nu sunteti programator! Va puteti angaja in Primarie.");
        if(GetPVarInt(playerid,"sumcomp") < 1)
        {
          SendClientMessage(playerid,COLOR_BLUE,"Urcati la al 2-lea etaj pentru a repara calculatoarele (marcate pe harta).");
          SetPlayerAttachedObject(playerid,3,1210,5,0.299999,0.099999,0.000000,0.000000,-83.000000,0.000000,1.000000,1.000000,1.000000);
          RandomComp(playerid);
        }
        else
        {
            GivePlayerMoney(playerid, GetPVarInt(playerid,"sumcomp")*50);
            format(string,sizeof(string), "Ati incheiat ziua de lucru si ati castigat: %i $",GetPVarInt(playerid,"sumcomp")*50);
            SendClientMessage(playerid, COLOR_BLUE, string);
            PlayerData[playerid][pJob] = 0;
            RemovePlayerAttachedObject(playerid,3);
            DeletePVar(playerid,"sumcomp");
            DeletePVar(playerid,"idcomp");
        }
    }
if(pickupid == ProgPic)

 

 

La public OnGameModeInit():


    ProgPic2 = CreatePickup(1210, 23, 366.9657, 216.7312, 1008.3828, -1);
ProgPic = CreatePickup(1239, 23, 366.5819, 159.0445, 1008.3828, -1);

 

 

La public OnPlayerEnterCheckpoint(playerid):


    {
        new passcomp = random(999999);
        SetPVarInt(playerid,"passcomp",passcomp);
        format(string,sizeof(string), "Introduceti parola de verificare: %i",passcomp);
        ShowPlayerDialog(playerid,2933,DIALOG_STYLE_INPUT, "Database Password", string, "Enter", "Exit");
    }
if(PlayerData[playerid][pJob] == 2 && GetPVarInt(playerid,"idcomp") != 0)

 

 

La public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]):


        {
            if(response)
            {
                if(!strlen(inputtext)) return SendClientMessage(playerid,COLOR_RED, "Nu ati introdus parola! Mai incercati inca o data.");
                if(strval(inputtext) == GetPVarInt(playerid,"passcomp"))
                {
                    format(string, sizeof(string), "Parola de verificare %i a fost introdusa corect.", GetPVarInt(playerid,"passcomp"));
                    SendClientMessage(playerid,COLOR_GREEN, string);
                    ApplyAnimation(playerid,"COP_AMBIENT","Copbrowse_in", 4.0, 0, 0, 0, 0, 0);
                    SetPVarInt(playerid,"sumcomp",GetPVarInt(playerid,"sumcomp") + 1);
                    format(string, sizeof(string), "Calculatoare reparate pana acum: %i",GetPVarInt(playerid,"sumcomp"));
                    SendClientMessage(playerid, COLOR_GRAD1, string);
                    RandomComp(playerid);
                    return true;
                }
                else
                {
                    format(string, sizeof(string), "Ati gresit parola! [parola corecta: %i] Mai incercati inca o data.",GetPVarInt(playerid,"passcomp"));
                    SendClientMessage(playerid,COLOR_RED, string);
                    return true;
                }
            }
            else return true;
        }
if(dialogid == 2933)

 

 

Undeva la sfarsitul modului vom adauga:


{
    DisablePlayerCheckpoint(playerid);
    new RandComp = random(13)+1;
    new Float:X, Float:Y, Float:Z;
    switch(RandComp)
    {
    case 1: X = 380.0625, Y = 185.4515, Z = 1014.1875;
    case 2: X = 380.0629, Y = 187.4518, Z = 1014.1875;
    case 3: X = 380.0629, Y = 190.4521, Z = 1014.1875;
    case 4: X = 380.0611, Y = 192.4517, Z = 1014.1875;
    case 5: X = 375.0652, Y = 195.4420, Z = 1014.1875;
    case 6: X = 373.0652, Y = 195.4428, Z = 1014.1875;
    case 7: X = 371.0648, Y = 195.4426, Z = 1014.1875;
    case 8: X = 369.0730, Y = 192.4419, Z = 1014.1875;
    case 9: X = 369.0732, Y = 190.4493, Z = 1014.1875;
    case 10: X = 369.0723, Y = 186.4356, Z = 1014.1875;
    case 11: X = 369.0722, Y = 184.4358, Z = 1014.1875;
    default: X = 369.0730, Y = 182.4439, Z = 1014.1875;
    }
    if(GetPVarInt(playerid, "idcomp") == RandComp) return RandomComp(playerid);
    SetPVarInt(playerid, "idcomp", RandComp);
    SetPlayerCheckpoint(playerid,X,Y,Z,0.2);
    return true;
}
stock RandomComp(playerid)

 

 

kpugnhuupf4y.png

 

 

 

k3o1y5mipt48k5mfqpt1y7diqt4zr551rbagk5uw

 

 

5imqr10.png

Edited by ARTIST
  • Upvote 7

ep41yhufqpagka5wfoornw1wjfjie.png

HTjr_G.png
12975.png
 
Link to comment
Share on other sites

Eu sunt mai chior, unde este linck-ul de download :?

Mereu la tine , n-am vazut unde e link de download lol.

========================================

EDIT: Credeam ca este filescript. orcum frumosc job;)

Bravo pentu munca.

Edited by FlOrINn

:P Respecta ca sa fi respectact :P 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Developer in :

C++,PHP,HTML,CSS,JAVASCRIPT,XML,MYSQL

si ceva  Pawno :)

WebDesign,Photoshop

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

/////////////////////////////////////////////////////////////////////////////////////////

=============================================

Steam ~ Kiburici

=============================================

Link to comment
Share on other sites

Eu sunt mai chior, unde este linck-ul de download :?

Mereu la tine , n-am vazut unde e link de download lol.

========================================

EDIT: Credeam ca este filescript. orcum frumosc job;)

Bravo pentu munca.

E tutorial nu FS ! fi mai atent inainte sa zici ceva

 

 

On : frumos o idee unica!

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.