Jump to content

Question

Posted

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;
}

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.