12.03.2014, 00:32
In your code, there is no "else" statement.
I hope this will give some insights.
You could also do this:
pawn Код:
// Check if the player is connected
if (IsPlayerConnected(playerid))
{
// The player is connected, now check if he is a cop
if (IsACop(playerid))
{
// Here the player is connected AND he's a cop, now we need to check if he's also an admin
if (PlayerInfo[playerid][pRank] < 5)
{
// Code here to execute: the player is connected, he's a cop AND also is an admin
}
else
{
// The player is connected, AND he's a cop, but he's not an admin
}
}
else
{
// The player is connected, but he's not a cop
}
}
else
{
// The player is not connected
}
You could also do this:
pawn Код:
// If the player is NOT connected, exit the function
if (IsPlayerConnected(playerid) == 0) return 1;
// Here the player is connected, check if he's a cop now and exit the function if he's NOT a cop
if (IsACop(playerid) == 0) return 1;
// Here the player is connected AND a cop, now check if he's an admin (if not, exit the function)
if (PlayerInfo[playerid][pRank] < 5) return 1;
// Here the player is connected, he's a cop AND he's an admin, so execute the code for your pm system

