Raised This Month: $ Target: $400
 0% 

Nuke Bombs 1.31 - 26/08/2010


Post New Thread Reply   
 
Thread Tools Display Modes
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 09-20-2009 , 17:29   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #21

Shidla or ArhangeL thanks however in the new multilingual file there is two more sentence, would be great if you could write them too.
JoshGomez is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2009 , 18:04   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #22

I would use MSG_PVS, not MSG_PAS for all effects, and MSG_ONE_UNRELIABLE and instead of using floatround each time, you can use EngFunc_WriteCoord to work with float, same for EngFunc_MessageBegin.
__________________
Arkshine is offline
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 09-20-2009 , 18:28   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #23

I see, I will change that soon.

However is there anyway to get integer origin instead float vector from a entity? Because I don't really need float, I think.
JoshGomez is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2009 , 18:36   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #24

Where is the problem to work with float ?
__________________
Arkshine is offline
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 09-20-2009 , 18:51   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #25

Well, I don't use the numbers after the decimals so I think there is no use to have float.
JoshGomez is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2009 , 18:56   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #26

You use for the origin, it will be more accurate, though it's not really required there. But you have not choice to retrieve a float for entity, so work with float. It doesn't matter and you will avoid to use floatround each time.
__________________
Arkshine is offline
Old 09-20-2009, 19:54
Asd'
This message has been deleted by Asd'.
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-20-2009 , 20:33   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #27

Quote:
[es]
INFO = Este servidor usa Bombas Nucleares, escribe 'drop_nuke' en la consola para plantar la bomba.
WAIT = Tienes que esperar %d segundos para generar otra bomba nuclear.
ALREADY = Ya hay una bomba nuclear en este mapa, por favor espere a que detone la bomba.
ONLY_ADMINS = Solo los administradores pueden plantar la bomba nuclear!
ONLY_USER = La bomba nuclear solamente se puede plantar usando el comando de usuario.
Fixed.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2009 , 20:39   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #28

It's a suggestion nothing more, but I would use trie instead of using numerous equal(). Trie is a lot more faster than equal() and code will be more neat. Here an example, absolutely not tested nor if it compiles or not, just fastly done to show you :

Code:
enum Nuke_e { Nuke, NukeAdmin, NukeTimer, NukeCooldown, NukeDropAdmin, NukeDrop }; new gCvarPointer[ Nuke_e - 1 ]; new Trie:gVarsName;

Code:
gVarsName = TrieCreate(); new const CvarName          [][] = { "sv_nuke" , "sv_nuke_admin" , "sv_nuke_timer" , "sv_nuke_cooldown" }; new const ConsoleCommandName[][] = { "amx_nuke", "amx_nuke_admin", "amx_nuke_timer", "amx_nuke_cooldown", "amx_nuke_drop" }; new const ClientCommandName   [] =   "drop_nuke"; new const CvarDefaultValue[] = { "1", NUKE_ADMIN, NUKE_TIMER, NUKE_COOLDOWN }; new i; for ( i = 0; i < sizeof CvarName; i++ ) {     gCvarPointer[ i ] = register_cvar( CvarName[ i ], CvarDefaultValue[ i ] );     TrieSetCell( gVarsName, CvarName[ i ], i ); } for ( i = 0; i < sizeof ConsoleCommandName; i++ ) {     register_concmd( ConsoleCommandName[ i ], "HandlerCommand", ADMIN_FLAG );     TrieSetCell( gVarsName, ConsoleCommandName[ i ], i ); } register_clcmd( ClientCommandName, "HandlerCommand" ); TrieSetCell( gVarsName, ClientCommandName, NukeDrop );

Then,

Code:
public HandlerCommand( id, level, cid ) {     if ( !cmd_access( id, level, cid, 1 ) )     {         return PLUGIN_HANDLED;     }     static Command[ 32 ];     static Arg1   [ 32 ];     static Value;         read_argv( 0, Command, charsmax( Command ) );     read_argv( 1, Arg1, charsmax( Arg1 ) );         if ( TrieGetCell( gVarsData, Command, Value ) )     {         switch( Value )         {             case Nuke          : set_pcvar_num  ( gCvarPointer[ Nuke ], clamp( str_to_num( Arg1 ),  0, 1 ) );             case NukeAdmin     : set_pcvar_num  ( gCvarPointer[ NukeAdmin ], clamp( str_to_num( Arg1 ), -1, 1 ) );             case NukeTimer     : set_pcvar_num  ( gCvarPointer[ NukeTimer ], min( str_to_num( Arg1 ), 10 ) );             case NukeCooldown  : set_pcvar_float( gCvarPointer[ NukeCooldown ], str_to_float( Arg1 ) );             case NukeDropAdmin : admin_drop_nuke( id );             case NukeDrop      : user_drop_nuke ( id );         }     }     return PLUGIN_HANDLED; }

I think it's more readable like that. I've removed register_srvcmd() because by registering register_concmd() it registers both console. It may contains some errors but you get the idea.


Edit :

Code:
[fr]
INFO = Ce serveur utilise des Bombes Nucleaires, tape 'drop_nuke' dans la console pour en planter une.
WAIT = Tu dois attendre %d secondes avant de pouvoir planter une bombe.
ALREADY = Il y a deja une bombe sur la map, tu dois attendre jusqu'a ce qu'elle explose.
ONLY_ADMINS = Seulement les admins peuvent planter des bombes nucleaires !
ONLY_USER = Des Bombes Nucleaires peuvent etre seulement plantee avec la commande utilisateur.
__________________

Last edited by Arkshine; 09-20-2009 at 20:48.
Arkshine is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 09-21-2009 , 00:24   Re: Nuke Bombs 1.11 - 19/09/2009
Reply With Quote #29

Quote:
Originally Posted by Alucard^ View Post
@ Raddish

I think you should delete the images in your post, now... Cuz JoshGomez added some images in the first post... and your images do the thread very large and ppl have to load more things to open the thread.

Yes, my english sux i know.
Fixed.
Raddish is offline
Shidla
Senior Member
Join Date: Nov 2008
Location: Russia, Moscow
Old 09-22-2009 , 08:49   Re: Nuke Bombs 1.2 - 20/09/2009
Reply With Quote #30

Code:
[ru]
INFO = На сервере используется плагин Ядерной бомбы, введите в консоле  'drop_nuke', чтобы заложить бомбу!
WAIT = Необходимо подождать %d sсекунд, пока будет заспавнена бомба.
ALREADY = На карте уже заложена 1 бомба, дождитесь пока она будет взорвана.
ONLY_ADMINS = Только админы могут ставить бомбу!
ONLY_USER = Только пользователи могут ставить бомбу!
__________________
[Russian Federation] NOT USSR
This is madness?! This is Shidla!
[ZP] Laser Mine 2.8.2 ML (NEW !!2013!!) | [ZP] New Win Msg 1.4
| [ZP] MutaDote 1.1
Shidla is offline
Send a message via ICQ to Shidla Send a message via Skype™ to Shidla
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 20:05.


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