Help with weapon skill
#1

Hi all, can someone tell me how to make skill for weapon or tell me where i made a mistake, when someone kill a player to get 10+ skill for deagle example.
Код:
if(killerid != INVALID_PLAYER_ID)
{
PlayerInfo[killerid][pDesert] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, PlayerInfo[playerid][pDesert]);
PlayerInfo[killerid][pShotgun] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, PlayerInfo[playerid][pShotgun]);
PlayerInfo[killerid][pCombat] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, PlayerInfo[playerid][pCombat]);
PlayerInfo[killerid][pMP5] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, PlayerInfo[playerid][pMP5]);
PlayerInfo[killerid][pAK47] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, PlayerInfo[playerid][pAK47]);
PlayerInfo[killerid][pM4] += 10, SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, PlayerInfo[playerid][pM4]);
}
Reply
#2

BUMP HELP PLS
Reply
#3

Just look for the death reason (weaponid), then increase the skills for that weapon.

Ex:
PHP код:
if(reason == 24)
{
     
PlayerInfo[killerid][pDesert] += 10SetPlayerSkillLevel(playeridWEAPONSKILL_DESERT_EAGLEPlayerInfo[playerid][pDesert]);

Reply
#4

Can you explain a little bit better please.?
Reply
#5

Just create a variable where you store player's weapon skill and increase it when they kill someone with that weapon. For example a variable called DeagleSkill for each player and when player kills someone with a deagle you add 10 to DeagleSkill and set player's weapon skill to the current one. Just like the guy above replied. You can use per-player variables (they are slower than normal variables though) or create an array as well.
Reply
#6

I found a solution. Lock this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)