killing medals script
#10

He means:
pawn Код:
switch( GetPVarInt( killerid, "kills" ) )
{
    case 2: // 2 kills
    {
        // Stuff here
    }
    case 3: // 3 kills
    {
        // stuff here
    }
    // ETC
}
Instead of
pawn Код:
if( GetPVarInt( killerid, "kills" ) == 2 )
{
    // Stuff here
}
if( GetPVarInt( killerid, "kills" ) == 3 )
{
    // Stuff here
}
// ETC
I prefer IFs, I use switch only in dialogs and stuff, since it's just abit faster.
Also, you forgot to put OnPlayerDeath
pawn Код:
SetPVarInt( playerid, "kills", 0 );
So if player dies, his spree gets restarted.

EDIT: Nevermind, you reset it in OnPlayerSpawn..
Reply


Messages In This Thread
killing medals script - by Amine_Mejrhirrou - 25.04.2011, 21:08
Re: killing medals script - by Mean - 25.04.2011, 21:50
Re: killing medals script - by Admigo - 25.04.2011, 21:59
Re: killing medals script - by Mean - 25.04.2011, 22:00
Re: killing medals script - by Admigo - 25.04.2011, 22:06
Re : Re: killing medals script - by Amine_Mejrhirrou - 26.04.2011, 00:21
Re: killing medals script - by Lorenc_ - 26.04.2011, 01:57
Re: killing medals script - by Vince - 26.04.2011, 08:57
Re : Re: killing medals script - by Amine_Mejrhirrou - 26.04.2011, 09:03
Re: killing medals script - by Mean - 26.04.2011, 11:32

Forum Jump:


Users browsing this thread: 1 Guest(s)