SA-MP Forums Archive
*** I can't name topics well! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: *** I can't name topics well! (/showthread.php?tid=389126)



*** I can't name topics well! - Deron_Green - 31.10.2012

Is there a way to make SetPlayerSkillLevel add weapon levels to what the player alreadly has? like if the player has a Sawnoff skill level of 200 it can add 200 and make it 400.


Re: Question - tyler12 - 31.10.2012

SetPlayerSkillLevel(playerid,skill,level);

Skills
0 - WEAPONSKILL_PISTOL
1 - WEAPONSKILL_PISTOL_SILENCED
2 - WEAPONSKILL_DESERT_EAGLE
3 - WEAPONSKILL_SHOTGUN
4 - WEAPONSKILL_SAWNOFF_SHOTGUN
5 - WEAPONSKILL_SPAS12_SHOTGUN
6 - WEAPONSKILL_MICRO_UZI
7 - WEAPONSKILL_MP5
8 - WEAPONSKILL_AK47
9 - WEAPONSKILL_M4
10 - WEAPONSKILL_SNIPERRIFLE

Level
The skill level to set for that weapon, ranging from 0 to 999. (A level out of range will max it out)


Re: Question - Deron_Green - 31.10.2012

Yes i know that and knew that Before that does not anwser my question that i asked


Re: Question - [D]ry[D]esert - 31.10.2012

Is this what you mean what you mean ?
pawn Код:
enum pWeapons
{
SawnOff
//and others weapons name here
};
new WeaponSelect[pWeapons];
and here is the command using ZCMD and sscanf.
pawn Код:
CMD:sawnoff(playerid, params[])
{
new amount;
new giveplayerid;
if (sscanf(params, "ui", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /sawnoff<playerid/name> <amount>");
SetPlayerSkillLevel(giveplayerid,WEAPONSKILL_SAWNOFF_SHOTGUN,WeaponSelect[SawnOff]+ amount);
return 1;
}



Re: Question - Deron_Green - 01.11.2012

Thanks i understand it now