PDA

View Full Version : help


1jupanu1
15/11/2013, 10:10 AM
how i make /minigun to be avalaible after 5 persons typed /minigun

CMD:minigun( playerid, params[ ] )
{
Iter_Add( PlayerInMinigun, playerid );
/*foreach( Player, i )
FormatMSG( i, ~1, "[JOIN] {%06x}%s(%i) "GRI"just joined Minigun [/minigun] (Players: %d)", GetPlayerColor( playerid ) >>> 8, PlayerName( playerid ), playerid, Iter_Count(PlayerInMinigun) );
*/
gsString[ 0 ] = EOS;
format( gsString, sizeof( gsString ), "~r~~h~~h~DM: ~r~~h~%s(%d) ~w~~h~has joined ~g~~h~Minigun ~y~(Players: %d)", PlayerName( playerid ), playerid, Iter_Count(PlayerInMinigun) );
ShowOnTextDraw( gsString );

DMTele( playerid, "Minigun", "minigun", 1410.5425, 2176.3142, 12.0156, 0, 0, 38, 0, 0, 0, 0, 9999, 0, 0, 0, 0, 100, "/mini" );
SetPlayerRandomSpawnMinigun( playerid );
return PlayerInfo[ playerid ][ InMinigun ] = ( 1 );
}

1jupanu1
16/11/2013, 09:38 AM
....

NeMoK
16/11/2013, 11:21 AM
#define SCM SendClientMessage
#define COLOR_ERROR 0x606060FF
#define COLOR_INFO 0xB8A9FEFF
new joinedminigun[MAX_PLAYERS];
new typedminigun=0;
CMD:minigun( playerid, params[ ] )
{
if(joinedminigun[playerid]==1) return SCM(playerid,COLOR_ERROR,"You already joined to minigun. Wait for 5 players.");
if(typedminigun==5) return SCM(playerid,COLOR_ERROR,"A minigun game is already started.");
joinedminigun[playerid]=1;
typedminigun++;
if(typedminigun==5)
{
gsString[ 0 ] = EOS;
format( gsString, sizeof( gsString ), "~r~~h~~h~DM: ~r~~h~%s(%d) ~w~~h~has joined ~g~~h~Minigun ~y~(Players: %d)", PlayerName( playerid ), playerid, Iter_Count(PlayerInMinigun) );
ShowOnTextDraw( gsString );
DMTele( playerid, "Minigun", "minigun", 1410.5425, 2176.3142, 12.0156, 0, 0, 38, 0, 0, 0, 0, 9999, 0, 0, 0, 0, 100, "/mini" );
SetPlayerRandomSpawnMinigun( playerid );
}
else
{
SCM(playerid,COLOR_INFO,"You joined minugun. Wait for other players.");
}
return 1;
}