/kill command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /kill command (
/showthread.php?tid=456534)
/kill command -
Sliceofdeath - 06.08.2013
When player is in jail his command /kill wouldn't work..
How to do this ?
Re: /kill command -
arjanforgames - 06.08.2013
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");
}
Re: /kill command -
Sliceofdeath - 06.08.2013
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.
Re: /kill command -
iNorton - 06.08.2013
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...
Re: /kill command -
Smokeyy - 06.08.2013
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;
}
Re: /kill command -
arjanforgames - 06.08.2013
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.