AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Teleport T team and CT team (https://forums.alliedmods.net/showthread.php?t=232845)

Ardonicek 01-05-2014 15:16

[SOLVED] Teleport T team and CT team
 
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");
    }



Blizzard_87 01-05-2014 19:32

Re: Teleport T team and CT team
 
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

Ardonicek 01-06-2014 08:57

Re: Teleport T team and CT team
 
How to do it? I'm newbie in voting menus.

///EDIT , i've done it somehow, solved.


All times are GMT -4. The time now is 10:07.

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