14.05.2015, 09:21
Its easy if you use this include(it already have this function: GetPlayerSkillLevel(playerid, skill);)
Download "playerfuncs.inc" (link: https://sampforum.blast.hk/showthread.php?tid=573961).
So you can increase the player skill level on every kill with getting the old skill level +
For command part, if you are using zcmd:
Download "playerfuncs.inc" (link: https://sampforum.blast.hk/showthread.php?tid=573961).
So you can increase the player skill level on every kill with getting the old skill level +
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
new skill = 0;
switch(GetPlayerWeapon(killerid))
{
case 22: skill = WEAPONSKILL_PISTOL;
case 23: skill = WEAPONSKILL_PISTOL_SILENCED;
//... add all other types you want
}
SetPlayerSkillLevel(killerid, skill, GetPlayerSkillLevel(killerid, skill) + 10);
}
return 1;
}
pawn Код:
CMD:weaponskills(playerid)
{
new string[144];
format(string, sizeof(string) "Pistol: %i/1000", GetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL));//this is for pistol, it will show the pistol skills in client message form
SendClientMessage(playerid, -1, string);
//...add more if you want
return 1;
}