Raised This Month: $ Target: $400
 0% 

[SOLVED] Teleport T team and CT team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 01-05-2014 , 15:16   [SOLVED] Teleport T team and CT team
Reply With Quote #1

Hello, i have a problem with script, i need to make players teleport to spawns on map by team (T = T Spawn , CT = CT Spawn)

I have this script, but doesn't do anything, if i set to teleport all players - not depending on team, it works, but not by team

Any help?

NOTE: For the "amx_teleport" script i'm using arkshine's script.
https://forums.alliedmods.net/showthread.php?t=75812

PHP Code:
#include <amxmodx>
 #include <amxmisc>
 #include <fakemeta>
 #include <cstrike>
 
new gVoteMenu;
 new 
gVotes[2];
 new 
gVoting;
 
 public 
plugin_init()
 {
    
register_clcmd"start_vote","StartVote" );
    
register_logevent("event_new_round"2"1=Round_Start");
 }
 
 public 
event_new_round(id)
 {
    
set_task(0.1"StartVote")
 }
 
 public 
StartVoteid )
 {

    
gVotes[0] = gVotes[1] = 0;

    
gVoteMenu menu_create"\rLook at this Vote Menu!:""menu_handler" );

    
menu_additemgVoteMenu"Knife Arena""");
    
menu_additemgVoteMenu"Vote Option 2""");

    new 
players[32], pnumtempid;

    
get_playersplayerspnum );


    for ( new 
ipnumi++ )
    {
        
tempid players[i];
    
        
menu_displaytempidgVoteMenu);

        
gVoting++;
    }

    
set_task(10.0"EndVote" );

    return 
PLUGIN_HANDLED;
 }
 public 
menu_handleridmenuitem )
 {
    if ( 
item == MENU_EXIT || !gVoting )
    {
        return 
PLUGIN_HANDLED;
    }

    
gVotesitem ]++;

    return 
PLUGIN_HANDLED;
 }
 public 
EndVote()
 {
    if ( 
gVotes[0] > gVotes[1] ) {
        
client_print(0print_chat"First option recieved most votes (%d )"gVotes[0] );
    
set_task(0.1"knifeport")
    }

    else if ( 
gVotes[0] < gVotes[1] ) 
        
client_print(0print_chat"Second option recieved most votes (%d )"gVotes[1] );

    else
        
client_print(0print_chat"The vote tied at %d votes each."gVotes[0] );

    
menu_destroygVoteMenu );

    
gVoting 0;
 }
 
public 
knifeport(id)
{
    if (
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
    {
        
client_cmd(id"amx_teleport -768 -352 256");
    }
    if (
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
    {
        
client_cmd(id"amx_teleport -1600 -352 256");
    }

__________________
Latest plugin: dHUD Round | Timeleft

Last edited by Ardonicek; 01-06-2014 at 13:04.
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-05-2014 , 19:32   Re: Teleport T team and CT team
Reply With Quote #2

In your task your not sending any player indexes. So the function won't work.

And your menu loops thru all players not just alive ones. Was that your intention
__________________

Last edited by Blizzard_87; 01-05-2014 at 19:38.
Blizzard_87 is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 01-06-2014 , 08:57   Re: Teleport T team and CT team
Reply With Quote #3

How to do it? I'm newbie in voting menus.

///EDIT , i've done it somehow, solved.
__________________
Latest plugin: dHUD Round | Timeleft

Last edited by Ardonicek; 01-06-2014 at 13:04.
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
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 10:07.


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