NEED A SCRIPT WHICH WILL DISABLE ALL COMMANDS, WHEN YOUR IN JAIL?
#1

please help, i have a jail system, if your in dept at bank time, you go to jail for 3mins
how do i stop all cmds?
Reply
#2

you would need to add in a variable to let the script know you are in jail
Reply
#3

can you type me the code, im a BIG noob
Reply
#4

Hi there,

To make that, you must return a true value when you're in jail, like that:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(IsInJail(playerid)) // Variable here.
    return 1;

  // Your commands here

  return 0;
}
Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
Reply
#5

Quote:
Originally Posted by [SAP
Francis ]
Hi there,

To make that, you must return a true value when you're in jail, like that:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(IsInJail(playerid)) // Variable here.
    return 1;

  // Your commands here

  return 0;
}
Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
What do i put as the variable?
Reply
#6

Quote:
Originally Posted by aspire5630
Quote:
Originally Posted by [SAP
Francis ]
Hi there,

To make that, you must return a true value when you're in jail, like that:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(IsInJail(playerid)) // Variable here.
    return 1;

  // Your commands here

  return 0;
}
Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
What do i put as the variable?
Hi there,

When jailing the player, you should set a variable like "Jailed[playerid]" to true or to 1, as 1 is the numerical value of true. Then you would replace "IsInJail(playerid)" by "Jailed[playerid]".

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
Reply
#7

Quote:
Originally Posted by [SAP
Francis ]
Quote:
Originally Posted by aspire5630
Quote:
Originally Posted by [SAP
Francis ]
Hi there,

To make that, you must return a true value when you're in jail, like that:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(IsInJail(playerid)) 1
    return 1;

  // Your commands here

  return 0;
}
Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
What do i put as the variable?
Hi there,

When jailing the player, you should set a variable like "Jailed[playerid]" to true or to 1, as 1 is the numerical value of true. Then you would replace "IsInJail(playerid)" by "Jailed[playerid]".

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
soo i put it like that?
Reply
#8

Hi there,

No, just change the "IsInJail(playerid)" by "InJail[playerid]". Then, in the /jail command, you will have to do "InJail[jailedid] = 1;".

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
Reply
#9

This at the top

Код:
new IsJailed[MAX_PLAYERS];
Add this to your jail command, be warned, yours may not be giveplayername, it may be pname or something,.

Код:
IsJailed[giveplayerid] = 1;
Unjailll...

Код:
IsJailed[giveplayerid] = 0;
Then under oncommand etxt add this

Код:
if(IsJailed[playerid] == 1)
{
return 1;
}
Reply
#10

Quote:
Originally Posted by NeRoSiS
This at the top

Код:
new IsJailed[MAX_PLAYERS];
Add this to your jail command, be warned, yours may not be giveplayername, it may be pname or something,.

Код:
IsJailed[giveplayerid] = 1;
Unjailll...

Код:
IsJailed[giveplayerid] = 0;
Then under oncommand etxt add this

Код:
if(IsJailed[playerid] == 1)
{
return 1;
}
this is the code i have

Код:
new Jailed[MAX_PLAYERS];


public OnPlayerSpawn(playerid)
{
	if(Jailed[playerid] == 1)
	{
	  SetPlayerPos(playerid, ...); // Enter your jail co ords here
	}
	return 1;
}

public Timer(playerid)
{
	SendClientMessageToAll(COLOR_YELLOW, "Please Visit us here at, Kontrol-Gaming.co.cc"); // Color can be edited, Look at top for the colors.
	SendClientMessageToAll(COLOR_YELLOW, " Please remember to report any bugs you may find, /Bug <Message>");

	for(new a=0; a<MAX_PLAYERS; a++)
  {
		if(GetPlayerMoney(a) < 0)
		{
		  SetPlayerPos(playerid, ...); // Enter you jail co ords here
		  Jailed[a] = 1;
		  SetTimerEx("UnJailTimer", 80000, 0, "d", a); // I think 80000 milliseconds is 3 mins, Correct it if its wrong
		}
		GivePlayerMoney(a, 1000);
	}
	SendClientMessageToAll(COLOR_LIGHTGREEN, "You've recieved playing money **$1000**!");
}

public UnJailTimer(playerid)
{
	Jailed[playerid] = 0;
	return 1;
}
Reply
#11

Quote:
Originally Posted by NeRoSiS
This at the top

Код:
new IsJailed[MAX_PLAYERS];
Add this to your jail command, be warned, yours may not be giveplayername, it may be pname or something,.

Код:
IsJailed[giveplayerid] = 1;
Unjailll...

Код:
IsJailed[giveplayerid] = 0;
Then under oncommand etxt add this

Код:
if(IsJailed[playerid] == 1)
{
return 1;
}
can u explain where i need to put them
Reply
#12

Hi there,

Please stop double-posting and use the EDIT button, which is located on the right side of all of your posts. It prevents the topic from being bumped up.

And he all explained how to make it work, you must also learn how to create basic scripts, I recommend this.

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)