Got one error on a return statement
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
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:
PHP код:
switch (GetPlayerWeapon(killerid))
{
    case 
38:
    {
        
SendClientMessage(killeridCOLOR_GREEN"[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: MINIGUN");
        
SetTimerEx("PlayerBan"1000false"i"killerid);
    }
    case 
35:
    {
        
SendClientMessage(killeridCOLOR_GREEN"[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: RPG");
        
SetTimerEx("PlayerBan"1000false"i"killerid);
    }
    case 
36:
    {
        
SendClientMessage(killeridCOLOR_GREEN"[VANILLA-ANTICHEATS] YOU HAVE BEEN AUTO-BANNED FOR REASON: HEAT SEEKER");
        
SetTimerEx("PlayerBan"1000false"i"killerid);
    }
}
// somewhere else (outside of any function):
forward PlayerBan(playerid);
public 
PlayerBan(playerid)
{
    
Ban(playerid);
    return 
1;

It woks gr8 man
Reply


Messages In This Thread
Got one error on a return statement - by VanillaRain - 03.06.2015, 21:40
Re: Got one error on a return statement - by SickAttack - 03.06.2015, 21:47
Re: Got one error on a return statement - by VanillaRain - 03.06.2015, 21:49
Re: Got one error on a return statement - by VanillaRain - 04.06.2015, 09:24
Re: Got one error on a return statement - by Konstantinos - 04.06.2015, 10:44
Re: Got one error on a return statement - by VanillaRain - 04.06.2015, 11:30
Re: Got one error on a return statement - by Vince - 04.06.2015, 11:35

Forum Jump:


Users browsing this thread: 1 Guest(s)