23.03.2011, 02:52
Increasing their skill level by 10 each time won't show immediate affect each time, so it will take time to get a higher level. Example of how this could be worked is shown below:
Of course, you will need to create the M4_SKILL variable for each player, like so:
Remember to also reset the skill level to 0 after the player connects to the server,
pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
if( reason == 31 ) // M4 weapon ID
{
SetPlayerSkillLevel( killerid, WEAPONSKILL_M4, M4_SKILL[ killerid ] + 10 );
M4_SKILL[ killerid ] += 10;
SendClientMessage( killerid, 0x00FF00FF, "Upgraded your M4 skill. Keep practicing!" );
}
return 1;
}
pawn Код:
new M4_SKILL[ MAX_PLAYERS ];
pawn Код:
public OnPlayerConnect( playerid )
{
M4_SKILL[ playerid ] = 0;
return 1;
}