CLEO Help Need Help

CLEO related
Status
Not open for further replies.

Rossi

Member
Joined
May 30, 2014
Messages
12
Reaction score
0
Hey, i would like to know the right way to use Actor.GiveWeaponAndAmmo, i tried it different ways but it did not work or how to use 01B2: give_actor 2@ weapon 28 ammo 60
 

not490

Well-known member
Joined
Feb 8, 2014
Messages
453
Reaction score
4
Code:
{$CLEO .cs}
//Credits not490
0000: 'not490'
:not490
wait 100
if and 
0AB0: key_pressed 49
player.Defined($PLAYER_ACTOR) 
else_jump @not490
wait 500
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR,24,500)
jump @not490
 

Rossi

Member
Joined
May 30, 2014
Messages
12
Reaction score
0
If you give me something... test it before... it just gives me an invisibile deagle that when i shoot crashes my game....
 

not490

Well-known member
Joined
Feb 8, 2014
Messages
453
Reaction score
4
Do you have sampfuncs 3.1.2 ? Because that didnt crash me, and ofc i test everytime scripts before i share.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
You need to load the model first.

First, write # and the weapon's name, example #DESERT_EAGLE.
You will see on the right a number, that's the weapon's ID. In this case, it's 348.
So, use the number like this:
Model.Load(348)

now you can use Actor.GiveWeaponAndAmmo without any problems... orr not.

If you use the ID that is shown in Sanny Builder, you will crash!
So, search the weapon's ID you want here: http://wiki.sa-mp.com/wiki/Weapons. In this case it is 24.

Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, 24, 999)

*Legend:
You
Sanny Builder weapon ID
Weapon ID
Its ammo
 

TheZeRots

Expert
Joined
Dec 21, 2013
Messages
1,247
Reaction score
1
But this comes better:
Code:
thread 'NIGGA_WEP' 
jump @GIVE_WEAPON_26 

:GIVE_WEAPON_26
wait 0 
if 
0ADC: test_cheat "GIVEGUN" 
else_jump @GIVE_WEAPON_26 
jump @GIVE_WEAPON_52 

:GIVE_WEAPON_52
wait 0 
Model.Load(#M4)
Model.Load(#SNIPER)
Model.Load(#KNIFECUR)
if 
   Model.Available(#M4)
   Model.Available(#SNIPER)
   Model.Available(#KNIFECUR)
else_jump @GIVE_WEAPON_52 
01B2: give_actor $PLAYER_ACTOR weapon 31 ammo 5000
01B2: give_actor $PLAYER_ACTOR weapon 34 ammo 5000
01B2: give_actor $PLAYER_ACTOR weapon 4 ammo 1
wait 500 
jump @GIVE_WEAPON_26
 
Status
Not open for further replies.
Top