29.11.2012, 14:53
Entao galera o bug e assim as vezes quando vc loagr aparece no hospital masi sem morre. alguem pode me ajuda
public OnPlayerSpawn(playerid)
{
if(Player[playerid][FirstSpawn] == true)
{
Player[playerid][FirstSpawn] = false;
if(gPlayerLogged[playerid])
{
new lol[256];
format(lol,256,"/RPG/bans/%s.ini", Player[playerid][pName]);
if(strcmp(Player[playerid][pName],"Coringa",true)==0)
goto Join;
if(strcmp(Player[playerid][pName],"Coringa",true)==0)
goto Join;
if(DOF2_FileExists(lol))
{
new string[128], banfile[256];
new admin[52], data[52], tempban[128];
format(admin,52,"%s", DOF2_GetString(lol,"AdminName"));
format(data,52,"%s", DOF2_GetString(lol,"Data"));
new tick = DOF2_GetInt(lol,"BanTime");
if(tick > 0)
{
if(tick < GetTickCount())
format(tempban,128,"|| Ban temporбrio - Acaba em %s", Convert(tick-GetTickCount()));
else
{
SendClientMessage(playerid, COLOR_RED,"[ADMIN BOT] Seu ban temporбrio acabou.");
DOF2_RemoveFile(lol);
goto Join;
}
}
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
format(string,128,"- Esse nick '%s' foi banido pelo '%s' em '%s'", Player[playerid][pName], admin, data);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,128,"- Motivo: '%s' %s", DOF2_GetString(lol, "Motivo"), tempban);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_ORANGE,"Visite a pбgina 'Manuteзгo, leia as regras e crie seu tуpico com esta imagem. (F8 para capturб-la)");
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
banfile = GetBannedFile(playerid);
if(!DOF2_FileExists(banfile) && tick == 0)
{
new hour, minute, second, day, month, year;
gettime(hour, minute, second);
getdate(year, month, day);
DOF2_CreateFile(banfile);
DOF2_SetString(banfile,"PlayerName", Player[playerid][pName]);
DOF2_SetString(banfile,"AdminName", "Admin Bot");
DOF2_SetString(banfile,"Motivo", "Evasгo de Ban (Old)");
format(string, sizeof(string), "%02d/%02d аs %02d:%02d", day, month, hour, minute);
DOF2_SetString(banfile,"Data", string);
}
return Kick(playerid);
}
}
Join:
TextDrawShowForPlayer(playerid, MoneyTD);
TextDrawShowForPlayer(playerid, ServerLogo2);
TextDrawShowForPlayer(playerid, ServerLogo1);
}
PlaySoundForPlayer(playerid, 1057);
StopMusic(playerid);
nowh[playerid] = 0;
RemixSombra[playerid] = false;
Incasa[playerid] = Player[playerid][pPhousekey];
SetTimerEx("TurfsDebug",3000, false, "i", playerid);
InitLockDoors(playerid);
SetPlayerHealth(playerid, 100);
STDPlayer[playerid] = 0;
gTeam[playerid] = Player[playerid][pTeam]; //Set the Team
if(Player[playerid][pAdmin] > 0)
SetPlayerChatBubble(playerid, AccountName(playerid), COLOR_YELLOW, 50.0, 14400000);
if(gTeam[playerid] == 4) //medic / criminal reset team
gTeam[playerid] = 3;
if(gTeam[playerid] == 11 && Player[playerid][pLeader] < 1)
{
new rand = random(sizeof(CIV));
Player[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);
Player[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 5)
{
if(Player[playerid][pMember] < 1)
{
new rand = random(sizeof(CIV));
Player[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);
Player[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 10)
{
if(Player[playerid][pMember] != 8)
{
new rand = random(sizeof(CIV));
Player[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);
Player[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 2 && Player[playerid][pMember] > 3)
{
new rand = random(sizeof(CIV));
Player[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);
Player[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 3)
{
if(Player[playerid][pMember] > 0 || Player[playerid][pLeader] > 0)
{
new model = Player[playerid][pChar];
if(Player[playerid][pMember] == TEAM_PM) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); Player[playerid][pTeam] = 2; gTeam[playerid] = 2; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_PF) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 2; gTeam[playerid] = 2; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_FA) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 2; gTeam[playerid] = 2; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_BOMBE) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 12; gTeam[playerid] = 12; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_BALLAS) { SetSpawnInfo(playerid, 5, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 7; gTeam[playerid] = 7; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_GROOVE) { SetSpawnInfo(playerid, 5, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 7; gTeam[playerid] = 7; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_PREF) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 7; gTeam[playerid] = 7; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_HITMAN) { SetSpawnInfo(playerid, 10, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 10; gTeam[playerid] = 10; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_SANEWS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 12; gTeam[playerid] = 12; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_LOWRIDERS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_VAGOS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_BIKERS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_MUNICIPAL) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 14; gTeam[playerid] = 14; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_RUSSA) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_DRIFTERS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_COMANDOVERMELHO) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_PCC) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_BOPE) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 21; gTeam[playerid] = 21; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_ALQAEDA) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 22; gTeam[playerid] = 22; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_KINGS) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_AsFarc) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 22; gTeam[playerid] = 22; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_PM) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_PF) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_FA) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_BALLAS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_GROOVE) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_PREF) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_HITMAN) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_SANEWS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_LOWRIDERS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_VAGOS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 7; gTeam[playerid] = 7; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_VAGOS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 7; gTeam[playerid] = 7; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_MUNICIPAL) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_AZTECAS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_RUSSA) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 16; gTeam[playerid] = 16; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_DRIFTERS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_COMANDOVERMELHO) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_PCC) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_BOPE) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_ALQAEDA) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pLeader] == TEAM_KINGS) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 11; gTeam[playerid] = 11; Player[playerid][pModel] = model; }
else if(Player[playerid][pMember] == TEAM_AsFarc) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); Player[playerid][pTeam] = 22; gTeam[playerid] = 22; Player[playerid][pModel] = model; }
SpawnPlayer(playerid);
}
}
if(Player[playerid][pChar] > 0){ SetPlayerSkin(playerid, Player[playerid][pModel]); }
else { SetPlayerSkin(playerid, Player[playerid][pModel]); }
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
if(Player[playerid][pVIP] == 1)
{
SafeGivePlayerWeapon(playerid, 24, 650);
SafeGivePlayerWeapon(playerid, 29, 650);
SafeGivePlayerWeapon(playerid, 31, 650);
SafeGivePlayerWeapon(playerid, 29, 650);
SafeGivePlayerWeapon(playerid, 34, 650);
SetPlayerArmour(playerid, 30);
SetPlayerHealth(playerid, 100);
}
if(Player[playerid][pVIP] == 2)
{
SafeGivePlayerWeapon(playerid, 24, 750);
SafeGivePlayerWeapon(playerid, 29, 750);
SafeGivePlayerWeapon(playerid, 31, 750);
SafeGivePlayerWeapon(playerid, 29, 750);
SafeGivePlayerWeapon(playerid, 34, 750);
SetPlayerArmour(playerid, 60);
SetPlayerHealth(playerid, 100);
}
if(Player[playerid][pVIP] == 3)
{
SafeGivePlayerWeapon(playerid, 24, 850);
SafeGivePlayerWeapon(playerid, 29, 850);
SafeGivePlayerWeapon(playerid, 31, 850);
SafeGivePlayerWeapon(playerid, 29, 850);
SafeGivePlayerWeapon(playerid, 34, 850);
SetPlayerArmour(playerid, 90);
SetPlayerHealth(playerid, 100);
}
if(Player[playerid][pVIP] == 4)
{
SafeGivePlayerWeapon(playerid, 24, 950);
SafeGivePlayerWeapon(playerid, 29, 950);
SafeGivePlayerWeapon(playerid, 31, 950);
SafeGivePlayerWeapon(playerid, 29, 950);
SafeGivePlayerWeapon(playerid, 34, 950);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
}
return 1;
}