16.04.2012, 16:27
pawn Код:
new playerOnDuty[MAX_PLAYERS]; // global outside any callback
// Connect initializes variable:
OnPlayerConnect(playerid) {
playerOnDuty[playerid] = 0;
}
// Command sets player OnDuty
OnPlayerCommandText() {
if(!strcmp("/onduty", cmdtext)) {
playerOnDuty[playerid] = 1;
return 1;
}
// in a command that can only be used while on duty:
if(!strcmp("/kick", cmdtext))
{
if(playerOnDuty[playerid] == 1) // can use
else SendClientMessage(playerid, COLOR_GRAD1, "You are not Admin On Duty!");
}
}