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 ** |
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.
|
/*
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;
}
Originally Posted by Freddo [BINMAN
]
Or this: pawn Код:
|
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.
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;
}
Originally Posted by Killa_
put forward ModeChange(); above public ModeChange()
|