Jump to content

Recommended Posts

Posted (edited)

Salut , am o mica problema la comanda /arrest, am incercat in toate felurile s-o rezolv si n-am reusit.

Daca ma puteti ajuta sa fac in asa fel incat cand scriu /arrest la Jail , sa aresteze acel player doar daca este langa mine. Ca , comanda e facuta fara acel "if" , daca dau /arrest il aresteaza pe player si daca este in orasul celalalt, eu doar dand /arrest
 

Daca aveti nevoie de altceva inafara de comanda dati reply.

Spoiler

CMD:arrest(playerid, params[])
{
    new id, sendername[64], giveplayer[64], string[256], bail, bailprice, time;
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 2)
        {
            if(sscanf(params, "u", id))
            {
                SendClientMessage(playerid, COLOR_WHITE, "{CCFF99}Syntax:{FFFFFF} /arrest [PlayerID/PartOfName]");
                return 1;
            }
            if(id != INVALID_PLAYER_ID)
            {
                if(!PlayerToPoint(5.6, playerid, 1525.7203,-1677.9719,5.8906) && !ProxDetectorS(6.1, playerid, id)) return SCM(playerid, COLOR_WHITE, "Nu esti langa Jail sau jucatorul ales nu este langa acesta!");
                if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_WHITE, "Trebuie sa fii politist On-Duty!");
                if(id == playerid) return SCM(playerid, COLOR_WHITE, "This player is offline!");
                if(id == playerid) return SCM(playerid, COLOR_WHITE, "This player is offline!");
                else if(WantedLevel[id] == 1)
                {
                    bail = 10000;
                    bailprice = 100000;
                    time = 1;
                }
                else if(WantedLevel[id] == 2)
                {
                    bail = 20000;
                    bailprice = 200000;
                    time = 2;
                }
                else if(WantedLevel[id] == 3)
                {
                    bail = 30000;
                    bailprice = 300000;
                    time = 3;
                }
                else
                {
                    SCM(playerid, COLOR_WHITE, "Acest player nu are WANTED sau nu are drept de predare!");
                    return 1;
                }
                GetPlayerName(playerid, sendername, 64);
                GetPlayerName(id, giveplayer, 64);
                PlayerInfo[id][pJailTime] = time * 60;
                PlayerInfo[id][pJailed] = 1;
                WantedLevel[id] = 0;
                SetPlayerWantedLevel(id, 0);
                GivePlayerMoney(id, -bail);
                SpawnPlayer(id);
                if(PlayerInfo[playerid][pMember]== 1 || PlayerInfo[playerid][pLeader]== 1)
                {
                    format(string, sizeof(string), "<< Ofiter-ul %s a arestat suspectul %s pentru %d secunde (%s). Cautiune: %s >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice) );
                    OOCNews(COLOR_LIGHTRED, string);
                }
                else if(PlayerInfo[playerid][pMember]== 2 || PlayerInfo[playerid][pLeader]== 2)
                {
                    format(string, sizeof(string), "<< Agentul Fbi %s a arestat suspectul %s pentru %d secunde (%s). Cautiune: %s  >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice));
                    OOCNews(COLOR_LIGHTRED, string);
                }
                else if(PlayerInfo[playerid][pMember]== 3 || PlayerInfo[playerid][pLeader]== 3)
                {
                    format(string, sizeof(string), "<< Soldatul %s a arestat suspectul %s pentru %d secunde ($%s). Cautiune: $%s  >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice));
                    OOCNews(COLOR_LIGHTRED, string);
                }
            }
            else return SCM(playerid, COLOR_WHITE, "This player is offline!");
        }
        else return SCM(playerid, COLOR_WHITE, "Nu esti autorizat pentru a folosi aceasta comanda!");
    }
    return 1;
}

 

EDIT: Am vazut ca exista asta :

Dar cum fac ca playerul cu wanted sa poata fii arestat doar daca este langa jail/mine.

Spoiler

if(!PlayerToPoint(5.6, playerid, 1525.7203,-1677.9719,5.8906) && !ProxDetectorS(6.1, playerid, id)) return SCM(playerid, COLOR_WHITE, "Nu esti langa Jail sau jucatorul ales nu este langa acesta!");

 

Edited by LorD.
EDIT
Posted

Boss,daca nu stii la ce ma refer , taci. Comanda merge perfect , doar ca atunci cand dau /arrest BoBo  (Ex) si el e in SF , eu sunt in parcare LSPD unde este jail-ul, eu il pot aresta.
Asa ca te rog eu taci si nu mai pune comentarii doar sa ai tu posturi in plus.

Eu m-am referit ca vreau sa ma ajutati ca atunci cand sa dau /arrest sa nu pot sa-l arestez pe player decat daca e langa mine,nu la 1000km distanta.

Posted (edited)
new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

if(IsPlayerInRangeOfPoint(id, 4, x, y, z)) return SendClientMessage(playerid, -1, "Playerul nu este langa tine!");

Have fun.

Edited by xpLode

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.