[Help] /jail - Position Help
#1

Hello,

This is my /jail script,

pawn Код:
if(strcmp(cmd, "/jail", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail");
            return 1;
        }
        giveplayerid = strval(tmp);
        if(JailTime[giveplayerid] > 0 || gTeam[giveplayerid] != 4)
        {
            SendClientMessage(playerid, COLOR_GRAD2, "  That person can't be jailed right now.");
            printf("JailTime[giveplayerid](%d) gTeam[giveplayerid](%d)",JailTime[giveplayerid],gTeam[giveplayerid]);
            return 1;
        }
        if (IsPlayerConnected(giveplayerid))
        {
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if (gTeam[playerid] == TEAM_BLUE)
            {
                if (TestDistance(playerid,giveplayerid,264.395200,77.564040,1001.039000,7))
                {
                    //print("DEBUG Distancetested");
                    new slice = ((PlayerInfo[giveplayerid][pLevel]*deathcost)+(1000)); //1k +your level
                    SetPlayerPos(giveplayerid,264.395200,77.564040,1001.039000);
                    GivePlayerMoney(playerid, slice);
                    GivePlayerMoney(giveplayerid, -slice);
                    PlayJailSound(1165 , 1166, 2000,264.395200, 77.564040, 1001.039000);
                    format(string, sizeof(string), "~r~Suspect ~w~Detained~n~You Get ~g~$%d", slice);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    format(string, sizeof(string), "~r~JAIL~n~~w~You Are fined ~n~~r~$%d", -slice);
                    GameTextForPlayer(giveplayerid, string, 5000, 1);
                    PlayerPlayMusic(playerid);
                    JailTime[giveplayerid] = jailtime;
                    SetPlayerFree(giveplayerid,playerid,"Serving Prison Sentence",0,0);
                    if(FlashTime[giveplayerid] == 0){FlashTime[giveplayerid] = 10;}
                    TogglePlayerControllable(giveplayerid, 1);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "  one of you is to far away from a jail cell!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
                return 1;
            }
        }
        else
        {
            format(string, sizeof(string), "  %d is not an active player.", giveplayerid);
            SendClientMessage(playerid, COLOR_GRAD1, string);
        }
        return 1;
    }
Does anyone has a idea where I can change the pos of where to put people in jail from.
Reply
#2

SetPlayerPos(giveplayerid,264.395200,77.564040,100 1.039000);
...
Reply
#3

It's not about the set it's something with the distance I think.
Because SetPlayer will put the person in the jail..
But I've changed alot of things and after I changed it and jailed someone he was in the middle of nowhere falling to the ground.
I am using PEN:LS must I change something in the scriptfiles?
Reply
#4

Well the test distance makes sure that the player/jailer is in the distance of the jail marker. as for where he goes when he is jailed, you can Ctrl+F the script for the jail coordinates.
Also you may need to set interior id. then the position
Reply
#5

Quote:
Originally Posted by Joeri
It's not about the set it's something with the distance I think.
Because SetPlayer will put the person in the jail..
But I've changed alot of things and after I changed it and jailed someone he was in the middle of nowhere falling to the ground.
I am using PEN:LS must I change something in the scriptfiles?
well in some buildings you will need to change the interior ID as they enter/exit the jail. (In LV Jail I don't think you have to change the world ID)
Reply
#6

rbtujitas.pwn(613) : error 017: undefined symbol "tmp"
rbtujitas.pwn(614) : error 017: undefined symbol "tmp"
rbtujitas.pwn(621) : error 017: undefined symbol "ReturnUser"
rbtujitas.pwn(622) : error 017: undefined symbol "tmp"
rbtujitas.pwn(623) : error 017: undefined symbol "tmp"
rbtujitas.pwn(624) : error 017: undefined symbol "PlayerInfo"
rbtujitas.pwn(624) : warning 215: expression has no effect
rbtujitas.pwn(624) : error 001: expected token: ";", but found "]"
rbtujitas.pwn(624) : error 029: invalid expression, assumed zero
rbtujitas.pwn(624) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Reply
#7

(TestDistance(playerid,giveplayerid,264.395200,77. 564040,1001.039000,7))

To change the arrest location.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)