How would I.....?(Defining)
#1

Alright, I've seen this in a script:

/house store weapon weaponname

the problem is the weapon name, how do I define the name for each weapon id and check that the player actually has it? so i.e

/house store weapon ak47

How do I define it to the correct ID so it inserts it to mysql and then remove the weapon from the player. The actual issue is just how to define it.
I want basically is a function that:

knows weapon names i.e

Desert Eagle = 24.

So when a player types something like:

/give weapon playerid Desert Eagle, it gives them a deserteagle according to its ID.
Reply
#2

store the weapons using varibles and then just update via MySQL

EDIT: didnt read the name right, you would need a stock function i guess, with the weapon ids then there names
Reply
#3

Would it be strcmp or?
Reply
#4

I guess so,
Reply
#5

Can someone else help please?
Reply
#6

I don't know if strcmp is the best way to do it... but I can't be sure with other methods, as I'm not very resourceful when it comes to using MySQL or ZCmd...
Reply
#7

No all I want basically is a function that:

knows weapon names i.e

Desert Eagle = 24.

So when a player types something like:

/give weapon playerid Desert Eagle, it gives them a deserteagle according to its ID.
Reply
#8

Why not look into the way vehicle names are stored? Change it around into weapon names.
Reply
#9

That doesnt really help, sorry.
Reply
#10

You can use an enum for that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)