Jump to content

Question

Posted (edited)

Salut. Cand ma duc in fata bancii si dau /rob ( mai am pe cineva in masina, trebuie sa fim 2 pentru a da rob ) primesc asta : You need to be minimum 1 players with level 5 or higher and 10 rob points. Ceea ce in gamemode pare a fi ok.

Quote

CMD:rob(playerid, params[])
{
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(GetPlayerState(playerid) != 2 || GetVehicleType(GetPlayerVehicleID(playerid)) != 1) return SendClientMessage(playerid, COLOR_ERROR, "You need to be driver of a car.");
    if(!IsPlayerInRangeOfPoint(playerid, 10.0, 1462.7577,-1022.5885,23.8281)) return SendClientMessage(playerid, COLOR_ERROR, "You need to be near bank.");
    if(IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You are a cop, you can't rob the bank.");
    if(PlayerInfo[playerid][pWanted] > 0) return SendClientMessage(playerid, COLOR_ERROR, "Ai deja un nivel de cautare ridicat, nu poti sa jefuiesti banca!");
    if(BankOccupied == 1) return SendClientMessage(playerid, COLOR_ERROR, "Exista deja un rob in desfasurare!");
    new robbers = 0, robbersn = 0;
    foreach(new i : Player)
    {
        if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
         if(PlayerInfo[pRob] == 10 && PlayerInfo[pLevel] > 4 && !IsACop(playerid)) robbers ++;
        else robbersn ++;
    }
    if(robbers < 2) return SendClientMessage(playerid, COLOR_ERROR, "You need to be minimum 1 players with level 5 or higher and 10 rob points.");
    if(robbersn > 0) return SendClientMessage(playerid, COLOR_ERROR, "You have a passenger who dosen't fulfill the rob requirements.");
    {
        {
            RobLeader[playerid] = 1;
            new randoms = random(sizeof(ROBCheck));
            foreach(new i : Player)
            {
                if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) if(PlayerInfo[pRob] == 10 && PlayerInfo[pLevel] > 4)
                {
                    InRob = 1;
                    SetPlayerPos(i, ROBCheck[randoms][0], ROBCheck[randoms][1], ROBCheck[randoms][2]);
                    TogglePlayerControllableEx(i, 0);
                    SetTimerEx("RobUnfreeze", 2000, 0, "i", i);
                    SendClientMessage(i, COLOR_YELLOW, "* Liderul grupului trebuie sa planteze explozibilul pe usa seifului!");
                    SendClientMessage(i, COLOR_YELLOW, "* In 30 secunde autoritatile vor fii anuntate, grabiti-va!");
                    PlayerInfo[pRob] -= 10;
                    Update(i, pRobx);
                    
                }
            }
            UseFind[playerid] = 0;
            IsTowing[playerid] = 0;
            BankOccupied = 1;
            RobSec = 30;
            SetPlayerPos(playerid, 2942.8855,-1804.7043,1178.4606);
            TogglePlayerControllableEx(playerid, 0);
            SetTimerEx("unfr", 1500, 0, "i", playerid);
            CP[playerid] = 200;
            SetPlayerCheckpoint(playerid, 2942.6709,-1783.2755,1178.5803, 2.0);
            SendClientMessage(playerid,COLOR_AC,"Du-te linga usa seifului pentru a planta bomba.");
            RobFailTimer = SetTimerEx("FailedRob", 30000, 0, "d", playerid);
        }    
    }
    return 1;
}

Si mai este o mica eroare , din moment ce eu pun egalitatea aici 

Quote

if(robbers < 2) return SendClientMessage(playerid, COLOR_ERROR, "You need to be minimum 1 players with level 5 or higher and 10 rob points.");

if(robbers == 2) return SendClientMessage(playerid, COLOR_ERROR, "You need to be minimum 1 players with level 5 or higher and 10 rob points.");

Se planteaza o bomba pe usa seifului, dupa care bubuie si usa nu se distruge pentru a trece  la urmatorul checkpoint. Si mai am : 

Quote

else if(CP[playerid] == 210)
    {
        DestroyDynamicObject(BankVault2);
        BankVault = CreateDynamicObject(2634, 2942.74438, -1782.29590, 1179.16016,   0.00000, 0.00000, 179.93997);
        DisablePlayerCheckpoint(playerid);
        CP[playerid] = 220;
        RobSec = 0;
        KillTimer(RobFailTimer);
        new randoms = random(sizeof(ROBHide));
        SetPlayerCheckpoint(playerid, ROBHide[randoms][0], ROBHide[randoms][1], ROBHide[randoms][2], 6.0);
        foreach(new i : Player)
        {
            if(InRob != -1)
            {
                SetPlayerCriminal(i,999,"Robbing the bank", 6);
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "* Liderul grupului este nevoit sa gaseasca ascunzatoarea pentru bani!");
                SendClientMessage(i, COLOR_SYN, "* Daca liderul moare, jaful esueaza si nimeni nu primeste partea sa de bani!");
                SetPlayerPos(i, 1462.7577,-1022.5885,23.8281);
                SetPlayerAttachedObject(i, 4, 1550, 1, 0.1, -0.3, 0, 0, 40, 0, 1, 1, 1);
            }
        }
    }
    else if(CP[playerid] == 220)
    {
        DisablePlayerCheckpoint(playerid);
        CP[playerid] = 0;
        RobLeader[playerid] = -1;
        RobReward = 20000 + KilledCops*500 + TimeReward;
        new FinalRobReward = RobReward+1;
        
        foreach(new i : Player)
        {
            if(InRob != -1)
            {
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "");
                SendClientMessage(i, COLOR_SYN, "* Banii au fost ascunsi cu succes. Autoritatile sunt pe urmele voastre!");
                format(gString, sizeof(gString), "* Fiecare membru al jafului a fost recompensat cu %s", FormatNumber(FinalRobReward));
                SendClientMessage(i, COLOR_SYN, gString);
                GivePlayerCash(i, FinalRobReward);
                if(IsPlayerAttachedObjectSlotUsed(i, 4)) RemovePlayerAttachedObject(i, 4);
                InRob = -1;
            }
        }
        TimeReward = 0;
        KilledCops = 0;
        BankOccupied = 0;
        RobReward = 0;
    }

Astept un raspuns de la voi. Poate ma puteti ajuta.

Edited by Andreys.

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.