Raised This Month: $ Target: $400
 0% 

[TS]Instant Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-23-2011 , 16:42   Re: [TS]Instant Respawn
Reply With Quote #11

Quote:
Originally Posted by silentt View Post
I still dont see why the message hook is redundant, I dont usually hook messages but from what I remember it was the only way to hook messages.
Using a global variable and calling get_user_msgid() once is more efficient than calling get_user_msgid() six times. Caching is saving a value for use later basically.

Quote:
Originally Posted by silentt View Post
Post think is my way of doing it because its ts, there is already a built in respawn. So when you die each time there is a COUNTDOWN(thats why i hooked the message to get rid of it) and there is a menu to choose guns. Thats why in the description I said its different because its designed for ts, thats why its not automatic it runs when the player clicks. Its more for the short period of seconds before the respawn timer. I could hook it to player deaths but then it makes it automatic defeating the whole purpose which was to leave the menu. If it was automatic there is no reason for posting it.
In that case, it's not "instant" respawn. Your plugin's name is misleading IMO.


Oh, and to appropriately assign an array (during declaration) you should do:

PHP Code:
new bool:pCanSpawn[33] = {false, ...} 
__________________

Last edited by fysiks; 01-23-2011 at 16:58.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2011 , 16:45   Re: [TS]Instant Respawn
Reply With Quote #12

Also you could check string length, and if it's 1, check if 1st char is between char '1' and char '5' or whatever values you need.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-23-2011 , 16:47   Re: [TS]Instant Respawn
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
Also you could check string length, and if it's 1, check if 1st char is between char '1' and char '5' or whatever values you need.
Or just do str_to_num() and check if( 0 < str_to_num() < 6 ). Guess it depends on what the potential values of that message are.
__________________

Last edited by fysiks; 01-23-2011 at 16:49. Reason: typo
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2011 , 16:48   Re: [TS]Instant Respawn
Reply With Quote #14

I would do :

new string[3]
if( get_msg_arg_string(6, string, charsmax(string)) == 1 && '1' <= string[0] <= '5' )

But str_to_num could be more readable.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
silentt
Member
Join Date: Feb 2006
Location: Toronto, Ontario, Canada
Old 01-23-2011 , 17:34   Re: [TS]Instant Respawn
Reply With Quote #15

thanks, uhh a few questions actually because looking at it now, this would make most sense in a case statement anyways as I am dealing with numbers. For the sake of simplicity id do str_to_num BUT I just saw get_msg_arg_int, could I just use that and drop arg number 6 in its parameter and get the same result but then returned straight as a number?

If not ill just do some string conversion and then instead of the case as having all those numbers in its own if statement is redundant ill just range the if statement to be 0 to whatever their respawn time cvar is(because technically it can be starting from 50, just when I made it, it was specifically for my server settings). I started working on some optimization which before I didn't even really catch until you guys started pointing some out.

Last edited by silentt; 01-23-2011 at 17:42.
silentt is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-22-2011 , 02:32   Re: [TS]Instant Respawn
Reply With Quote #16

You can't use get_msg_arg_int because arg is not an integer but a string.
Still working on this ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
gtpunkt
Veteran Member
Join Date: Dec 2008
Location: Berlin
Old 02-25-2011 , 23:27   Re: [TS]Instant Respawn
Reply With Quote #17

Quote:
Simply put RIGHT after you die by clicking you can respawn again
Excellent,I love it.
gtpunkt is offline
Send a message via Skype™ to gtpunkt
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2011 , 15:25   Re: [TS]Instant Respawn
Reply With Quote #18

Poorly coded, unapproved.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 08:18.


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