Auto send cmd when changing weapon

Status
Not open for further replies.

Rodrico

Member
Joined
Jan 5, 2014
Messages
24
Reaction score
0
Code:
* Name of the mod (if the mod doesn't exist, you don't have to tell one): AutoCMDsend
 * Where you saw it (not the server, we mean if you saw any videos/screenshots about it or not): There was an auto /me when changing weapon thread in request archive section
 * What do you want (the most important part, explain this carefully): So basically when I change my weapon state from fist to deagle, it would send a cmd saying /me pulls his Colt 1911 out of his waist as he then flicks the switch off, taking a steady aim position
 * Details (add more details to your request): If you could make another weapon binds when changing weapons, it would be great
 * On/off key (specify it): when switching or scrolling weapons.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
158
here it is meine freunde, it won't post the message until 0.7 of a second passes since you changed your weapon last time. This way you won't spam while choosing your weapon. You can adjust the desired delay by changing 32@ > 700 in the code. It requires sampfuncs, I hope it will work but no guarantee, it wasn't tested

Edit: replaced the file (because of the uppercase formatting, now it should be alright)
 

Attachments

  • rpGunMessage.cs
    19.7 KB · Views: 40

Naganaga

Active member
Joined
Apr 13, 2013
Messages
103
Reaction score
0
Works perfectly but how to remove the capslock of it?
It is all in capslock IG.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
158
hmm I have no idea what could be the reason because it's normal in the code... When you get "/me hides his weapon" message is it also with all capital letters?
 

Naganaga

Active member
Joined
Apr 13, 2013
Messages
103
Reaction score
0
Nah I fixed it bro, it was my Sannybuilder.
Tools -> Formats, I had uppercase and all that.
 

Naganaga

Active member
Joined
Apr 13, 2013
Messages
103
Reaction score
0
No problem, ignore my PM I will redownload it.

Possible to make it toggleable for me? ''/personalkeybinder''
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
158
here it is  :me gusta:
Code:
{$CLEO}
0000: NOP
 
repeat
wait 50
until 0AFA: is_samp_structures_available

0B34: samp register_client_command "personalkeybinder" to_label @Activation


0470: 1@ = actor $PLAYER_ACTOR current_weapon
2@ = false

while true
wait 0
    if 31@ == 1
    then
    0470: 0@ = actor $PLAYER_ACTOR current_weapon
        if 003B:   0@ == 1@  // (int)
        then     
        else
        0085: 1@ = 0@ // (int)
        32@ = 0
        2@ = true
        end
    
        if and
        2@ == true
        32@ > 700
        then
        2@ = false
            if and
            3@ == true //if the last weapon was actually a gun (not binoculars, flowers, extinguisher etc)
            0@ == 0
            then
            3@ = false
            0AF9: samp say_msg "/me hides his weapon." 
            end
        0AB1: call_scm_func @Message 1 0@ 3@        
        end
    //wait 10 //in case if it's lagging
    end
end

:Activation
wait 0
0B12: 31@ = 31@ XOR 1
samp.CmdRet()


//0AB1: call_scm_func @name 0
:Message 
if 0@ == 24 //weapon check
then
0AF9: samp say_msg "/me pulls out his desert eagle."  //message
0AB2: ret 1 true
end

//to add more checks just put here something like this:
//if 0@ == <WEAPON ID>
//then
//0AF9: samp say_msg "/me pulls out his new weapon."
//0AB2: ret 1 true
//end 

if 0@ == 31
then
0AF9: samp say_msg "/me pulls out his M4 assault rifle."
0AB2: ret 1 true
end 

if 0@ == 30
then
0AF9: samp say_msg "/me pulls out his AK47 assault rifle."
0AB2: ret 1 true
end

if 0@ == 34
then
0AF9: samp say_msg "/me pulls out his sniper rifle."
0AB2: ret 1 true
end

if or
0@ == 25
0@ == 26
0@ == 27
then
0AF9: samp say_msg "/me pulls out his shotgun."
0AB2: ret 1 true
end

if or 
0@ == 28
0@ == 29
0@ == 32
then
0AF9: samp say_msg "/me pulls out his submachine gun."
0AB2: ret 1 true
end

if 0@ == 33 
then
0AF9: samp say_msg "/me pulls out his rifle."
0AB2: ret 1 true
end

if or 
0@ == 22
0@ == 23
then
0AF9: samp say_msg "/me pulls out his 9mm pistol."
0AB2: ret 1 true
end

0AB2: ret 1 false
 
Status
Not open for further replies.
Top