16.04.2012, 02:52
Bom galera, estou com um bug que ainda nгo foi resolvido, alguns amigos aqui tentaram resolver, mais infelizmente o bug superou.
Qual й o bug ?
Quando o cara se registra/loga, ele spawna certinho.
Quando morre, ele nгo spawna, fica
Alguйm poderia ajudar?
OnPlayerDeath:
OnPlayerSpawn:
SetPlayerSpawn:
++ REP PRA QUEM AJUDAR.
Qual й o bug ?
Quando o cara se registra/loga, ele spawna certinho.
Quando morre, ele nгo spawna, fica
Quote:
< > (spawn) |
OnPlayerDeath:
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerDados[playerid][Morreu]++;
PlayerDados[killerid][Matou]++;
SpawnPlayer(playerid);
new caller = Mobile[playerid];
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, CINZA, "Morreram do outro lado da linha....");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
/*format(StringContas, sizeof(StringContas), "VirtualStreet/Contas/%s.txt", Nome(playerid));
if(DOF2_IsSet("VirtualStreet/Admins.txt", Nome(playerid)))
{
PlayerDados[playerid][Admin] = DOF2_GetInt("VirtualStreet/Admins.txt", Nome(playerid));
}*/
killerid = INVALID_PLAYER_ID;
KillTimer(TimerKit);
return true;
}
PHP код:
public OnPlayerSpawn(playerid)
{
if (PlayerDados[playerid][TutorialOk] == 0)
{
ShowPlayerDialog(playerid, RSEXO, DIALOG_STYLE_MSGBOX, "{FFFFFF}Escolha seu sexo","{FFE4C4}========================================\n\n{9AFF9A}Escolha seu {FFFFFF}sexo{9AFF9A}.\n\n{9AFF9A}Se vocк for um {C6E2FF}'Homem' {9AFF9A}clique em {C6E2FF}'Masculino'{9AFF9A}.\n\n{9AFF9A}Se vocк for uma {FFB5C5}'Mulher' {9AFF9A}clique em {FFB5C5}'Feminino'{9AFF9A}.\n\n{FFE4C4}========================================", "Masculino", "Feminino");
}
format(StringContas, sizeof(StringContas), "VirtualStreet/Contas/%s.txt", Nome(playerid));
if(DOF2_IsSet("VirtualStreet/Admins.txt", Nome(playerid)))
{
PlayerDados[playerid][Admin] = DOF2_GetInt("VirtualStreet/Admins.txt", Nome(playerid));
}
ChecarTempoJogado(playerid);
//SetTimerEx("VerificarPreso", 1000, false, "i", playerid);
CheckInfoOrg_Thiago(playerid);
gTeam[playerid] = PlayerDados[playerid][pTeam]; //Set the Team
PlayerDados[playerid][pTeam] = 3;
if(gTeam[playerid] == 3)
{
if(PlayerDados[playerid][MembroOrg] > 0 || PlayerDados[playerid][LiderOrg] > 0)
{
// Policia Militar
if(PlayerDados[playerid][MembroOrg] == 2) { SetSpawnInfo(playerid, 11, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 11; gTeam[playerid] = 11;
}
// Groove Street
else if(PlayerDados[playerid][MembroOrg] == 3) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
//Ballas
else if(PlayerDados[playerid][MembroOrg] == 4) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
//Los Vagos
else if(PlayerDados[playerid][MembroOrg] == 5) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
//Governo
else if(PlayerDados[playerid][LiderOrg] == 1) { SetSpawnInfo(playerid, 11, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 11; gTeam[playerid] = 11;
}
//Policia Militar
else if(PlayerDados[playerid][LiderOrg] == 2) { SetSpawnInfo(playerid, 11, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 11; gTeam[playerid] = 11;
}
//Groove Street
else if(PlayerDados[playerid][LiderOrg] == 3) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
//Ballas
else if(PlayerDados[playerid][LiderOrg] == 4) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
//Los Vagos
else if(PlayerDados[playerid][LiderOrg] == 5) { SetSpawnInfo(playerid, 10, PlayerDados[playerid][SkinJogador],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerDados[playerid][pTeam] = 10; gTeam[playerid] = 10;
}
SpawnPlayer(playerid);
}
}
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=
return 1;
}
PHP код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
//SetPlayerHealth(playerid, 100.0);
if(PlayerDados[playerid][MembroOrg] == 1 || PlayerDados[playerid][LiderOrg] == 1)//Prefeito
{
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 354.8267,154.4102,1025.7964);
PlayerDados[playerid][Interior] = 3;
SetPlayerArmour(playerid, 100);
SetPlayerWantedLevel(playerid, 0);
LocalPrefeitura[playerid] = 1;
//ClearChatbox(playerid, 100);
SetPlayerToTeamColor(playerid);
return true;
}
if(PlayerDados[playerid][MembroOrg] == 2 || PlayerDados[playerid][LiderOrg] == 2)//Policia Militar
{
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -1615.4965,673.9544,-4.9063);
PlayerDados[playerid][Interior] = 0;
SetPlayerArmour(playerid, 100);
SetPlayerWantedLevel(playerid, 0);
SetPlayerFacingAngle(playerid,360);
//ClearChatbox(playerid, 100);
SetPlayerToTeamColor(playerid);
return true;
}
if(PlayerDados[playerid][MembroOrg] == 3 || PlayerDados[playerid][LiderOrg] == 3)//Groove Street
{
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2459.0842,774.8869,35.1719);
PlayerDados[playerid][Interior] = 0;
SetPlayerArmour(playerid, 100);
SetPlayerFacingAngle(playerid,0);
//ClearChatbox(playerid, 100);
SetPlayerToTeamColor(playerid);
return true;
}
if(PlayerDados[playerid][MembroOrg] == 4 || PlayerDados[playerid][LiderOrg] == 4)//Ballas
{
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2467.7896,136.8996,35.1719);
PlayerDados[playerid][Interior] = 0;
SetPlayerArmour(playerid, 100);
SetPlayerFacingAngle(playerid,314.9683);
//ClearChatbox(playerid, 100);
SetPlayerToTeamColor(playerid);
return true;
}
if(PlayerDados[playerid][MembroOrg] == 5 || PlayerDados[playerid][LiderOrg] == 5)//Los Vagos
{
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2519.9216,1214.1395,37.4283);
PlayerDados[playerid][Interior] = 0;
SetPlayerArmour(playerid, 100);
SetPlayerFacingAngle(playerid,8.3925);
//ClearChatbox(playerid, 100);
SetPlayerToTeamColor(playerid);
return true;
}
else
{
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,-1973.3794,137.7854,27.6875);
SetPlayerFacingAngle(playerid,90.0);
SetCameraBehindPlayer(playerid);
SetPlayerHealth(playerid, 100.0);
SetPlayerSkin(playerid, PlayerDados[playerid][SkinJogador]);
SetPlayerToTeamColor(playerid);
return true;
}
}
return true;
}