Зачем столько понтов:
pawn Код:
new InValid_Reason[256 char]={0, ...};
public OnFilterScriptInit() {
InValid_Reason{19}=1;
InValid_Reason{20}=1;
InValid_Reason{21}=1;
InValid_Reason{48}=1;
InValid_Reason{52}=1;
return 1;
}
А если добавить макрос, то ещё и выглядеть будет лучше:
pawn Код:
#define IsReasonInvalid(%0) InValid_Reason{%0}
new InValid_Reason[256 char]={0, ...};
public OnFilterScriptInit() {
InValid_Reason{19}=1;
InValid_Reason{20}=1;
InValid_Reason{21}=1;
InValid_Reason{48}=1;
InValid_Reason{52}=1;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid == INVALID_PLAYER_ID) return 0;//Неверный пакет
if(playerid == killerid) return Kick(playerid);//Убил сам себя
if(IsReasonInvalid(reason)) return Kick(playerid);//Неверная причина смерти
return 1;
}