Prison disable TELES [+REP]
#1

Hey all! I made a little Jail here. OnPlayerDeath - SetPlayerPos(killerid,1760.0499,-1538.4115,9.3113); --(the jail)
But they can teleport out.. And I have to add something on my teles :

if(isplayerinrangeofpoint, 1760.0499,-1538.4115,9.3113); or i dont know. you know what im trying to say?
I need help so they cant teleport if they r in that jail.. atleast 30 metres around the target.. then it will say
SendClientMessage(playerid, GREEN," .:: You are JAILED and your teleports have been disabled! ::.");

Need Help

+REP if helped
Reply
#2

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
Hey all! I made a little Jail here. OnPlayerDeath - SetPlayerPos(killerid,1760.0499,-1538.4115,9.3113); --(the jail)
But they can teleport out.. And I have to add something on my teles :

if(isplayerinrangeofpoint, 1760.0499,-1538.4115,9.3113); or i dont know. you know what im trying to say?
I need help so they cant teleport if they r in that jail.. atleast 30 metres around the target.. then it will say
SendClientMessage(playerid, GREEN," .:: You are JAILED and your teleports have been disabled! ::.");

Need Help

+REP if helped
I know you are trying to restrict the teleports for the prisoner right? if so:-

pawn Код:
new isJailed[MAX_PLAYERS]; // at top

//On player Dis connect and onplayerconnect
isJailed[playerid] = 0;

// on the Jail command or onplayerdeath as you like
isJailed[playerid] = 1;

// now if you want to disable tele's you could add this line to the command you want disable for the command or if you're using strcmp commands you could do something like this:-

if(isJailed[playerid] == 1) return SendClientMessage(playerid, -1, "You can't teleport you are a prisoner");
Feel free to ask me if there's something you don't know

-FalconX
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(killerid != INVALID_PLAYER_ID)
  {
         SetPlayerPos(killerid,1760.0499,-1538.4115,9.3113);
         SetPVarInt(killerid,"Jailed",true);
         //You can set a timer here too , to release the player from jail
  }
}

public OnPlayerCommandText(playerid,cmdtext[])
{
if(GetPVarInt(playerid,"Jailed")) return SendClientMessage(playerid,0xFFFFFFFF," -Error- You cant use commands in jail");
}
//Edit: too late^^
Reply
#4

Yea falcon that will work , imsure! thanks anywayz, but it isnt a cmd. Its OnPlayerDeath, they get jailed in my custom jail.
Ima try HusSens script , thanks both of you! rep
Reply
#5

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
Yea falcon that will work , imsure! thanks anywayz, but it isnt a cmd. Its OnPlayerDeath, they get jailed in my custom jail.
Ima try HusSens script , thanks both of you! rep
It's alright, I edited my post.

-FalconX
Reply
#6

i think it would be better if you create a variable for that, like this:
pawn Код:
new IsInJail[MAX_PLAYERS];
your command for jail or wutever:
pawn Код:
IsInJail[playerid] = 1;
in your onplayercommandperformed callback(if you have it in a jail command, else tell me how you have it:
pawn Код:
if(IsInJail[playerid] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "ERROR: you cant teleport when your in jail!");
}
that should do it i think

EDIT: lool when i started writing this there wasnt reply, anyways i see you got more help
Reply
#7

Yea thanks everyone! Im trying Falcon's script now
Reply
#8

HM.. when I wrote /SF, i teled to another place? and when i did a wrong cmd like /hsdhshdshd I teleported there too.. what i've done wrong?

My GM

http://pastebin.com/JTKT3EDt
Reply
#9

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
Yea thanks everyone! Im trying Falcon's script now
I always try to make script very very easy and ofcourse easier to understand for people like you, you might use Pvars but you will not know what it is in future.

edit: use

pawn Код:
* * * * * * * * if(isJailed[playerid] == 1) return SendClientMessage(playerid, -1, ".:: You can't Teleport! You are JAILED! ::.");
In public OnPlayerCommandText in beginning

-FalconX
Reply
#10

niels's script didn'r work.. it says "ERROR: You cant tele while JAILED" and thats correct, but u can still tele.. wtf. Falcon, can u edit Niels's Script please? ima give u another rep for that anywayz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)