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;
}