SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=475830)



help - 1jupanu1 - 15.11.2013

how i make /minigun to be avalaible after 5 persons typed /minigun

Quote:

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




Re: help - 1jupanu1 - 16.11.2013

....


Re: help - NeMoK - 16.11.2013

pawn Код:
#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;
}