How can I?
#1

How can I, unload a GM, and then load a GM
every 10minutes or so. Also, if someone can,
how can I make it votable, like :

Quote:

Vote for the next gamemode :
DM at the beach
DM at the mountains
DM at the Woods
DM at the Deserts

** This will happen every 10minutes **

Reply
#2

You can create multiple server.cfg files, each one containing a different setup (gamemode,server name, etc.) and have the players vote on one.
Reply
#3

Quote:
Originally Posted by Joe Staff
You can create multiple server.cfg files, each one containing a different setup (gamemode,server name, etc.) and have the players vote on one.
Well okay, but I kinda got lost in the voting xD
how can I do the voting?
Reply
#4

Or this:

pawn Код:
/*
blah
*/


#include <a_samp>
#include <foreach>

#define WHITE 0xFFFFFFAA

new ChangeCounts;
new VoteCounts[ 4 ];

forward ModeChange();

public OnGameModeInit()
{
    SetTimer( "ModeChange", 300000, false );
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if( dialogid == 1 )
    {
      switch( listitem )
      {
        case 0:
            {
                VoteCounts[ 0 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
        case 1:
            {
                VoteCounts[ 1 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
        case 2:
            {
                VoteCounts[ 2 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
      }
    }
}

public ModeChange()
{
    ChangeCounts++;
    switch( ChangeCounts )
    {
      case 1:
      {
        foreach(Player, i)
        {
            SendClientMessage( i, WHITE, "The GM is changing, please select a new one." );
            ShowPlayerDialog( i, 1, DIALOG_STYLE_INPUT, "MODE CHANGE", "Protect the President\nDance with the Devil\nStunts\n", "Select", "Cancel");
          }
      }
      case 2:
      {
        new largest, i = 0;
          while(i < VoteCounts[ 3 ])
          {
            i++;
            if( VoteCounts[ i ] > largest ) largest = VoteCounts[ i ];
          }
         
          switch( largest )
          {
            case 0: SendRconCommand( "changemode protect" );
            case 1: SendRconCommand( "changemode dance" );
            case 2: SendRconCommand( "changemode stunts" );
          }
       
      }
    }
   
    return 1;
}
I don't know if this works as I haven't tested it.
Reply
#5

Quote:
Originally Posted by Freddo [BINMAN
]
Or this:

pawn Код:
/*
blah
*/


#include <a_samp>
#include <foreach>

#define WHITE 0xFFFFFFAA

new ChangeCounts;
new VoteCounts[ 4 ];

forward ModeChange();

public OnGameModeInit()
{
    SetTimer( "ModeChange", 300000, false );
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if( dialogid == 1 )
    {
      switch( listitem )
      {
        case 0:
            {
                VoteCounts[ 0 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
        case 1:
            {
                VoteCounts[ 1 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
        case 2:
            {
                VoteCounts[ 2 ]++;
                SendClientMessage( playerid, WHITE, "Thanks for voting!" );
        }
      }
    }
}

public ModeChange()
{
    ChangeCounts++;
    switch( ChangeCounts )
    {
      case 1:
      {
        foreach(Player, i)
        {
            SendClientMessage( i, WHITE, "The GM is changing, please select a new one." );
            ShowPlayerDialog( i, 1, DIALOG_STYLE_INPUT, "MODE CHANGE", "Protect the President\nDance with the Devil\nStunts\n", "Select", "Cancel");
          }
      }
      case 2:
      {
        new largest, i = 0;
          while(i < VoteCounts[ 3 ])
          {
            i++;
            if( VoteCounts[ i ] > largest ) largest = VoteCounts[ i ];
          }
         
          switch( largest )
          {
            case 0: SendRconCommand( "changemode protect" );
            case 1: SendRconCommand( "changemode dance" );
            case 2: SendRconCommand( "changemode stunts" );
          }
       
      }
    }
   
    return 1;
}
I don't know if this works as I haven't tested it.
I don't get it. it give's me this ERROR :

Код:
C:\DOCUME~1\owner\Desktop\SA-MP server\gamemodes\TDM.pwn(379) : warning 235: public function lacks forward declaration (symbol "ModeChange")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
pawn Код:
public ModeChange() /// Line 379
{
    ChangeCounts++;
    switch( ChangeCounts )
    {
      case 1:
      {
        foreach(Player, i)
        {
            SendClientMessage( i, WHITE, "The GM is changing, please select a new one." );
            ShowPlayerDialog( i, 1, DIALOG_STYLE_INPUT, "MODE CHANGE", "Protect the President\nDance with the Devil\nStunts\n", "Select", "Cancel");
          }
      }
      case 2:
      {
        new largest, i = 0;
          while(i < VoteCounts[ 3 ])
          {
            i++;
            if( VoteCounts[ i ] > largest ) largest = VoteCounts[ i ];
          }

          switch( largest )
          {
            case 0: SendRconCommand( "changemode protect" );
            case 1: SendRconCommand( "changemode dance" );
            case 2: SendRconCommand( "changemode stunts" );
          }

      }
    }

    return 1;
}
Reply
#6

put forward ModeChange(); above public ModeChange()
Reply
#7

Quote:
Originally Posted by Killa_
put forward ModeChange(); above public ModeChange()
Oh, lawl, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)