Resolved Scripting

Coding Help/Re-API Supported
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

Scripting

#1

Post by Spir0x » 2 Years Ago

guys i tryed to make knife menu only for vip's

Image

but this in ze_main_menu .sma code get error.

Image

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r Knife Menu /w[/rVIP/w]) that's good?

And what i should write in knife_menu.sma to let it only for VIP's.this?


#define VIP_ACCESS ADMIN_LEVEL_H
I trynna make money, not friends.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#2

Post by johnnysins2000 » 2 Years Ago

u don't need to write anything in ze_main_menu.sma

u just simply need to edit the knife code if members does not get vip flags he will get this message

"u need to be a vip member to take hammer knife "
Nobody Is That Busy If They Make Time :roll:

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#3

Post by Spir0x » 2 Years Ago

but how i can do it Knife Menu [VIP]
and i said i write only this in knife_menu.sma ?
#define VIP_ACCESS ADMIN_LEVEL_H
I trynna make money, not friends.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1982
Joined: 3 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#4

Post by Raheem » 2 Years Ago

Make sure ze_knife_menu.inc in the includes folder. You can read here about our VIP natives: viewtopic.php?f=15&t=39

Example: To make knife menu for players who have VIP_A which mean flag a you only will need to do something like to change:
    1.     if((g_iUsedTimes[id] < get_pcvar_num(cvar_use_times)) && !ze_is_user_zombie(id) && is_user_valid(id))
    2.     {
    3.         menu_display(id, menu, 0)
    4.     }
TO:
    1.     if((g_iUsedTimes[id] < get_pcvar_num(cvar_use_times)) && !ze_is_user_zombie(id) && is_user_valid(id) && ze_get_vip_flags(id) & VIP_A)
    2.     {
    3.         menu_display(id, menu, 0)
    4.     }
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#5

Post by Spir0x » 2 Years Ago

Ok raheem i understand but how i can do this ?

Image

i have ze_knife_menu.inc in inclueds. in ze_main_menu.sma ? but i tryed it gives error look at my post.
I trynna make money, not friends.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#6

Post by Spir0x » 2 Years Ago

Raheem look at this i can not put [VIP] and vip native too the both shows only 1 error. i think it's from my compiler? or from files sma. i need another?

Image
I trynna make money, not friends.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#7

Post by johnnysins2000 » 2 Years Ago

Spir0x wrote:
2 Years Ago
Raheem look at this i can not put [VIP] and vip native too the both shows only 1 error. i think it's from my compiler? or from files sma. i need another?

Image
What Do U want ? Knife Menu to be only Open By VIP ?
Nobody Is That Busy If They Make Time :roll:

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#8

Post by Spir0x » 2 Years Ago

Yes with flag a like raheem said and please bro u can compile from ze_main_menu change Knife menu to Knife menu [VIP] like i showed :/ cuz it won"t compile at me knife menu and main menu

Image
I trynna make money, not friends.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1982
Joined: 3 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#9

Post by Raheem » 2 Years Ago

This error appears if include files are missing.
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 634
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#10

Post by Spir0x » 2 Years Ago

Ok what's this?

Image

Image
I trynna make money, not friends.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest