Question about /ajail and /unajail
#1

I want to disable commands and teleports if someone is ajailed. How to do that?
Reply
#2

Not sure but i'll make a example:
pawn Код:
//on top
new pJailed[MAX_PLAYERS] = 0;

//at the commands:

if(pJailed[playerid] == 1) return SendClientMessage(playerid, Color,"Hi there, you can't use commands because you are jailed!");
When you jailed someone you do pJailed[playerid] = 1;
Reply
#3

Quote:
Originally Posted by FuTuRe`
Not sure but i'll make a example:
pawn Код:
//on top
new pJailed[MAX_PLAYERS] = 0;

//at the commands:

if(pJailed[playerid] == 1) return SendClientMessage(playerid, Color,"Hi there, you can't use commands because you are jailed!");
When you jailed someone you do pJailed[playerid] = 1;
Is this also for teleports?
Reply
#4

just at the lines you don't want them to teleport or do something put that
Код:
if(pJailed[playerid] == 1) return SendClientMessage(playerid, Color,"Hi there, you can't use commands because you are jailed!");
Reply
#5

Quote:
Originally Posted by FuTuRe`
just at the lines you don't want them to teleport or do something put that
Код:
if(pJailed[playerid] == 1) return SendClientMessage(playerid, Color,"Hi there, you can't use commands because you are jailed!");
But, what if I have commands in an other filterscript then the script where /ajail is ?
Reply
#6

use
Код:
CallRemoteFunction
https://sampwiki.blast.hk/wiki/CallRemoteFunction
Reply
#7

Quote:
Originally Posted by FuTuRe`
If you are free, can you make the CallRemoteFunction also for me?
I am a beginner, and don't understand such things
Reply
#8

The script where you have commands / teleports and such.
pawn Код:
forward namez(playerid);
public namez(playerid)
{
  pJailed[playerid] = 1;
  return 1;
}
Other file:
pawn Код:
CallRemoteFunction("namez", "d", playerid);
/// Not sure if it works, just try :P
Reply
#9

Quote:
Originally Posted by MrDeGekkerd
Quote:
Originally Posted by FuTuRe`
If you are free, can you make the CallRemoteFunction also for me?
I am a beginner, and don't understand such things
Believe me. If other gonna give you all finish scripts you will never learn it.
Try on your own pls.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)