Only 1 Terrorist
I have this code
get_players( players, num, "ae", "CT" ); for( new i = 0; i > num; i++ ) { player = players[i]; if( !is_user_alive( player ) ) continue; set_user_godmode( player, 1 ); } Can anyone change this to if is only 1 terrorist alive left godmode is set off? |
Re: Only 1 Terrorist
First, change the team tag to "TERRORIST" se we will get only terrorists. Then remove that loop, and just check if the player number is 1. If it is, set godmode with index players[num-1].
|
Re: Only 1 Terrorist
public HideNSeek( id )
{ new players[32], num, player; get_players( players, num, "ae", "TERRORIST" ); for( new i = 0; i < num; i++ ) { player = players[i]; if( !is_user_alive( player ) ) continue; set_user_rendering( player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 16 ); set_user_footsteps( player, 1 ); } get_players( players, num, "ae", "CT" ); for( new i = 0; i < num; ) { player = players[i]; if( !is_user_alive( player ) ) continue; set_user_godmode( player, 1 ); } get_players( players, num, "ae", "TERRORIST" ); if( num <= 1 ) { set_user_godmode( player, 0 ); } This way works? |
Re: Only 1 Terrorist
For the sake of users trying to help you, please wrap your code in tags ( such as code, php, etc. ).
|
Re: Only 1 Terrorist
if you wan't to do it for 1 terrorist then don't make loop . remove for (new i=0.....) and add if ( num == 1 ) and when you wan't to give something like ColorChat(players[0] ....
Code:
|
Re: Only 1 Terrorist
Thanks a lot!
Can anyone help me in one more thing? I want to block T killing CT but without giving them godmode, for example T can't kill CT but CT can die if they fall in the ground. |
Re: Only 1 Terrorist
Ham_TakeDamage with return HAM_SUPERCEDE will do the work for you.
|
Re: Only 1 Terrorist
can you edit the plugin with that?
|
Re: Only 1 Terrorist
I can't now, I'm not on my PC. But here is scripting help section, so you can't wait someone to make it for you. Try yourself, or post in suggestions/requests section. I'm sure someone will make it, since it's quite easy.
|
Re: Only 1 Terrorist
idk if "Ham_TakeDamage" is the best way but i give a try !
Code:
|
| All times are GMT -4. The time now is 21:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.