Код:
public OnPlayerSpawn(playerid)
{
LoadPlayerVehicle(playerid);
TextDrawShowForPlayer(playerid, TextGrana[playerid]);
SetPlayerVirtualWorld(playerid, void); //Por enquanto й isso
SetPVarInt(playerid, "Universo", void);
AntiDeAMX();
/*if(playerid == 0)//Policial Charles by Sonic_FreeStyle & Shadow_FreeStyle
{
SetPlayerSkin(playerid, 281);
new Text3D:charleslabel[MAX_PLAYERS];
new bot1string[256];
format(bot1string, sizeof(bot1string), "Policial_Charles");
charleslabel[playerid] = Create3DTextLabel(bot1string, COP_COLOR, 30.0, 40.0, 50.0, 3.0, 0, 0);
Attach3DTextLabelToPlayer(charleslabel[playerid], playerid, 0.0, 0.0, 0.7);
}*/
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerInFavela(x) || IsPlayerInBoca2(x) || IsPlayerInQuadra(x) || IsPlayerInPark(x)
|| IsPlayerInBoca1(x) || IsPlayerInBoca3(x) || IsPlayerInRiacho(x) || IsPlayerInIndustria(x)
|| IsPlayerInFonteSF(x) || IsPlayerInShoppingSF(x) || IsPlayerInPraiaSF(x)
|| IsPlayerInAeroSF(x) || IsPlayerInConstrucaoSF(x) || IsPlayerInRiacho(x)
|| IsPlayerInCasarao(x) || IsPlayerInEstacao(x))
{}
else
{
TextDrawHideForPlayer(x, MortoInfo[x]);
}
}
if (PlayerInfo[playerid][pLevel] > 0)
{
new Text3D:nivellabel[MAX_PLAYERS];
new string[256];
new nomedocaba[MAX_PLAYER_NAME];
Delete3DTextLabel(nivellabel[playerid]);
GetPlayerName(playerid, nomedocaba, MAX_PLAYER_NAME);
format(string, sizeof(string), "Nivel: %d",PlayerInfo[playerid][pLevel]);
nivellabel[playerid] = Create3DTextLabel(string, 0x33FF00FF, 30.0, 40.0, 50.0, 3.0, 0, 0);
Attach3DTextLabelToPlayer(nivellabel[playerid], playerid, 0.0, 0.0, 0.7);
}
CheckInfoOrg(playerid);
TextDrawHideForAll(Reloginho1);
TextDrawShowForPlayer(playerid, Reloginho1);
TextDrawHideForAll(Reloginho2);
TextDrawShowForPlayer(playerid, Reloginho2);
new plname[MAX_PLAYER_NAME];
new string[256];
if(sincronizando[playerid] == 1)
{
return 1;
}
if(EntrounoEvento == 1)
{
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,100);
return 1;
}
InitLockDoors(playerid);
STDPlayer[playerid] = 0;
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
if (gTeam[playerid] == 4) //medic / criminal reset team
{
gTeam[playerid] = 3;
}
if(gPlayerLogged[playerid] == 0)
{
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "Contas/%s.ini", plname);
if(fexist(string))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFF00}Login RHB", "{33CCFF}******************************************\n{33FF00}Bem Vindo ao [RHB] Rpg Heroes Brasil [RPG v1.0] \n{33FF00}Sua conta foi Registrada! \n\n{33FF00}Por favor logue na sua conta!!\n{33CCFF}******************************************", "Logar", "Sair");
//TextDrawShowForPlayer(playerid, RHBText);//Mostrar RHB Text Draw Sonic_FreeStyle & Shadow_FreeStyle
}
else
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFF00}Registrar RHB", "{33CCFF}******************************************\n{33FF00}Bem Vindo ao [RHB] Rpg Heroes Brasil [RPG v1.0] \n{33FF00}Sua conta nao esta registrada! \n\n{33FF00}Por favor, registre-se!!\n{33CCFF}******************************************", "Registrar", "Sair");
//TextDrawShowForPlayer(playerid, RHBText);//Mostrar RHB Text Draw Sonic_FreeStyle & Shadow_FreeStyle
}
return 1;
}
if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLider] < 1)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo foi aprovado pelo lнder, agora й um Civil!");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(gTeam[playerid] == 5)
{
if(PlayerInfo[playerid][pMembro] < 1)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma familia, agora й um Civil!");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
}
if(gTeam[playerid] == 10)
{
if(PlayerInfo[playerid][pMembro] != 8)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma agencia, й um Civil!");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
}
if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMembro] > 3)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "Voce nгo faz parte da PM / PC / Exйrcito, й um Civil!");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
}
if(gTeam[playerid] == 3)
{
if(PlayerInfo[playerid][pLider] > 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк faz parte de uma familia, foi forзado a trocar de roupa!");
MedicBill[playerid] = 0;
new model = PlayerInfo[playerid][pChar];
if(PlayerInfo[playerid][pMembro] == 1) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 2) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 3) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 4) { SetSpawnInfo(playerid, 1, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 4; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 5) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 6) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 6; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 8) { SetSpawnInfo(playerid, 10, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 8; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 9) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 9; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 10) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 10; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 11) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 15) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 15; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 16) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 17) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 18) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 18; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 19) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 20) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 20; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 22) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 22; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 23) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 23; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMembro] == 24) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 24; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 1) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 2) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 3) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 4) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 4; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 5) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 6) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 6; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 7) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 8) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 8; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 9) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 9; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 10) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 10; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 11) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 15) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 15; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 16) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 17) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 18) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 18; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 19) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 20) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 20; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 22) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 22; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 23) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 23; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pLider] == 24) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 24; PlayerInfo[playerid][pModel] = model; }
//SetSpawnInfo(playerid, team, model,0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
}
if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
SetPlayerWeapons(playerid);
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
PlayerFixRadio(playerid);
/* for(new i = 0; i < sizeof(Turfs); i++)
{
GangZoneShowForPlayer(playerid, i, TurfInfo[i][zCOLOR]);
}*/
if(MapIconsShown[playerid] != 0)
{
MapIconsShown[playerid] = 0;
for(new i = 0; i < sizeof(BizzInfo); i++)
{
SetPlayerMapIcon(playerid,i + 20,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ],36,COLOR_LIGHTRED);
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
SetPlayerMapIcon(playerid,i + 20,SBizzInfo[i][sbEntranceX],SBizzInfo[i][sbEntranceY],SBizzInfo[i][sbEntranceZ],36,COLOR_LIGHTRED);
}
}
//TextDrawShowForPlayer(playerid, RHBText);
return 1;
}