unjail
#7

The problem is that you are declaring the id of the player you used the command on after using it to validate whether that player is in jail or not (sscanf).

Also, make that variable a boolean.
pawn Code:
new bool:sJailed[MAX_PLAYERS] = false;
pawn Code:
// When you jail someone:
sJailed[lookupid] = true;
pawn Code:
// When you un-jail someone:
sJailed[lookupid] = false;
pawn Code:
// To validate whether a player is jailed or not:
// For accessibility:
#define function%0(%1) forward%0(%1); public%0(%1)

// Function:
function bool:IsPlayerJailed(playerid) return sJailed[playerid];
pawn Code:
When checking if the player is in jail:
if(IsPlayerJailed(lookupid))
pawn Code:
When checking if the player is not in jail:
if(!IsPlayerJailed(lookupid))
Reply


Messages In This Thread
unjail - by Glossy42O - 25.07.2015, 13:00
AW: unjail - by Mencent - 25.07.2015, 13:07
Re: AW: unjail - by MBilal - 25.07.2015, 13:14
Re: unjail - by xVIP3Rx - 25.07.2015, 14:31
AW: unjail - by Mencent - 25.07.2015, 16:01
Re: unjail - by gurmani11 - 25.07.2015, 16:17
Re: unjail - by SickAttack - 25.07.2015, 16:29
Re: unjail - by TenTen - 25.07.2015, 16:47

Forum Jump:


Users browsing this thread: 1 Guest(s)