Raised This Month: $ Target: $400
 0% 

Solved Level + flag


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-29-2021 , 12:45   Re: Level + flag
Reply With Quote #11

Quote:
Originally Posted by 1M1e View Post
Why?
Its inefficient and has a potential error, just add/fix what ive posted in post #6 to your code in post #5
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-29-2021 at 12:50.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
The overrated maniac
Member
Join Date: Jun 2021
Location: Argentina
Old 07-29-2021 , 12:51   Re: Level + flag
Reply With Quote #12

Quote:
Originally Posted by Natsheh View Post
Its inefficient and has a potential error, just add what ive posted in post #6 to your code in post #5
What can be that error?
I didnt know the native "crxranks_user_level_updated" from crxranks, I guess thats why is inefficient, calling the native is better to check it.

Last edited by The overrated maniac; 07-29-2021 at 12:55.
The overrated maniac is offline
1M1e
Member
Join Date: Mar 2020
Old 07-29-2021 , 12:59   Re: Level + flag
Reply With Quote #13

PHP Code:
#include <amxmisc>
#include <crxranks>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}



public 
client_putinserver(id)
{
    if(
crxranks_get_user_level(id) >= 40)
    {
        
SetVipFlagid )
    }
}

public 
crxranks_user_level_updated(idlevelbool:levelup)
{
    if(
level >= 40)
    {
        
SetVipFlagid )
    }
    


SetVipFlagid )
{
    
set_user_flagsidADMIN_LEVEL_H );

not working
1M1e is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-29-2021 , 13:01   Re: Level + flag
Reply With Quote #14

Quote:
Originally Posted by The overrated maniac View Post
What can be that error?
I didnt know the native "crxranks_user_level_updated" from crxranks, I guess thats why is inefficient, calling the native is better to check it.
PHP Code:
if(crxranks_get_user_level(i) >= 40 && is_user_connected(i)) 
This will throw an error probably, user is not connected.

You need to check first if user is connected then check his level that is the correct way ✅

Quote:
not working
Try doing debugs and see what is not working...


You need to #include amxmodx you should know that by default.
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-29-2021 at 13:05.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
1M1e
Member
Join Date: Mar 2020
Old 07-29-2021 , 13:04   Re: Level + flag
Reply With Quote #15

i can compile it but the code give to player when his level updated only and if the map change it will removed

there is no errors

Last edited by 1M1e; 07-29-2021 at 13:05.
1M1e is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-29-2021 , 13:06   Re: Level + flag
Reply With Quote #16

Quote:
Originally Posted by 1M1e View Post
i can compile it but the code give to player when his level updated only and if the map change it will removed
Add the include amxmodx

PHP Code:
#include <amxmodx> 
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
1M1e
Member
Join Date: Mar 2020
Old 07-29-2021 , 13:07   Re: Level + flag
Reply With Quote #17

i added it still not working
1M1e is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-29-2021 , 13:08   Re: Level + flag
Reply With Quote #18

Quote:
Originally Posted by 1M1e View Post
i added it still not working
Then do debugs and see if client_puinserver is getting called
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
1M1e
Member
Join Date: Mar 2020
Old 07-29-2021 , 13:09   Re: Level + flag
Reply With Quote #19

i did but the console give me no errors or anything
1M1e is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-29-2021 , 13:27   Re: Level + flag
Reply With Quote #20

Show your meta list
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:34.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode