[Ajuda] SetPlayerPos
#1

Como colocar mais que 1 SetPlayerPos num comando?

ou seja eu tenho 14 coordenadas random:

pawn Код:
RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2], RandomAPrison[rand][3], RandomAPrison[rand][4], RandomAPrison[rand][5], RandomAPrison[rand][6], RandomAPrison[rand][7], RandomAPrison[rand][8], RandomAPrison[rand][9], RandomAPrison[rand][10], RandomAPrison[rand][11], RandomAPrison[rand][12], RandomAPrison[rand][13]
So posso colocar 3 Randoms num setplayerpos:

pawn Код:
SetPlayerPos(playerb, RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2]);
como colocar mais setplayerpos com + randoms neste comando?

pawn Код:
CMD:arrest(playerid, params[])
{
    new rand = random(sizeof(RandomAPrison));
    new playerb, time, string[128], fine;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
    if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(!IsPlayerNearArrestPoint(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the arrest point.");
    if(sscanf(params, "uis[64]", playerb, time, fine)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /arrest [playerid] [minutes] [price]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(fine <=0 || fine > 5000)return SendClientMessage(playerid, COLOR_GREY, "Invalid money amount(0-5000).");
    if(!PlayerInfo[playerb][pWanted]) return SendClientMessage(playerid, COLOR_GREY, "Player is not wanted.");
    if(IsACop(playerb) && IsFBI(playerb) && IsARES(playerb)) return SendClientMessage(playerid, COLOR_GREY, "You can't arrest an BCPD Officer.");
    if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
    format(string, sizeof(string), "Local Prison: %s has been arrested by %s.", RPN(playerb), RPN(playerid));
    foreach(Player, i)
    {
        if(IsACop(i) || IsFBI(i) || IsARES(i))
        {
        SendClientMessage(i, COLOR_BLUE, string);
        }
    }
    SetPlayerColor(playerb, TRANSPARENT_ORANGE);
    PlayerInfo[playerb][pArrested] ++;
    PlayerInfo[playerb][pPrison] = 2;
    PlayerInfo[playerb][pPrisonTime] = time*60;
    GiveDodMoney(playerb, -fine);
    ClearDodWantedLevels(playerb);
    SetPlayerInterior(playerb, 0);
    SetPlayerVirtualWorld(playerb, 0);
    SetPlayerPos(playerb, RandomAPrison[rand][0], RandomAPrison[rand][1], RandomAPrison[rand][2]);
    SetPlayerFacingAngle(playerb, 90.0);
    TogglePlayerControllable(playerb, 0);
    SetTimerEx("EnterExitTimer", 5000, false, "i", playerb);
    SetCameraBehindPlayer(playerb);
    format(string, sizeof(string), " You have been arrested by an officer for %d minutes (%d seconds) and fined $%d", PlayerInfo[playerb][pPrisonTime]/60, PlayerInfo[playerb][pPrisonTime], fine);
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
    RemovePlayerAttachedObject(playerb, 0);
    SetPlayerSpecialAction(playerb, SPECIAL_ACTION_NONE);
    // Clearing robbery
    if(BankRobber[playerb])
    {
        new Rob = BankRobber[playerb]-1;
        DisablePlayerCheckpoint(playerb);
        BankRobbersCount --;
        format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
        DeliverMoney[playerb] = 0;
        //
        foreach(Player, i)
        {
            if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
            {
                if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
                else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
                else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
                else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
                else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
            }
        }
        format(string, sizeof(string), "** %s has been arrested and has failed the robbery. **", RPN(playerb));
        SendRobberyMessage(COLOR_LIGHTRED, string);
        SendCopMessage(COLOR_LIGHTRED, string);
        BankRobber[playerb] = 0;
        if(BankRobbersCount == 0)
        {
            TextDrawHideForAll(Textdraw0);
            TextDrawHideForAll(Textdraw1);
            TextDrawHideForAll(Textdraw2);
            TextDrawHideForAll(Textdraw3);
            TextDrawHideForAll(Textdraw4);
            TextDrawHideForAll(Textdraw5);
//            BankRobbery = 0;
            RobberyStarted = 0;
            TotalRobbers = 0;
            new copsonline;
            foreach(Player, i)
            {
                if(IsACop(i) || IsFBI(i) || IsARES(i)) copsonline++;
            }
            foreach(Player, i)
            {
                if(IsACop(i) || IsFBI(i) || IsARES(i))
                {
                    new Saved = (TotalRobbers*50000-(TotalStolen*50000));
                    format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
                    SendClientMessage(i, COLOR_LIME, string);
                }
            }
  }
    }
    return 1;
}
Reply


Messages In This Thread
SetPlayerPos - by MorreJaa - 25.02.2014, 20:59
Re: SetPlayerPos - by PT - 25.02.2014, 21:04
Re: SetPlayerPos - by MorreJaa - 25.02.2014, 21:41
Re: SetPlayerPos - by PT - 25.02.2014, 21:47
Re: SetPlayerPos - by MorreJaa - 25.02.2014, 22:24
Re: SetPlayerPos - by davi54723 - 26.02.2014, 01:25
Re: SetPlayerPos - by MorreJaa - 26.02.2014, 10:21
Re: SetPlayerPos - by rjjj - 26.02.2014, 12:20
Re: SetPlayerPos - by MorreJaa - 26.02.2014, 12:43
Re: SetPlayerPos - by DannielCooper - 26.02.2014, 13:08

Forum Jump:


Users browsing this thread: 5 Guest(s)