public OnPlayerRequestSpawn(playerid) { new Index, Float, Float:y, Float:z, Float:Angle, Name[24], Msg[128]; // Get the player's name GetPlayerName(playerid, Name, sizeof(Name)); // Choose a random spawnlocation based on the player's class switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: { Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{FFFF00}O Jogador {FFFFFF}%s{FFFF00} Entrou como um Caminhoneiro.", Name); } case ClassBusDriver: { Index = random(sizeof(ASpawnLocationsBusDriver)); x = ASpawnLocationsBusDriver[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsBusDriver[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsBusDriver[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsBusDriver[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{00FFFF}O Jogador {FFFFFF}%s{00FFFF} Entrou como um Taxista.", Name); } case ClassPilot: { Index = random(sizeof(ASpawnLocationsPilot)); x = ASpawnLocationsPilot[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsPilot[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsPilot[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsPilot[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{BEBEBE}O Jogador {FFFFFF}%s{BEBEBE} Entrou como um Piloto de Aviгo.", Name); } 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, "O Maximo de Policiais ja estao Online", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{808080}O Maximo de Policiais jб foram Atingidos, Escolha outro Cargo"); return 0; // Don't allow the player to spawn as police player } } // If the player has less than 100 scorepoints if (APlayerData[playerid][PlayerScore] < 1000) { // Let the player know he needs 100 scorepoints GameTextForPlayer(playerid, "Voce precisa de 7000 Scores para Ser Policial", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce Precisa de 7000 Scores Para Ser Policial"); 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, "Voce nao pode Ser Policial enquanto estб Sendo Procurado", 5000, 4); SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce nao pode Ser Policial enquanto estб Sendo Procurado"); 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, "{0000FF}O Jogador {FFFFFF}%s{0000FF} Entrou como um Policial.", 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, "{A020F0}O Jogador {FFFFFF} %s {A020F0} Entrou como um Traficante.", Name); } case ClassCourier: { Index = random(sizeof(ASpawnLocationsCourier)); x = ASpawnLocationsCourier[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsCourier[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsCourier[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsCourier[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{FF0000}O Jogador {FFFFFF}%s{FF0000} Entrou como um Entregador do Sedex.", Name); } case ClassAssistance: { Index = random(sizeof(ASpawnLocationsAssistance)); x = ASpawnLocationsAssistance[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsAssistance[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsAssistance[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsAssistance[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{006400}O Jogador {FFFFFF}%s{006400} Entrou como um Mecanico.", Name); } case ClassRoadWorker: { Index = random(sizeof(ASpawnLocationsRoadWorker)); x = ASpawnLocationsRoadWorker[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsRoadWorker[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsRoadWorker[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsRoadWorker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{EEE8AA}O Jogador {FFFFFF} %s {EEE8AA} Entrou como um Funcionario do DNIT.", Name); } case ClassLixeiro: { Index = random(sizeof(ASpawnLocationsLixeiro)); x = ASpawnLocationsLixeiro[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsLixeiro[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsLixeiro[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsLixeiro[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{FFA500}O Jogador {FFFFFF} %s {FFA500} Entrou como um Lixeiro.", Name); } case ClassPizza: { Index = random(sizeof(ASpawnLocationsPizza)); x = ASpawnLocationsPizza[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsPizza[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsPizza[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsPizza[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{F5F5DC}O Jogador {FFFFFF} %s {F5F5DC} Entrou como um Entregador de Pizza.", Name); } case ClassMendigo: { Index = random(sizeof(ASpawnLocationsMendigo)); x = ASpawnLocationsMendigo[Index][SpawnX]; // Get the X-position for the spawnlocation y = ASpawnLocationsMendigo[Index][SpawnY]; // Get the Y-position for the spawnlocation z = ASpawnLocationsMendigo[Index][SpawnZ]; // Get the Z-position for the spawnlocation Angle = ASpawnLocationsMendigo[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation format(Msg, 128, "{B8860B}O Jogador {FFFFFF} %s {B8860B} Entrou como um Mendigo.", Name); } } |
// Define class-colors #define ColorClassTruckDriver 0xFFFF00 // Amarelo #define ColorClassBusDriver 0x00FFFF // Azul Claro #define ColorClassPilot 0xBEBEBE // Cinza #define ColorClassPolice 0x0000FF// Azul Escuro #define ColorClassMafia 0xA020F0 // Roxo #define ColorClassCourier 0xFF0000 // Rosa #define ColorClassAssistance 0x006400 // Dark green #define ColorClassRoadWorker 0xEEE8AA // Light yellow #define ColorClassLixeiro 0xFFA500 // Laranja #define ColorClassPizza 0xF5F5DC // Beige #define ColorClassMendigo 0xB8860B // Gold |
public OnPlayerText(playerid, text[]) { if(APlayerData[playerid][PlayerName]) { new textv2[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof (name)); format(textv2, sizeof (textv2), " %s [ID:%d]:{FFFFFF} %s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid),te xtv2); return 0; } |
public OnPlayerSpawn(playerid) { if (APlayerData[playerid][RulesRead] == false) { new Msg[2000]; format(Msg, 2000, "{FFFFFF}%s1. Sempre dirigir do lado {FF0000}direito {FFFFFF}nas estradas para evitar acidentes.\n", Msg); format(Msg, 2000, "{FFFFFF}%s2. Nгo {FF0000}chingar {FFFFFF}ou {FF0000}desrespeitar {FFFFFF}os outros jogadores, eles sгo seus companheiros.\n", Msg); format(Msg, 2000, "{FFFFFF}%s3. Usar a linguagem padrгo '{FF0000}Portuguкs{FFFFFF}'.\n", Msg); format(Msg, 2000, "{FFFFFF}%s4. Nгo usar hackers ou serб banido {FF0000}permanentemente{FFFFFF}.\n", Msg); format(Msg, 2000, "{FFFFFF}%s5. Nгo {FF0000}floodar {FFFFFF}no chat, pode ser {FF0000}calado {FFFFFF}por um admin.\n", Msg); format(Msg, 2000, "{FFFFFF}%s6. Nгo roubar carros, sujeito a prisгo caso haja denuncia.\n", Msg); format(Msg, 2000, "{FFFFFF}%s7. Nunca chingue ou desrespeite um administrador, vocк serб {FF0000}banido{FFFFFF}.\n", Msg); ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "Regras do Caminhoneiros na Estrada:", Msg, "Aceitar", TXT_DialogButtonCancel); } if (IsPlayerNPC(playerid)) return 1; if (APlayerData[playerid][LoggedIn] == false) { SendClientMessage(playerid, 0xFFFFFFFF, TXT_FailedLoginProperly); Kick(playerid); } new missiontext[200]; SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); APlayerData[playerid][CurrentHouse] = 0; TogglePlayerClock(playerid, 0); ResetPlayerWeapons(playerid); switch (APlayerData[playerid][PlayerClass]) { case ClassTruckDriver: { format(missiontext, sizeof(missiontext), Trucker_NoJobText); SetPlayerColor(playerid, ColorClassTruckDriver); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassBusDriver: { format(missiontext, sizeof(missiontext), BusDriver_NoJobText); SetPlayerColor(playerid, ColorClassBusDriver); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassPilot: { format(missiontext, sizeof(missiontext), Pilot_NoJobText); SetPlayerColor(playerid, ColorClassPilot); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassPolice: { format(missiontext, sizeof(missiontext), Police_NoJobText); SetPlayerColor(playerid, ColorClassPolice); KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid); for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } case ClassMafia: { format(missiontext, sizeof(missiontext), Mafia_NoJobText); SetPlayerColor(playerid, ColorClassMafia); KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads", 1000, true, "i", playerid); for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } case ClassCourier: { format(missiontext, sizeof(missiontext), Courier_NoJobText); SetPlayerColor(playerid, ColorClassLixeiro); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassAssistance: // Assistance class { format(missiontext, sizeof(missiontext), Assistance_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassAssistance); // Set the playercolor (chatcolor for the player and color on the map) if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } KillTimer(APlayerData[playerid][PlayerCheckTimer]); APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Assistance_CheckPlayers", 1000, true, "i", playerid); } case ClassLixeiro: { format(missiontext, sizeof(missiontext), Lixeiro_NoJobText); SetPlayerColor(playerid, ColorClassLixeiro); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassPizza: { format(missiontext, sizeof(missiontext), Pizza_NoJobText); SetPlayerColor(playerid, ColorClassPizza); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassMendigo: { format(missiontext, sizeof(missiontext), Mendigo_NoJobText); SetPlayerColor(playerid, ColorClassMendigo); if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } case ClassRoadWorker: // Roadworker class { format(missiontext, sizeof(missiontext), RoadWorker_NoJobText); // Preset the missiontext SetPlayerColor(playerid, ColorClassRoadWorker); // Set the playercolor (chatcolor for the player and color on the map) if (APlayerData[playerid][WeaponLicense] == 1) { for (new i; i < 12; i++) GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo); } else { ResetPlayerWeapons(playerid); } } } TextDrawSetString(APlayerData[playerid][MissionText], missiontext); TextDrawShowForPlayer(playerid, APlayerData[playerid][MissionText]); if (APlayerData[playerid][PlayerJailed] != 0) Police_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]); return 1; |
public OnPlayerRequestSpawn(playerid)
{
new Index, Float, Float:y, Float:z, Float:Angle, Name[24], Msg[128];
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Choose a random spawnlocation based on the player's class
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver:
{
Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation
x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{FFFF00}O Jogador {FFFFFF}%s{FFFF00} Entrou como um Caminhoneiro.", Name);
}
case ClassBusDriver:
{
Index = random(sizeof(ASpawnLocationsBusDriver));
x = ASpawnLocationsBusDriver[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsBusDriver[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsBusDriver[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsBusDriver[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FFFF}O Jogador {FFFFFF}%s{00FFFF} Entrou como um Taxista.", Name);
}
case ClassPilot:
{
Index = random(sizeof(ASpawnLocationsPilot));
x = ASpawnLocationsPilot[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPilot[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPilot[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPilot[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{BEBEBE}O Jogador {FFFFFF}%s{BEBEBE} Entrou como um Piloto de Aviгo.", Name);
}
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, "O Maximo de Policiais ja estao Online", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}O Maximo de Policiais jб foram Atingidos, Escolha outro Cargo");
return 0; // Don't allow the player to spawn as police player
}
}
// If the player has less than 100 scorepoints
if (APlayerData[playerid][PlayerScore] < 1000)
{
// Let the player know he needs 100 scorepoints
GameTextForPlayer(playerid, "Voce precisa de 7000 Scores para Ser Policial", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce Precisa de 7000 Scores Para Ser Policial");
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, "Voce nao pode Ser Policial enquanto estб Sendo Procurado", 5000, 4);
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce nao pode Ser Policial enquanto estб Sendo Procurado");
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, "{0000FF}O Jogador {FFFFFF}%s{0000FF} Entrou como um Policial.", 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, "{A020F0}O Jogador {FFFFFF} %s {A020F0} Entrou como um Traficante.", Name);
}
case ClassCourier:
{
Index = random(sizeof(ASpawnLocationsCourier));
x = ASpawnLocationsCourier[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsCourier[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsCourier[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsCourier[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{FF0000}O Jogador {FFFFFF}%s{FF0000} Entrou como um Entregador do Sedex.", Name);
}
case ClassAssistance:
{
Index = random(sizeof(ASpawnLocationsAssistance));
x = ASpawnLocationsAssistance[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsAssistance[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsAssistance[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsAssistance[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{006400}O Jogador {FFFFFF}%s{006400} Entrou como um Mecanico.", Name);
}
case ClassRoadWorker:
{
Index = random(sizeof(ASpawnLocationsRoadWorker));
x = ASpawnLocationsRoadWorker[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsRoadWorker[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsRoadWorker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsRoadWorker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{EEE8AA}O Jogador {FFFFFF} %s {EEE8AA} Entrou como um Funcionario do DNIT.", Name);
}
case ClassLixeiro:
{
Index = random(sizeof(ASpawnLocationsLixeiro));
x = ASpawnLocationsLixeiro[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsLixeiro[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsLixeiro[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsLixeiro[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{FFA500}O Jogador {FFFFFF} %s {FFA500} Entrou como um Lixeiro.", Name);
}
case ClassPizza:
{
Index = random(sizeof(ASpawnLocationsPizza));
x = ASpawnLocationsPizza[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPizza[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPizza[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPizza[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{F5F5DC}O Jogador {FFFFFF} %s {F5F5DC} Entrou como um Entregador de Pizza.", Name);
}
case ClassMendigo:
{
Index = random(sizeof(ASpawnLocationsMendigo));
x = ASpawnLocationsMendigo[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsMendigo[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsMendigo[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsMendigo[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{B8860B}O Jogador {FFFFFF} %s {B8860B} Entrou como um Mendigo.", Name);
}
}
//----------------------------------------------------------------------------------------------------------------//
// Define class-colors
#define ColorClassTruckDriver 0xFFFF00 // Amarelo
#define ColorClassBusDriver 0x00FFFF // Azul Claro
#define ColorClassPilot 0xBEBEBE // Cinza
#define ColorClassPolice 0x0000FF// Azul Escuro
#define ColorClassMafia 0xA020F0 // Roxo
#define ColorClassCourier 0xFF0000 // Rosa
#define ColorClassAssistance 0x006400 // Dark green
#define ColorClassRoadWorker 0xEEE8AA // Light yellow
#define ColorClassLixeiro 0xFFA500 // Laranja
#define ColorClassPizza 0xF5F5DC // Beige
#define ColorClassMendigo 0xB8860B // Gold
//----------------------------------------------------------------------------------------------------------------//
public OnPlayerText(playerid, text[])
{
if(APlayerData[playerid][PlayerName])
{
new textv2[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof (name));
format(textv2, sizeof (textv2), " %s [ID:%d]:{FFFFFF} %s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid),te xtv2);
return 0
}
//-----------------------------------------------------------------------------------------------------------------//
public OnPlayerSpawn(playerid)
{
if (APlayerData[playerid][RulesRead] == false)
{
new Msg[2000];
format(Msg, 2000, "{FFFFFF}%s1. Sempre dirigir do lado {FF0000}direito {FFFFFF}nas estradas para evitar acidentes.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s2. Nгo {FF0000}chingar {FFFFFF}ou {FF0000}desrespeitar {FFFFFF}os outros jogadores, eles sгo seus companheiros.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s3. Usar a linguagem padrгo '{FF0000}Portuguкs{FFFFFF}'.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s4. Nгo usar hackers ou serб banido {FF0000}permanentemente{FFFFFF}.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s5. Nгo {FF0000}floodar {FFFFFF}no chat, pode ser {FF0000}calado {FFFFFF}por um admin.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s6. Nгo roubar carros, sujeito a prisгo caso haja denuncia.\n", Msg);
format(Msg, 2000, "{FFFFFF}%s7. Nunca chingue ou desrespeite um administrador, vocк serб {FF0000}banido{FFFFFF}.\n", Msg);
ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "Regras do Caminhoneiros na Estrada:", Msg, "Aceitar", TXT_DialogButtonCancel);
}
if (IsPlayerNPC(playerid))
return 1;
if (APlayerData[playerid][LoggedIn] == false)
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_FailedLoginProperly);
Kick(playerid);
}
new missiontext[200];
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
APlayerData[playerid][CurrentHouse] = 0;
TogglePlayerClock(playerid, 0);
ResetPlayerWeapons(playerid);
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver:
{
format(missiontext, sizeof(missiontext), Trucker_NoJobText);
SetPlayerColor(playerid, ColorClassTruckDriver);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassBusDriver:
{
format(missiontext, sizeof(missiontext), BusDriver_NoJobText);
SetPlayerColor(playerid, ColorClassBusDriver);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassPilot:
{
format(missiontext, sizeof(missiontext), Pilot_NoJobText);
SetPlayerColor(playerid, ColorClassPilot);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassPolice:
{
format(missiontext, sizeof(missiontext), Police_NoJobText);
SetPlayerColor(playerid, ColorClassPolice);
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid);
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
case ClassMafia:
{
format(missiontext, sizeof(missiontext), Mafia_NoJobText);
SetPlayerColor(playerid, ColorClassMafia);
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads", 1000, true, "i", playerid);
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
case ClassCourier:
{
format(missiontext, sizeof(missiontext), Courier_NoJobText);
SetPlayerColor(playerid, ColorClassLixeiro);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassAssistance: // Assistance class
{
format(missiontext, sizeof(missiontext), Assistance_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassAssistance); // Set the playercolor (chatcolor for the player and color on the map)
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Assistance_CheckPlayers", 1000, true, "i", playerid);
}
case ClassLixeiro:
{
format(missiontext, sizeof(missiontext), Lixeiro_NoJobText);
SetPlayerColor(playerid, ColorClassLixeiro);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassPizza:
{
format(missiontext, sizeof(missiontext), Pizza_NoJobText);
SetPlayerColor(playerid, ColorClassPizza);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassMendigo:
{
format(missiontext, sizeof(missiontext), Mendigo_NoJobText);
SetPlayerColor(playerid, ColorClassMendigo);
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
case ClassRoadWorker: // Roadworker class
{
format(missiontext, sizeof(missiontext), RoadWorker_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassRoadWorker); // Set the playercolor (chatcolor for the player and color on the map)
if (APlayerData[playerid][WeaponLicense] == 1)
{
for (new i; i < 12; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
else
{
ResetPlayerWeapons(playerid);
}
}
}
TextDrawSetString(APlayerData[playerid][MissionText], missiontext);
TextDrawShowForPlayer(playerid, APlayerData[playerid][MissionText]);
if (APlayerData[playerid][PlayerJailed] != 0)
Police_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]);
return 1;
SetPlayerColor(playerid, ColorClassTruckDriver);
#define ColorClasseTruckDriver 0xFFFFFFFF// < Cor Branca SEM TRANSPARENCIA