Posts: 249
Threads: 56
Joined: Jun 2013
Reputation:
0
hello i have a take gun and put gun command. I can list my weapons in car that i can take but i cant list the weapons that player has on himself. anyone has an idea or tutorail how to list these weapons ?
Example:
if i have weapon id 24(desert eagle) with 87 bullets and a weapon id 25(shotgun) with 24 bullets i want to see them on DIALOG_TYPE_LIST without holding it in my hand. both ammo and weapon name
Posts: 249
Threads: 56
Joined: Jun 2013
Reputation:
0
but it lists like
emptyline
emptyline
desert eagle
shotgun
emptyline
...
..
i need to list like only 2 weapons and when i put the weapon to car it cant search for specific weapon on my character and delete it. thats why i need a tutorial
i mean i cant say in code like delete weapon id 25 from player i need to say delete weapon slot 3 from player shotgun is id 3 i believe
Posts: 1,915
Threads: 64
Joined: Jan 2016
Reputation:
0
Well, you have to check if the line is empty or not. How? Check the length of the line with strlen. If strlen = 0, the player doesn't have the weapon.
Posts: 249
Threads: 56
Joined: Jun 2013
Reputation:
0
yeah i dont know how to do that thats my ptoblem i need tutorials that i can develop on. for take gun i did like carslot1 carslot2 carslot3 if theres no gun in carslots they return 0 to me and if they are 0 i told to format the string to freeslot and write that but i dont know how to skip empty lines
Posts: 2,593
Threads: 34
Joined: Dec 2007
Posts: 249
Threads: 56
Joined: Jun 2013
Reputation:
0
thank you its more like what i want i can play on this