pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new pname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, pname);
TextDrawHideForPlayer(playerid,Area);
TextDrawHideForPlayer(playerid,Area1);
TextDrawHideForPlayer(playerid,Area2);
TextDrawHideForPlayer(playerid,Area3);
TextDrawHideForPlayer(playerid,Area4);
TextDrawHideForPlayer(playerid,AreaMotd);
// ================================ Anim Loops =====================================
#if defined AnimLoopsUser
if(!gPlayerAnimLibsPreloaded[playerid])
{
PreloadAnimLib(playerid, "COP_AMBIENT");
PreloadAnimLib(playerid, "ON_LOOKERS");
PreloadAnimLib(playerid, "benchpress");
PreloadAnimLib(playerid, "RAPPING");
PreloadAnimLib(playerid, "SMOKING");
PreloadAnimLib(playerid, "DEALER");
PreloadAnimLib(playerid, "BOMBER");
PreloadAnimLib(playerid, "MD_END");
PreloadAnimLib(playerid, "FINALE");
PreloadAnimLib(playerid, "BEACH");
PreloadAnimLib(playerid, "SWEET");
PreloadAnimLib(playerid, "STRIP");
PreloadAnimLib(playerid, "CARRY");
PreloadAnimLib(playerid, "CRACK");
PreloadAnimLib(playerid, "SHOP");
PreloadAnimLib(playerid, "FOOD");
PreloadAnimLib(playerid, "PARK");
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "BAR");
gPlayerAnimLibsPreloaded[playerid] = 1;
printf("Os animes foram prй carregados para %s.", pname);
}
#endif
// =================================================================================
if(cercado[playerid] == 1)
{
cercado[playerid] = 0;
UncagePlayer(playerid);
}
emcasa[playerid] = 0;
autoescola[playerid] = 0;
xprefls[playerid] = 0;
prefsf[playerid] = 0;
preflv[playerid] = 0;
nobanco[playerid] = 0;
nobarls[playerid] = 0;
nobarsf[playerid] = 0;
nobarlv[playerid] = 0;
nobarfc[playerid] = 0;
nautlls[playerid] = 0;
nautllv[playerid] = 0;
algemado[playerid] = 0;
sequestro[playerid] = 0;
infratores[playerid] = 0;
vercmds[playerid] = 0;
verpms[playerid] = 0;
gmod[playerid] = 0;
vmod[playerid] = 0;
noevento[playerid] = 0;
GPS_Spawned[playerid] = 1;
// Hospital
if(SeMorreu[playerid] == true && nogame[playerid] == 0 && NaFaculdade[playerid] == 0)
{
new randmaca = random(sizeof(MacaAposMorrer));
SetPlayerHealth(playerid, 5.0);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, MacaAposMorrer[randmaca][0], MacaAposMorrer[randmaca][1], MacaAposMorrer[randmaca][2]);
SetPlayerFacingAngle(playerid, MacaAposMorrer[randmaca][3]);
SetPlayerCameraPos(playerid, 1159.3287, -1314.6178, 482.0693);
SetPlayerCameraLookAt(playerid, 1164.3419, -1305.1895, 480.5693);
ClearChatbox(playerid, 10);
TogglePlayerControllable(playerid, false);
#if defined AnimLoopsUser
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
#else
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
#endif
TimerExRecuperou[playerid] = SetTimerEx("RecuperouSe", 1000, true, "e", playerid);
GameTextForPlayer(playerid, "~r~Recuperando-se... Aguarde sua vida encher...", 10000, 4);
}
else
{
SeMorreu[playerid] = false;
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
}
if(NaFaculdade[playerid] == 1)
{
SetPlayerHealth(playerid, 999999.0);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 1494.4003, 1304.2990, 1093.2891);
TogglePlayerControllable(playerid, 1);
}
if(dini_Exists(file))
{
// Casamento
if(dini_Int(file, "Casado") == 3)
{
format(string, sizeof(string), "{FF00EE}%s se divorciou de vocк.\n{FFFF00}Nгo perca tempo, case com outro(a).", dini_Get(file, "CasouCom"));
dini_IntSet(file, "Casado", 0);
dini_Set(file, "CasouCom", "Ninguem");
ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, "Divуrcio", string, "OK", "");
}
if(dini_Int(file, "novato") == 1)
{
if(SeMorreu[playerid] == false)
{
new gStr[ 256 ];
new Ano, Mes,Dia;
getdate(Ano, Mes,Dia);
getdate(Anolog[playerid], Meslog[playerid],Dialog[playerid]);
new Hora, Minuto, Segundo;
gettime(Hora, Minuto, Segundo);
gettime(Horalog[playerid], Minutolog[playerid], Segundolog[playerid]);
format( gStr, sizeof( gStr ), "[ > ] Seu primeiro e ъltimo login foi {FFFFFF}[%d/%d/%d] аs %d:%d\r\n", Dia, Mes, Ano, Hora, Minuto);
SendClientMessage( playerid, COLOR_AMARELO, gStr );
}
}
if(dini_Int(file, "Procurado") == 0)
{
Procurados[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
}
else
{
Procurados[playerid] = 1;
SetPlayerWantedLevel(playerid, 2);
}
if(dini_Int(file, "Preso") == 1)
{
if(SeMorreu[playerid] == false)
{
PrenderPlayer(playerid);
SendClientMessage(playerid, msgdm, "Vocк estб preso. Contrate um advogado ou pague a fianзa /fianca");
}
}
else
{
preso[playerid] = 0;
}
if(nogame[playerid] == 1)
{
SetPlayerInterior(playerid, lanI[playerid]);
SetPlayerPos(playerid, lanX[playerid], lanY[playerid], lanZ[playerid]);
SetPlayerSkin(playerid, dini_Int(file, "Skin"));
nogame[playerid] = 0;
nobomber[playerid] = 0;
}
dini_IntSet(file, "convitent", 0);
dini_IntSet(file, "Entrevista", 0);
dini_IntSet(file, "MN", 0);
}
if(PlayerInfo[playerid][Logged] == 1)
{
if(dini_Int(file, "Sexo") == 0)
{
ShowPlayerDialog(playerid, skinnovato, DIALOG_STYLE_MSGBOX, "Gкnero", "{00ff00}Qual й seu sexo?\n\n", "Masculino", "Feminino");
}
else
{
if(pAdmin[playerid] > 0)
{
#if !defined SystemAdminUser
pAdmin[playerid] = 0;
dini_IntSet(file, "aAdmin", 0);
ShowPlayerDialog(playerid, sisadminfo, DIALOG_STYLE_MSGBOX, "{FFFFFF}Aviso Importante aos ADM's", "{FF33FF}O sistema de Administraзгo do servidor foi desativado!\n\n{00FF00}Devido vбrios conflitos entre jogadores foi tomada esta decisгo.\n\n{99FFFF}O tempo para que seja normalizado o sistema ainda nгo foi definido.", "OK", "");
#endif
}
}
if(dini_Int(file, "Bloco") == 1)
{
format(string, sizeof(string), "Lembrete: %s", dini_Get(file, "Lembrete"));
SendClientMessage(playerid, Cinza, string);
}
if(PlayerInfo[playerid][SpawnDance] == false)
{
KillTimer(PlayerInfo[playerid][SpawnTimer]);
PlayerInfo[playerid][SpawnAngle] = 0.0;
PlayerInfo[playerid][SpawnDance] = true;
}
if(SeMorreu[playerid] == false)
{
SetSpawnInfo(playerid, 1, dini_Int(file, "Skin"), dini_Int(file, "CasaX"), dini_Int(file, "CasaY"), dini_Int(file, "CasaZ"), 357.9491, 0, 0, 0, 0, 0, 0);
Logarprof(playerid);
}
}
else
{
RandomSpawnPlayer(playerid);
if(PlayerInfo[playerid][SpawnDance])
{
PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo[playerid][SpawnDance] = false;
}
}
if(SeMorreu[playerid] == false)
{
TogglePlayerControllable(playerid, false);
SetTimerEx("DestogglePlayerControllable", 1000, 0, "d", playerid);
}
return 1;
}