28.12.2014, 17:58
Yes, instead of only once to send this message sends several times when many players. You must only send those in paintball
pawn Код:
forward StopPaintball();
public StopPaintball()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(InPaintball[i] != 0)
{
pRound = 0;
VotedMap[i] = 0;
VotedGun[i] = 0;
pVoted = 1;
ResetPlayerWeapons(i);
SetPlayerInterior(i, 10);
SetPlayerVirtualWorld(i, 0);
pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
new sendername[MAX_PLAYER_NAME], string[256];
GetPlayerName(pWinner, sendername, sizeof(sendername));
format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
SendClientMessage(i, COLOR_YELLOW, string);
SetTimer("StartPaintball", 30000, 0);
}
}
return 1;
}
if(strcmp(cmd, "/paintball", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(5.0, playerid, 1328.6179, -1557.9896, 13.8794))
{
pPlayers ++;
PlayerKills[playerid] = 0;
InPaintball[playerid] = 1;
pVoted = 1;
VotedMap[playerid] = 0;
VotedGun[playerid] = 0;
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid, -973.7964, 1077.2219, 1345.0875);
SendClientMessage(playerid, COLOR_WHITE, "Pentru a vota o mapa sau o arma foloseste comanda {0976B0}/vote.");
if(pRound == 0) { SetTimer("StartPaintball", 30000, 0); }
if(pRound == 1)
{
if(pGun[1] == 1) { GivePlayerWeapon(playerid, 24, 500); }
if(pGun[2] == 1) { GivePlayerWeapon(playerid, 25, 500); }
if(pGun[3] == 1) { GivePlayerWeapon(playerid, 31, 500); }
if(pGun[4] == 1) { GivePlayerWeapon(playerid, 27, 500); }
if(pGun[5] == 1) { GivePlayerWeapon(playerid, 4, 500); }
if(pGun[6] == 1) { GivePlayerWeapon(playerid, 5, 500); }
}
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(InPaintball[i] != 0)
{
SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF);
return 1;
}
}
}
}
return 1;
}