Raised This Month: $32 Target: $400
 8% 

Ultimate Revive


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-29-2008 , 22:53   Re: Ultimate Revive
Reply With Quote #11

1.
Code:
            if(arg[1] == 'T')             {                 copy(tname,15,"TERRORIST");                 copy(teamname,23,"Terrorist");             }             if(arg[1] == 'C' && arg[2] == 'T')             {                 copy(tname,15,"CT");                 copy(teamname,23,"Counter-Terrorist");             }             get_players(players,num,"be",tname);

Should be else if(), and should block command if neither team is specified:
Code:
            if(arg[1] == 'T')             {                 copy(tname,15,"TERRORIST");                 copy(teamname,23,"Terrorist");             }             else if(arg[1] == 'C' && arg[2] == 'T')             {                 copy(tname,15,"CT");                 copy(teamname,23,"Counter-Terrorist");             }             else             {                 console_print(); // warning message                 return PLUGIN_HANDLED;             }             get_players(players,num,"be",tname);
-----------------------------
2.
Code:
new namet[32]; get_user_name(target,namet,31);
Two statements on one line?
-----------------------------
3.
Code:
        if(get_user_team(index) == 1)         {             fm_give_item(index,"weapon_knife");             fm_give_item(index,"weapon_glock18");             fm_give_item(index,"ammo_9mm");             fm_give_item(index,"ammo_9mm");             fm_give_item(index,"ammo_9mm");             fm_give_item(index,"ammo_9mm");         } else if(get_user_team(index) == 2) {             fm_give_item(index,"weapon_knife");             fm_give_item(index,"weapon_usp");             fm_give_item(index,"ammo_45acp");             fm_give_item(index,"ammo_45acp");             fm_give_item(index,"ammo_45acp");             fm_give_item(index,"ammo_45acp");         }
Use a switch:
Code:
        switch( get_user_team(index) )         {             case 1:             {                 fm_give_item(index,"weapon_knife");                 fm_give_item(index,"weapon_glock18");                 fm_give_item(index,"ammo_9mm");                 fm_give_item(index,"ammo_9mm");                 fm_give_item(index,"ammo_9mm");                 fm_give_item(index,"ammo_9mm");             }             case 2:             {                 fm_give_item(index,"weapon_knife");                 fm_give_item(index,"weapon_usp");                 fm_give_item(index,"ammo_45acp");                 fm_give_item(index,"ammo_45acp");                 fm_give_item(index,"ammo_45acp");                 fm_give_item(index,"ammo_45acp");             }         }
-----------------------------
EDIT:
4.
Code:
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},index);

Use a global messageid for ScreenFade.
Code:
new g_msgid_ScreenFade; public plugin_init() {     g_msgid_ScreenFade = get_user_msgid("ScreenFade"); } // ... message_begin(MSG_ONE,g_msgid_ScreenFade,{0,0,0},index);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 09-29-2008 at 22:55.
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-30-2008 , 01:44   Re: Ultimate Revive
Reply With Quote #12

Done
@ 4: why?
__________________

anakin_cstrike is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-30-2008 , 06:35   Re: Ultimate Revive
Reply With Quote #13

Instead of geting the messageid x times, you store it once.That's why.
Alka is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 07:21   Re: Ultimate Revive
Reply With Quote #14

Because, like Alka said, everytime someone is revived, that ScreenFade is shown to the player. Your way, the plugin has to retrieve get_user_msgid("ScreenFade") every time someone is respawned. My (and most other coder's) way will only use get_user_msgid("ScreenFade") once and use it. the get_user_msgid() values do not change.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 09-30-2008, 08:00
anakin_cstrike
This message has been deleted by Alka. Reason: useless
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-30-2008 , 08:01   Re: Ultimate Revive
Reply With Quote #15

I know what...i was thinking at something else.
__________________

anakin_cstrike is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-30-2008 , 08:06   Re: Ultimate Revive
Reply With Quote #16

sry for post this here, but no need new thread to this.. i need only the screen fade when u respawn.. u can give me the code? i tried to take ur code but, i cant..

thx and gj
Alucard^ is offline
Send a message via Skype™ to Alucard^
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-30-2008 , 08:33   Re: Ultimate Revive
Reply With Quote #17

Look for 'Fade(index,...)'
__________________

anakin_cstrike is offline
yoonghoe
Junior Member
Join Date: Dec 2008
Old 12-09-2008 , 01:42   Re: Ultimate Revive
Reply With Quote #18

how to make it work?
yoonghoe is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-09-2008 , 06:15   Re: Ultimate Revive
Reply With Quote #19

Quote:
Originally Posted by yoonghoe View Post
how to make it work?
What ?! it works.
__________________

anakin_cstrike is offline
QuixxyQuixx
New Member
Join Date: Dec 2008
Old 12-09-2008 , 19:30   Re: Ultimate Revive
Reply With Quote #20

Sweet Job.

You probably already know this but.
You can revive/spawn players who are in spectator too xD.
Thanks for this too, i can use it to spawn rule breakers with 0 hp 0 armor as a kind of punishment besides slay or drug etc.

Once again, Nice Job and Thanks.
QuixxyQuixx 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 01:08.


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