Jump to content
  • 0

Ajutor Fish


TheKingFTW15

Question

Buna am nevoie si eu de o indrumare. Vreau sa fac un fish asemanator b-hood unde daca ai vip sa poti pescui 2 pesti. Eu momentan am definit 2 variabile (HaveFish si HaveFish2) si am pus la fish un if. dar la functie ma blochez. 

 

YCMD:fish(playerid, params[], help) {
    if(PlayerInfo[playerid][pJob] != 11) return SCM(playerid, COLOR_GREY, "Nu esti pescar!");
    if(!PlayerToPoint(30.0, playerid, 1233.4323,-2376.9800,8.3145)) return SCM(playerid, COLOR_WHITE, "{00cccc}(Eroare) {ffffff}Nu esti in zona in care poti pescui.");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_WHITE, "{00cccc}(Eroare) {ffffff}Nu poti pescui daca esti intr-un vehicul.");
    if(PlayerInfo[playerid][pVip] == 1) {
        if(HaveFish[playerid] != 0 && HaveFish2[playerid] != 0) return SCM(playerid, -1, "{00cccc}(Job) {ffffff}Ai prins deja un peste. Du-te la un magazin de tip 24/7 pentru a-l vinde.");
    }
    else {
        if(HaveFish[playerid] != 0) return SCM(playerid, -1, "{00cccc}(Job) {ffffff}Ai prins deja un peste. Du-te la un magazin de tip 24/7 pentru a-l vinde.");
    }
    if(StartFish[playerid] == 1) return 1;
    GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~w~ACUM PESCUIESTI...",15000,3);
    SetTimerEx("Fish", 15000, 0, "d", playerid);
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid, "SAMP", "FishingIdle", 3.0,1,1,0,0,0);
    SetPlayerAttachedObject(playerid, 0, 18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
    StartFish[playerid] = 1;
    Freezed[playerid] = 1;
    return 1;
}

function Fish(playerid) {
    new x, string[180];
    if(!IsPlayerConnected(playerid)) return 1;
    if(PlayerInfo[playerid][pJob] == 11) {
        RemovePlayerAttachedObject(playerid, 0);
        x = 30000 + random(1000) + GetPlayerSkill(playerid)*500;
        if(PlayerInfo[playerid][pPremiumAccount] == 1) x += x/2;
        new rar = random(500);
        if(rar >= 490 && rar < 495) {
            x += 30000 + random(5000);
            format(string, sizeof(string), "{00cccc}(Job) {ffffff}Ai pescuit un peste rar care valoreaza $%s!", FormatNumber(x));
            SCM(playerid, COLOR_WHITE, string);
            SCM(playerid, -1, "Pentru a vinde pestele, trebuie sa mergi intr-un 24/7. (/gps)");
            format(string, sizeof(string), "* %s a prins un peste rar ce valoreaza $%s.", GetName(playerid), FormatNumber(x));
            NearMessage(playerid, COLOR_YELLOW, string);
        }
        else if(rar >= 495) {
            format(string, sizeof(string), "{00cccc}(Job) {ffffff}Ai pescuit un peste foarte rar care valoreaza $%s!", FormatNumber(x));
            SCM(playerid, COLOR_WHITE, string);
            SCM(playerid, -1, "Pentru a vinde pestele, trebuie sa mergi intr-un 24/7. (/gps)");
            format(string, sizeof(string), "* %s a prins un peste foarte rar care valoreaza %s.", GetName(playerid), FormatNumber(x));
            NearMessage(playerid, COLOR_YELLOW, string);

        }
        else {
            format(string, sizeof(string), "{00cccc}(Job) {ffffff}Ai pescuit un peste normal care valoreaza $%s!", FormatNumber(x));
            SCM(playerid, COLOR_WHITE, string);
            SCM(playerid, -1, "Pentru a vinde pestele, trebuie sa mergi intr-un 24/7. (/gps)");
            format(string, sizeof(string), "* %s a prins un peste normal ce valoreaza $%s.", GetName(playerid), FormatNumber(x));
            NearMessage(playerid, COLOR_YELLOW, string);
        }

        HaveFish[playerid] = x;
        StartFish[playerid] = 0;
        TogglePlayerControllable(playerid, 1);
        Freezed[playerid] = 0;
    }
    return 1;
}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

×   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.