Help Weapon model loading.

ZyZ.MaxiM

Active member
Joined
Nov 14, 2022
Messages
50
Solutions
2
Reaction score
1
I need some help regarding on how to load gun models, i made a cleo in sanny builder that gives me a weapon of my choice, but the mod won`t load the gun models on the majority of the guns, and on some guns, the player freezes when i try to shoot.
here is the code:

{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

if and
0AB0: 90
0AB0: 82
then
0AC6: 0@ = label @label offset
0B3B: samp show_dialog id 1000 caption "TEST" text 0@ button_1 "CLOSE" button_2 "CLOSE" style 2
wait 1500
end

if
0B3C: samp is_dialog_responded id 1000 button 2@ list_item 3@ input_text 0
then

if and
2@ == 1
3@ == 0
then
01B2: give_actor $Player_ACTOR weapon 1 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Brass Knuckels~R~!" time 1000
end

if and
2@ == 1
3@ == 1
then
01B2: give_actor $Player_ACTOR weapon 2 ammo 60 // Load the weapon model before using tis
printf "~R~I gave you the ~B~Golf Club~R~!" time 1000
end

if and
2@ == 1
3@ == 2
then
01B2: give_actor $Player_ACTOR weapon 3 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Night Stick~R~!" time 1000
end

if and
2@ == 1
3@ == 3
then
01B2: give_actor $Player_ACTOR weapon 4 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Knife~R~!" time 1000
end

if and
2@ == 1
3@ == 4
then
01B2: give_actor $Player_ACTOR weapon 5 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Baseball Bat~R~!" time 1000
end

if and
2@ == 1
3@ == 5
then
01B2: give_actor $Player_ACTOR weapon 6 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Shovel~R~!" time 1000
end

if and
2@ == 1
3@ == 6
then
01B2: give_actor $Player_ACTOR weapon 7 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Pool Cue~R~!" time 1000
end

if and
2@ == 1
3@ == 7
then
01B2: give_actor $Player_ACTOR weapon 8 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Katana~R~!" time 1000
end

if and
2@ == 1
3@ == 8
then
01B2: give_actor $Player_ACTOR weapon 9 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Chainsaw~R~!" time 1000
end

if and
2@ == 1
3@ == 9
then
01B2: give_actor $Player_ACTOR weapon 16 ammo 999 // Load the weapon model before using this
printf "~R~I gave you ~B~Grenades~R~!" time 1000
end

if and
2@ == 1
3@ == 10
then
01B2: give_actor $Player_ACTOR weapon 17 ammo 999 // Load the weapon model before using this
printf "~R~I gave you ~B~Tear-Gas Grenades~R~!" time 1000
end

if and
2@ == 1
3@ == 11
then
01B2: give_actor $Player_ACTOR weapon 18 ammo 999 // Load the weapon model before using this
printf "~R~I gave you ~B~Molotov~R~!" time 1000
end

if and
2@ == 1
3@ == 12
then
01B2: give_actor $Player_ACTOR weapon 22 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Colt-45 Pistol~R~!" time 1000
end

if and
2@ == 1
3@ == 13
then
01B2: give_actor $Player_ACTOR weapon 23 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Silenced Pistol~R~!" time 1000
end

if and
2@ == 1
3@ == 14
then
01B2: give_actor $Player_ACTOR weapon 24 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Deagle~R~!" time 1000
end

if and
2@ == 1
3@ == 15
then
01B2: give_actor $Player_ACTOR weapon 25 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Shotgun~R~!" time 1000
end

if and
2@ == 1
3@ == 16
then
01B2: give_actor $Player_ACTOR weapon 26 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Sawn-Off Shotgun~R~!"
end

if and
2@ == 1
3@ == 17
then
01B2: give_actor $Player_ACTOR weapon 27 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Combat Shotgun~R~!" time 1000
end

if and
2@ == 1
3@ == 18
then
01B2: give_actor $Player_ACTOR weapon 28 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Micro-Uzi~R~!" time 1000
end

if and
2@ == 1
3@ == 19
then
01B2: give_actor $Player_ACTOR weapon 29 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~MP5~R~!" time 1000
end

if and
2@ == 1
3@ == 20
then
01B2: give_actor $Player_ACTOR weapon 32 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Tec-9~R~!" time 1000
end

if and
2@ == 1
3@ == 21
then
01B2: give_actor $Player_ACTOR weapon 30 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~AK-47~R~!" time 1000
end

if and
2@ == 1
3@ == 22
then
01B2: give_actor $Player_ACTOR weapon 31 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~M4~R~!" time 1000
end

if and
2@ == 1
3@ == 23
then
01B2: give_actor $Player_ACTOR weapon 33 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Rifle~R~!" time 1000
end

if and
2@ == 1
3@ == 24
then
01B2: give_actor $Player_ACTOR weapon 34 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Sniper Rifle~R~!" time 1000
end

if and
2@ == 1
3@ == 25
then
01B2: give_actor $Player_ACTOR weapon 35 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~RPG~R~!" time 1000
end

if and
2@ == 1
3@ == 26
then
01B2: give_actor $Player_ACTOR weapon 36 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Missile Launcher~R~!" time 1000
end

if and
2@ == 1
3@ == 27
then
01B2: give_actor $Player_ACTOR weapon 38 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Minigun~R~!" time 1000
end

if and
2@ == 1
3@ == 28
then
01B2: give_actor $Player_ACTOR weapon 37 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Flame Thrower~R~!" time 1000
end

if and
2@ == 1
3@ == 29
then
01B2: give_actor $Player_ACTOR weapon 39 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Sachet Charges~R~!" time 1000
end

if and
2@ == 1
3@ == 30
then
01B2: give_actor $Player_ACTOR weapon 40 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Sachet Detonator~R~!" time 1000
end

if and
2@ == 1
3@ == 31
then
01B2: give_actor $Player_ACTOR weapon 41 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Spray Can~R~!" time 1000
end

if and
2@ == 1
3@ == 32
then
01B2: give_actor $Player_ACTOR weapon 42 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Fire Extinguisher~R~!" time 1000
end

if and
2@ == 1
3@ == 33
then
01B2: give_actor $Player_ACTOR weapon 44 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Nightvision Goglles~R~!" time 1000
end

if and
2@ == 1
3@ == 34
then
01B2: give_actor $Player_ACTOR weapon 45 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Thermal Goglles~R~!" time 1000
end

if and
2@ == 1
3@ == 35
then
01B2: give_actor $Player_ACTOR weapon 46 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Parachute~R~!" time 1000
end

end

end


:label
hex
"1. Brass Knuckels" A
"2. Golf club" A
"3. Night stick" A
"4. Knife" A
"5. Baseball Bat" A
"6. Shovel" A
"7. Pool cue" A
"8. Katana" A
"9. Chainsaw" A
"10. Grenade" A
"11. Tear gas" A
"12. Molotov" A
"13. Colt 45 pistol" A
"14. Silenced piston" A
"15. Deagle" A
"15. Shotgun" A
"16. Sawed-off Shotgun" A
"17. Combat shotgun" A
"18. Micro-uzi" A
"19. MP5" A
"20. Tec-9" A
"21. AK-47" A
"22. M4" A
"23. Rifle" A
"24. Sniper" A
"25. Rocket Launcher" A
"26. HS Rocket Launcher" A
"27. Minigun" A
"28. Flame-Thrower" A
"29. Satchel" A
"30. Satchel Detonator" A
"31. Spray can" A
"32. Fire extinguisher" A
"33. Night vision goglles" A
"34. Infrared goglles" A
"35. Parachute" 0
end

player.Defined($Player_ACTOR)

model.Load(#BRASSKNUCKLE)
model.load(#GOLFCLUB)
model.load(#NITESTICK)
model.load(#KNIFECUR)
model.load(#BAT)
model.load(#SHOVEL)
model.load(#POOLCUE)
model.load(#KATANA)
model.load(#CHNSAW)
model.load(#GRENADE)
model.load(#TEARGAS)
model.load(#MOLOTOV)
model.load(#COLT45)
model.load(#SILENCED)
model.load(#DESERT_EAGLE)
model.load(#CHROMEGUN)
model.load(#SAWNOFF)
model.load(#SHOTGSPA)
model.load(#MICRO_UZI)
model.load(#MP5LNG)
model.load(#TEC9)
model.load(#AK47)
model.load(#M4)
model.load(#CUNTGUN)
model.load(#SNIPER)
model.load(#ROCKETLA)
model.load(#HEATSEEK)
model.load(#FLAME)
model.load(#MINIGUN)
model.load(#SATCHEL)
model.load(#BOMB)
model.load(#SPRAYCAN)
model.load(#FIRE_EX)
model.load(#NVGOGGLES)
model.load(#IRGOGGLES)
model.load(#GUN_PARA)

I did something wrong in this script?
 

ZyZ.MaxiM

Active member
Joined
Nov 14, 2022
Messages
50
Solutions
2
Reaction score
1
Update: I solved the entire script.
i need to load the gun model when it gives me the weapon, instead i put the "model.load() at the end of the script.
The solution:


if and
2@ == 1
3@ == 0
then
model.load(#brassknuckle)
01B2: give_actor $Player_ACTOR weapon 1 ammo 60 // Load the weapon model before using this
printf "~R~I gave you the ~B~Brass Knuckels~R~!" time 1000
end
 
Top