Salvatore_Giordano
Умник
Значит вот класс полиции!
Подсжаите как?!
Просьба покажите пример на данном классе:
В классе стоит вход только с 200 очков!Хотелось бы сделать и в других классах!Но неполучается выходит ошибка!case ClassPolice:
{
// Count the number of normal players (all classes except police) and count the amount of police players
new NormalPlayers, PolicePlayers, bool:CanSpawnAsCop = false;
// Block this check if PlayersBeforePolice is set to 0 (this allows anyone to join as police)
if (PlayersBeforePolice > 0)
{
// Loop through all players
for (new pid; pid < MAX_PLAYERS; pid++)
{
// Exclude this player, as he doesn't have a class yet, he's still choosing here
if (pid != playerid)
{
// Also exclude all players who are still in the class-selection screen, as they don't have a class selected yet
if (GetPlayerInterior(pid) != 14)
{
// Check if this player is logged in
if (APlayerData[pid][LoggedIn] == true)
{
// Count the amount of normal players and police players
switch (APlayerData[pid][PlayerClass])
{
case ClassPolice:
PolicePlayers++;
case ClassTruckDriver, ClassBusDriver, ClassPilot, ClassMafia, ClassCourier, ClassAssistance, ClassRoadWorker:
NormalPlayers++;
}
}
}
}
}
// Check if there are less police players than allowed
if (PolicePlayers < (NormalPlayers / PlayersBeforePolice))
CanSpawnAsCop = true; // There are less police players than allowed, so the player can choose this class
else
CanSpawnAsCop = false; // The maximum amount of police players has been reached, the player can't choose to be a cop
// Check if the player isn't allowed to spawn as police
if (CanSpawnAsCop == false)
{
// Let the player know the maximum amount of cops has been reached
GameTextForPlayer(playerid, "Слишком много полицейский", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Слишком много полицейских,пожалуйста выберите другой класс");
return 0; // Don't allow the player to spawn as police player
}
}
// If the player has less than 100 scorepoints
if (APlayerData[playerid][PlayerScore] < 200)
{
// Let the player know he needs 100 scorepoints
GameTextForPlayer(playerid, "Для класса полиции требуется 100 очков", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Вам нужно 100 очков для данного класса");
return 0; // Don't allow the player to spawn as police player
}
// If the player has a wanted level
if (GetPlayerWantedLevel(playerid) > 0)
{
// Let the player know he cannot have a wanted level to join police
GameTextForPlayer(playerid, "Вам не позволенно выбирать класс полиции,так как вы в розыске", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Вам не позволенно выбирать класс полиции,так как вы в розыске");
return 0; // Don't allow the player to spawn as police player
}
Index = random(sizeof(ASpawnLocationsPolice));
x = ASpawnLocationsPolice[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPolice[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPolice[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPolice[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Игрок {FFFF00}%s{00FF00} зашёл за {FFFF00}полицейского", Name);
}
Подсжаите как?!
Просьба покажите пример на данном классе:
Я уже незнаю как делать!case ClassMafia:
{
Index = random(sizeof(ASpawnLocationsMafia));
x = ASpawnLocationsMafia[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsMafia[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsMafia[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsMafia[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Игрок {FFFF00}%s{00FF00} зашёл за {FFFF00}мафию", Name);
}
