Jump to content
  • 0
Sign in to follow this  
Venox

Ajutor - Job (backpack)

Question

Salut cum as putea sa fac si eu daca ai backpack sa poti da de 2 ori fish si sa dai de 2 ori work doar la jobul farmer?

Gamemode BURNED

Mersi!

Edited by Venox

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

In general pui o restrictie la /work respectiv la /fish.

If(PlayerInfo[playerid][pBackpack] != 0)

{

if(PlayerInfo[playerid][JobsFacuteAzi] > 2) return SCM(playerid, COLOR_ERROR, "Nu poti face mai mult de 2 misiuni daca ai ghiozdanul pus!");

 //comanda ta aici

}

else

{

//comanda ta aici

}

PlayerInfo[playerid][JobsFacuteAzi]  variabila asta verifica cate jobs ai facut cu backpack on. O pui fie sa se reseteze la onplayerconnect, fie o salvezi si in baza de date si o resetezi la o ora anume/player login. Nu cred ca exista o asemenea variabila pe burned, deci va trebui sa faci una noua.

PlayerInfo[playerid][JobsFacuteAzi] ++; //asta pui la farmer/fish la finalul jobului.

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

CMD:fish(playerid, params[]) {
    if(PlayerInfo[playerid][pJob] != 11) return SCM(playerid, COLOR_GREY, "Nu esti pescar!");
    if(!PlayerToPoint(125.0, playerid,  2294.1890, 533.5755, 1.8655)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu esti intr-o locatie buna!");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
    if(HaveFish[playerid] != 0) return SCM(playerid, -1, "Ai prins deja un peste! Du-te si vinde-l la unul dintre magazinele 24/7.");
    if(StartFish[playerid] == 1) return 1;
    if(Undita[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai o undita!");
    if(Momeala[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai momeala!");
    GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~w~YOU'RE FISHING NOW...",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;
    Momeala[playerid] --;
    return 1;
}

function Fish(playerid) {
    new x, string[180];
    if(!IsPlayerConnected(playerid)) return 1;
    if(PlayerInfo[playerid][pJob] == 11) {
        StartFish[playerid] = 0;
        TogglePlayerControllable(playerid, 1);
        Freezed[playerid] = 0;        
        RemovePlayerAttachedObject(playerid, 0);
        if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti pescui dintr-un vehicul!");            
        
        x = 7 + random(13);
        new rar = random(500);
        new need = 15*GetPlayerSkill(playerid);
        if(rar >= 495) HaveFish[playerid] = 0;
        else HaveFish[playerid] += x;
        
        if(rar >= 495) {    
            format(string, sizeof(string), "* %s a prins un rechin.", GetName(playerid), FormatNumber(x));
            NearMessage(playerid, COLOR_PURPLE, string);    
            SetPlayerHealth(playerid, 0);
            x = 0;
        }
        else {
            if(HaveFish[playerid] < need) {
                format(string, sizeof(string), "Pentru a putea vinde pestii, iti mai trebuie %d kg.", need-HaveFish[playerid]);
                SCM(playerid, -1, string);
            }
            format(string, sizeof(string), "* %s a prins un peste de %d kg.", GetName(playerid), x);
            NearMessage(playerid, COLOR_PURPLE, string);                
        }    
        if(PlayerInfo[playerid][pMember] == 0) {
            for(new m; m < 2; m++) {
                if(PlayerInfo[playerid][pDailyMission][m] == 15 || PlayerInfo[playerid][pDailyMission][m] == 16) CheckMission(playerid, m);
            }                    
        }
        for(new m; m < 2; m++) {
            if(PlayerInfo[playerid][pDailyMission][m] == 2) CheckMission(playerid, m);
        }        
    }
    return 1;
}

 

ASTA ESTE COMANDA

Share this post


Link to post
Share on other sites
  • 0
CMD:fish(playerid, params[]) {
    if(PlayerInfo[playerid][pJob] != 11) return SCM(playerid, COLOR_GREY, "Nu esti pescar!");
    if(!PlayerToPoint(125.0, playerid,  2294.1890, 533.5755, 1.8655)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu esti intr-o locatie buna!");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
    if(HaveFish[playerid] != 0) return SCM(playerid, -1, "Ai prins deja un peste! Du-te si vinde-l la unul dintre magazinele 24/7.");
    if(StartFish[playerid] == 1) return 1;
    if(Undita[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai o undita!");
    if(Momeala[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai momeala!");
    if(PlayerInfo[playerid][pBackpack] == 1)
    {
        if(PlayerInfo[playerid][pBackpackJobs] > 2) return SCM(playerid, COLOR_LGREEN, "Nu poti face mai mult de 2 misiuni cu ghiozdanul activ!")
        GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~w~YOU'RE FISHING NOW...",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;
        Momeala[playerid] --;
    }
    else
    {
        GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~w~YOU'RE FISHING NOW...",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;
        Momeala[playerid] --;
    }
    return 1;
}

function Fish(playerid) {
    new x, string[180];
    if(!IsPlayerConnected(playerid)) return 1;
    if(PlayerInfo[playerid][pJob] == 11) {
        StartFish[playerid] = 0;
        TogglePlayerControllable(playerid, 1);
        Freezed[playerid] = 0;        
        RemovePlayerAttachedObject(playerid, 0);
        if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti pescui dintr-un vehicul!");            
        
        x = 7 + random(13);
        new rar = random(500);
        new need = 15*GetPlayerSkill(playerid);
        if(rar >= 495) HaveFish[playerid] = 0;
        else HaveFish[playerid] += x;
        
        if(rar >= 495) {    
            format(string, sizeof(string), "* %s a prins un rechin.", GetName(playerid), FormatNumber(x));
            NearMessage(playerid, COLOR_PURPLE, string);    
            SetPlayerHealth(playerid, 0);
            x = 0;
        }
        else {
            if(HaveFish[playerid] < need) {
                format(string, sizeof(string), "Pentru a putea vinde pestii, iti mai trebuie %d kg.", need-HaveFish[playerid]);
                SCM(playerid, -1, string);
            }
            format(string, sizeof(string), "* %s a prins un peste de %d kg.", GetName(playerid), x);
            NearMessage(playerid, COLOR_PURPLE, string);                
        }    
        if(PlayerInfo[playerid][pMember] == 0) {
            for(new m; m < 2; m++) {
                if(PlayerInfo[playerid][pDailyMission][m] == 15 || PlayerInfo[playerid][pDailyMission][m] == 16) CheckMission(playerid, m);
            }                    
        }
        for(new m; m < 2; m++) {
            if(PlayerInfo[playerid][pDailyMission][m] == 2) CheckMission(playerid, m);
        }
        if(PlayerInfo[playerid][pBackpack] == 1)
            PlayerInfo[playerid][pBackpackJobs] ++;
    }
    return 1;
}

 

Trebuie sa definesti variabila pbackpackjobs. Du-te la enum playerinfo si adauga pBackpackJobs.

1. Variabila va trebui resetata dupa cum am spus. Ori pui intr-un timer ca la ora x sa se reseteze la toti playeri variabila(din mysql). Aceasta varianta iti permite ca jucatorul acela sa poata face 2 misiuni cu ghiozdan activ/zi.

2. Variabila va trebui resetata la onplayerconnect. Aceasta varianta iti permite ca jucatorul acela sa poata face 2 misiuni cu ghiozdan activ dupa fiecare conectare pe server.

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.