/kill command
#1

When player is in jail his command /kill wouldn't work..

How to do this ?
Reply
#2

Make a global variable called: isJailed[MAX_PLAYERS];
Then add to every command:
If(isJailed[playerid] != 1)
{
// whatever here
}
else
{
SendClientMessage(playerid, -1, "You can't use this command while jailed");
}
Reply
#3

Quote:
Originally Posted by arjanforgames
Посмотреть сообщение
Make a global variable called: isJailed[MAX_PLAYERS];
Then add to every command:
If(isJailed[playerid] != 1)
{
// whatever here
}
else
{
SendClientMessage(playerid, -1, "You can't use this command while jailed");
}
Getting errors.
Reply
#4

Quote:
Originally Posted by Sliceofdeath
Посмотреть сообщение
Getting errors.
If you want people to help you "be specific" on what kind of errors you get from pawn...
Add them to the post...
Reply
#5

You should have a variable some like:
PlayerInfo[playerid][pJailed] if you have godfather... or whatever variable for other gamemodes, something to define if the player is jailed or not 1 means its jailed 0 means he is not.
so you add to /kill
pawn Код:
if(PlayerInfo[playerid][pJailed] == 1
{
SendClientMessage(playerid, COLOR_GREY, "You can't use this command while you are jailed!");
return 1;
}
Reply
#6

Quote:
Originally Posted by Smokeyy
Посмотреть сообщение
You should have a variable some like:
PlayerInfo[playerid][pJailed] if you have godfather... or whatever variable for other gamemodes, something to define if the player is jailed or not 1 means its jailed 0 means he is not.
so you add to /kill
pawn Код:
if(PlayerInfo[playerid][pJailed] == 1
{
SendClientMessage(playerid, COLOR_GREY, "You can't use this command while you are jailed!");
return 1;
}
Yes, you want to use this else they'll just relog to avoid their jail time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)