Raised This Month: $ Target: $400
 0% 

Custom Spray Management


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-19-2014 , 03:00   Re: Custom Spray Management
Reply With Quote #41

Quote:
What do you mean by sending big number of arguments for the middle function? And does it make a difference ?
You're using now cmd_access. It's helpful because it can check access, throwing message in console, and can check if number of args passed ie enough.
But later, you still use access. As tip you could use cmd_access there too, so it could throw a message if player doesn't have access. Though we don't want and don't care about last param which the number of arguments passed. So to avoid to trigger the check, you pass a random enough big number like 999, like cmd_access(id, level, cid, 999).

Quote:
Changed the whole saving system.... i think this one is much better.
I'm not sure to like you write the whole list, but considering it's not going to be called often, I guess it doesn't matter much. With AMXX 1.8.3 you will be able to traverse a trie.
  • in Save_SprayBan, is there specific reason to use x2 copy instead of using data[BannedSteamID] and data[BannedName] directly in above natives?
  • In SaveBans, no need to check if file exists before deleting it, and I'm not sure why you want to delete file each time because using "wt" will overwrite existing content anyway, I would move deleting inside gi_TotalBans check. Also formatex + fputs = fprintf.
  • You did not change LANG_PLAYER
  • In Ham_PlayerSpawn, probably better to use is_user_alive as code will be called 2 times at each player's spawn.
__________________

Last edited by Arkshine; 05-19-2014 at 03:04.
Arkshine is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 05-19-2014 , 05:46   Re: Custom Spray Management
Reply With Quote #42

Thanks for all suggestions !

Quote:
Originally Posted by Arkshine View Post
  • You did not change LANG_PLAYER
  • In Ham_PlayerSpawn, probably better to use is_user_alive as code will be called 2 times at each player's spawn.
  • Wait all were LANG_SERVER and in previous post you told me change to LANG_PLAYER where id is passed, so i did ?
  • Its already is_user_alive..?

I was using tries wrong from starting.. well i fixed that in this as well!
I think now it has no bug.

Thanks !
__________________
Preparing to release my plugins..
r0ck is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-19-2014 , 06:33   Re: Custom Spray Management
Reply With Quote #43

  • About LANG_PLAYER, you have to use when you pass 0 as index in client_print*. Internally, it will retrieve each player's language setting. If you pass an index and you use LANG_PLAYER, it will use probably the default server language or first player's one, don't remember. So, if you pass an index > 0, you should use this as index instead of LANG_PLAYER.
  • Why did you remove TrieDestroy.
__________________
Arkshine is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 05-19-2014 , 14:30   Re: Custom Spray Management
Reply With Quote #44

Quote:
Originally Posted by Arkshine View Post
  • About LANG_PLAYER, you have to use when you pass 0 as index in client_print*. Internally, it will retrieve each player's language setting. If you pass an index and you use LANG_PLAYER, it will use probably the default server language or first player's one, don't remember. So, if you pass an index > 0, you should use this as index instead of LANG_PLAYER.
  • Why did you remove TrieDestroy.
Thanks i got it ..

And i removed triedestroy because

Quote:
Originally Posted by ConnorMcLeod View Post
Tries don't need to be destroyed at plugin_end, it is automatic.
__________________
Preparing to release my plugins..
r0ck is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-19-2014 , 14:48   Re: Custom Spray Management
Reply With Quote #45

Actually yes and no. Handle system is well freed at map change, but because of how it was designed (1.8.3 is different) allocated memory which holds data is not freed because reused at some point. So if you don't destroy, you could have some wasted/unused memory.

More generally, it's more appropriate to free memory when you can if you have natives for that.
__________________

Last edited by Arkshine; 05-19-2014 at 14:50.
Arkshine is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 05-19-2014 , 15:30   Re: Custom Spray Management
Reply With Quote #46

Done
__________________
Preparing to release my plugins..
r0ck is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-19-2014 , 15:45   Re: Custom Spray Management
Reply With Quote #47

You still did not change LANG_PLAYER. Please check/test what you're doing before updating.
__________________
Arkshine is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 05-20-2014 , 12:53   Re: Custom Spray Management
Reply With Quote #48

Quote:
Originally Posted by Arkshine View Post
You still did not change LANG_PLAYER. Please check/test what you're doing before updating.
Oh god sorry .... but i am not getting .. i did everything else u suggested but this one I'm really not getting.
If i am not wrong then you said to use LANG_PLAYER when index pass is 0 ( everyone ) so i did ?
so are you trying to tell that LANG_SERVER must be used when id is passed ?

Sorry again
__________________
Preparing to release my plugins..
r0ck is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-20-2014 , 15:58   Re: Custom Spray Management
Reply With Quote #49

Well, let's go with an example then:

All players: client_print_color(0, RED, "%s %L", PREFIX, LANG_PLAYER, "SPRAY_DIS_ONE")

One player: client_print_color(id, RED, "%s %L", PREFIX, id, "SPRAY_DIS_ONE")
__________________

Last edited by Arkshine; 05-20-2014 at 16:04.
Arkshine is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 05-21-2014 , 01:56   Re: Custom Spray Management
Reply With Quote #50

Quote:
Originally Posted by Arkshine View Post
Well, let's go with an example then:

All players: client_print_color(0, RED, "%s %L", PREFIX, LANG_PLAYER, "SPRAY_DIS_ONE")

One player: client_print_color(id, RED, "%s %L", PREFIX, id, "SPRAY_DIS_ONE")
Oh god i had no idea we have to use id itself in place of LANG_PLAYER....
Thanks ! done changes!
__________________
Preparing to release my plugins..
r0ck is offline
Reply



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 16:24.


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