[Tutorial] Double Handed Weapons (SetPlayerSkillLevel)
#1

Well there was couple of people asking how to make the person get double handed weapons like sawn-offs etc..

Start:

Start of all u should find that in your Game Mod Or FS

pawn Code:
public OnPlayerSpawn(playerid)
Well there is alot of weapons that can be double handed we will give examble

pawn Code:
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
That is the normal player skill it will be one handed thats the worst skill level while

pawn Code:
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 800);
If u made it like this it will make the shoot accurancy better and aiming etc...

While

pawn Code:
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
That is the double handed on every weapon .

While all the code should be

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
    //This will make them use Double-handed sawnoff shotguns.
    return 1;
}
and easily that is the code for the double handed weapons

pawn Code:
SetPlayerSkillLevel(playerid,weapon,999);
And by the way i got more easier way to make it for you to make all weapons double handed

they are
Code:
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
so to make it more easy just make this

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
}
return 1;
Credits:

some things learned from here https://sampwiki.blast.hk/wiki/SetPlayerSkillLevel

and the rest is me
Hope u learned
i now its kinda explained in wiki but i did it here step by step
and please nice comments or don't

if u want it to change to single handed weapon just change 999 to 0
Reply
#2

Uhm, doesn't everyone get the maximum skill level by default?
Reply
#3

Quote:
Originally Posted by Vince
View Post
Uhm, doesn't everyone get the maximum skill level by default?
I think yes, it gives.
Reply
#4

It is indeed on max by default, so this is obselete. You should edit the tutorial to single handed weapons.
Reply
#5

well every gamemod i see is only set as 0 not all gamemodes with level 999

and thanks for your comments
Reply
#6

Quote:
Originally Posted by Omar55555
View Post
u should find that in your Game Mod Not FS
Why that? That function can be used in filterscripts too.
Reply
#7

Thank you for informing me {edited}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)