SA-MP Forums Archive
Colt 45 held with both hands - 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: Colt 45 held with both hands (/showthread.php?tid=505391)



Colt 45 held with both hands - Escapist - 08.04.2014

Hey,

I noticed that in GTA SA singleplayer, cops hold their Colt 45 with both hands. Would it be possible to script this on SAMP?

I'm asking because you can either have dual C45 or one C45 singlehanded, but I don't know if it's possible to script so our player hold the C45 with both hands.

Thanks!


Re: Colt 45 held with both hands - AndySedeyn - 08.04.2014

What you have to do is simply change the SkillLevel of a certain player.
Maybe you should try to make a command to start with..

ZCMD
pawn Code:
CMD:skill(playerid, params[])
{
    SetPlayerSkillLevel(playerid, 0, 5); // The 0 here stand for the Skill: WEAPONSKILL_PISTOL
    return 1;
}
Strcmp
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/skill", true) == 0)
    {
        SetPlayerSkillLevel(playerid, 0, 5);
        return 1;
    }
    return 0;
}
These are the ID's of the Weapon skills:
pawn 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
The format of the function: SetPlayerSkillLevel is:
Code:
SetPlayerSkillLevel(playerid, ID_WEAPONSKILL, Skill_level);



Re: Colt 45 held with both hands - Escapist - 08.04.2014

I might be wrong but with this the player will have only one C45 - which is good - but he will hold it with only one hand.

What I want to know is if it is possible to hold one C45 with both hands. Basically, if the player can hold a C45 like he holds a Desert Eagle.

Thanks for the help though, appreciated!


Re: Colt 45 held with both hands - AndySedeyn - 08.04.2014

Quote:
Originally Posted by Escapist
View Post
I might be wrong but with this the player will have only one C45 - which is good - but he will hold it with only one hand.

What I want to know is if it is possible to hold one C45 with both hands. Basically, if the player can hold a C45 like he holds a Desert Eagle.

Thanks for the help though, appreciated!
Ah, that's a misunderstanding by me. My apologizes.
I know that there's an animation to hold any weapon like a deagle but that's just an animation.

But, erm-- I don't know really. I'm sorry.


Re: Colt 45 held with both hands - Ari - 08.04.2014

pawn Code:
CMD:setskill(playerid, params[])
{
    new iSkill, iLevel;
    if(ssccanf(params, "ii", iSkill, iLevel)) SendClientMessage(playerid, COL_GREY, "USAGE: /setskill [SKILL ID] [LEVEL]");
    else {
        SetPlayerSkillLevel(playerid, iSkill, iLevel);
    }
    return 1;
}

CMD:weapon(playerid, params[])
{
    new iWepID, iAmmo;
    if(sscanf(params, "ii", iWepID, iAmmo)) SendClientMessage(playerid, COL_GREY, "USAGE: /(w)eapon [ID] [AMMO]");
    else {
        GivePlayerWeapon(playerid, iWepID, iAmmo);
    }
    return 1;
}
It isn't possible to make them hold a Colt 45 with both hands, sorry.

Unless you check when they switch to that weapon ID and set their animation ect.


Re: Colt 45 held with both hands - Escapist - 08.04.2014

@Bible: No problem, thanks for your help!

@Ari: Alright that's what I thought but I wanted to make sure. The animationg thing won't be convenient so I guess I'll just let it as it is. Thanks!


Re: Colt 45 held with both hands - KhaledElkhourashi - 08.04.2014

Maybe I got it wrong & maybe I got it right, well I'll say what I have.
First of all, GTA have an weapon skills system, maybe if you was playing GTA offline you can know it as well as SAMP giving you the feature to set/change the skills of any player, skills includes that Colt45 can be holded in both hands, Tec9 as well as Uzi search in the wiki for SetPlayerSkills, also Bible explained it well. That's the first, the second, if you mean that you want the Colt45 shot and aim like the deagle weapon it's unfortunate to say that it's impossible, it's not a mistake in SAMP nor GTA, it's the weapon feature that you can't change it, these things ain't ambiguous you can search too.

-KhaledElkhourashi


Re: Colt 45 held with both hands - Escapist - 08.04.2014

Yes, I didn't explain myself clearly enough.

I didn't wanto to know if we can hold two C45 as I know we can, I wanted to know if we could hold one C45 with both hands like the Desert Eagle. I wondered if it was possible because cops in the singleplayer do hold one C45 with both hands.

Well, thanks for your help too!

I think this can be locked, I got the answer.