04.06.2015, 10:44
You should use brackets, with your current code it takes only the Ban line with the if statement and the message will be sent it gets executed before the ban line.
Though you have to delay the kick/ban to show the messages so:
Though you have to delay the kick/ban to show the messages so:
PHP код:
switch (GetPlayerWeapon(killerid))
{
case 38:
{
SendClientMessage(killerid, COLOR_GREEN, "[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: MINIGUN");
SetTimerEx("PlayerBan", 1000, false, "i", killerid);
}
case 35:
{
SendClientMessage(killerid, COLOR_GREEN, "[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: RPG");
SetTimerEx("PlayerBan", 1000, false, "i", killerid);
}
case 36:
{
SendClientMessage(killerid, COLOR_GREEN, "[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: HEAT SEEKER");
SetTimerEx("PlayerBan", 1000, false, "i", killerid);
}
}
// somewhere else (outside of any function):
forward PlayerBan(playerid);
public PlayerBan(playerid)
{
Ban(playerid);
return 1;
}