SA-MP Forums Archive
SetPlayerSkillLevel Help ! - 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: SetPlayerSkillLevel Help ! (/showthread.php?tid=368889)



SetPlayerSkillLevel Help ! - CROSS_Hunter - 14.08.2012

Problem:

As i scripted it it has to change the skill level of the player when he reaches 4500 score like instead of wielding 1 handed pistol he wields 2 when he reaches 4500 score so i made it but it always applies at all scores less than 4500 and more than 4500 while it has to be like i said

My Code
pawn Код:
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 4499)
    {
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
        return 1;
    }
if(GetPlayerScore(playerid) >= 4500)
    {
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 2);
        return 1;
    }
My Code is under:
pawn Код:
public OnPlayerSpawn(playerid)
{
    return 1;
}
Fast Help Please !



Re: SetPlayerSkillLevel Help ! - CROSS_Hunter - 14.08.2012

Help Heree?


Re: SetPlayerSkillLevel Help ! - Kindred - 14.08.2012

06:52 PM

07:19 PM

Stop bumping, you obviously cannot wait worth shit. I want to see how you are at school.

"WHEN THE FUCK DO WE GET OUR HOMEWORK?" - You.


Re: SetPlayerSkillLevel Help ! - CROSS_Hunter - 14.08.2012

Quote:
Originally Posted by Kindred
Посмотреть сообщение
06:52 PM

07:19 PM

Stop bumping, you obviously cannot wait worth shit. I want to see how you are at school.

"WHEN THE FUCK DO WE GET OUR HOMEWORK?" - You.
Better Post a useful thing? than saying shit? and second time be polite


Re: SetPlayerSkillLevel Help ! - Kathleen - 14.08.2012

pawn Код:
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 4499)
    {
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
        return 1;
    }
if(GetPlayerScore(playerid) >= 4500)
    {
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_MICRO_UZI, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
        return 1;
    }
// Skill Level 999 is Dual Weapon skill
// Skill Level 1 is normal ;')
Laalal just easy xd


Re: SetPlayerSkillLevel Help ! - Mauzen - 15.08.2012

Explanation: The skill levels range from 0-999, where 0 is the worst skill. To use two weapons the skill needs to be maxed out (999) just like in single player.


Re: SetPlayerSkillLevel Help ! - CROSS_Hunter - 15.08.2012

Quote:
Originally Posted by Kathleen
Посмотреть сообщение
pawn Код:
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 4499)
    {
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 2);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
        return 1;
    }
if(GetPlayerScore(playerid) >= 4500)
    {
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_MICRO_UZI, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
        return 1;
    }
// Skill Level 999 is Dual Weapon skill
// Skill Level 1 is normal ;')
Laalal just easy xd
Facing another problem..

which is that becuz i put it under onplayerspawn so in my GM the coommand need to check whether ur spawned or not so onplayerspawn there the variable isplayerspawned=1 so when i put this code above it it buggs it so when ever i type a command it says i am not spawned so any help?


Re: SetPlayerSkillLevel Help ! - Kathleen - 15.08.2012

Try to put it under
"public OnPlayerConnect(playerid)"


Re: SetPlayerSkillLevel Help ! - CROSS_Hunter - 15.08.2012

Quote:
Originally Posted by Kathleen
Посмотреть сообщение
Try to put it under
"public OnPlayerConnect(playerid)"
@Kathleen Now it doesnt work completely either by haing score less than 4500 or having more than 4500 !! please help?