20.10.2017, 16:27
Alguem sabe oque posso fazer, quando um player morre ou ele vai preso, exemplo ele й preso ai vai pra cadeia e passa 2 segundos ele toma spawn bugado com um cigarro na mгo.
stock OnPlayerDeathEx(playerid, killerid, reason) { if(IsPlayerNPC(playerid)){ SetPlayerVirtualWorld(playerid, 0); return SpawnPlayer(playerid); } new string[256]; SendDeathMessage(killerid,playerid,reason); if(killerid == Playersx1[0] || killerid == Playersx1[1]){ if((killerid == Playersx1[0] && playerid == Playersx1[1]) || (killerid == Playersx1[1] && playerid == Playersx1[0])){ SendClientMessageToAll(COLOR_DBLUE, "|________________| Evento de x1 |________________| "); format(string, sizeof string, "..::Evento de x1::.. %s venceu %s com o tempo de %s", NomePlayer(killerid), NomePlayer(playerid), ConvertTime(gettime()-tempox1)); SendClientMessageToAll(COLOR_DBLUE, string); Playersx1[0] = 999; Playersx1[1] = 999; return 1; } } if(GetPVarInt(playerid,"roped") == 1) { for(new destr2=0;destr2<=ropelength;destr2++) { DestroyDynamicObject(r0pes[playerid][destr2]); } SetPVarInt(playerid,"roped",0); DisablePlayerCheckpoint(playerid); } if(MecanicMission[playerid]) { EndMission(playerid); } if(PlayerPaintballing[playerid] != 0) { PlayerPaintballKills[killerid] ++; if(PlayerPaintballKills[killerid] > PaintballWinnerKills) { PaintballWinner = killerid; PaintballWinnerKills = PlayerPaintballKills[killerid]; foreach(Player, i) { if(PlayerPaintballing[i] != 0) { format(string, sizeof(string), "* %s estб em 1є com %d Kills.",PlayerName(killerid),PaintballWinnerKills); SendClientMessage(i, COLOR_WHITE, string); } } } return 1; } SBizzInfo[12][sbTill] += 100; ExtortionSBiz(12, 100); new Float:pPosX, Float:pPosY, Float:pPosZ; GetPlayerPos(playerid, pPosX, pPosY, pPosZ); for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++) { GetPlayerWeaponData(playerid, i_slot, gun, ammo); switch(gun){ case 16, 18, 44, 45, 35: continue; } if(gun != 0 && ammo != 0) CreateDroppedGun(gun, ammo, pPosX+random(3)-random(3), pPosY+random(3)-random(3), pPosZ); } if(PlayerInfo[playerid][pExplosivos]){ CreateDroppedExplosivo(playerid); PlayerInfo[playerid][pExplosivos] = 0; } if(WantedPoints[playerid] > 0) { new Wanted = WantedPoints[playerid]; new diecash = WantedPoints[playerid]*100; format(string, sizeof(string), "Vocк perdeu R$%d por morrer com Nivel De Procura: %d.", diecash, Wanted); SendClientMessage(playerid, COLOR_YELLOW, string); GivePlayerMoney(playerid, - diecash); } if(GuerraMorro[gGuerra]){ gCheckPontos(playerid, killerid); } CheckPontosTr(playerid, killerid); if(NaCamera[playerid] > 1) { TextDrawHideForPlayer(playerid, Hidealto2); TextDrawHideForPlayer(playerid, Hidebaixo2); NaCamera[playerid] = 0; } RemovePlayerAttachedObject(playerid,Slot_Escudo); new Float:px,Float:py,Float:pz; gPlayerSpawned[playerid] = 0; if(!admtrampando[playerid] && !helpertrampando[playerid] && !PlayerInfo[playerid][pVIP]) { new dia, mes, ano, hora, minuto, segundo; getdate(ano, mes, dia); gettime(hora, minuto, segundo); PlayerInfo[playerid][pHospital] = true; if(IsPlayerInGuerra(playerid)) { PlayerInfo[playerid][pTempoHospital] = 5; }else{ PlayerInfo[playerid][pTempoHospital] = TempoHospital; } PlayerInfo[playerid][pHAjustado] = false; HospId[playerid] = 999; customorte[playerid] = 1000; SendClientMessage(playerid, TEAM_BALLAS_COLOR, "Vocк morreu e serб internado no hospital regional mais proximo de vocк."); SendClientMessage(playerid, TEAM_BALLAS_COLOR, "Uma equipe mйdica ira cuidar de vocк atй que vocк se recupere totalmente."); format(string, sizeof string, "Faltam %d segundos para vocк receber alta do hospital regional de Los Santos, custo: R$%d", PlayerInfo[playerid][pTempoHospital], customorte[playerid]); SendClientMessage(playerid, TEAM_BALLAS_COLOR, string); } PlayerInfo[playerid][pLocal] = 255; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerPos(playerid, px, py, pz); spawnado[playerid] = 0; if(PlayerInfo[playerid][pLevel] >= 3 && !IsAMedicos(playerid)) { foreach(Player, i) { if(IsAMedicos(i)) { PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~w~Pessoa ~r~Morta~n~Bonus~g~R$200", 5000, 1); GivePlayerMoney(i, 200); } } } if(Sequestrado[playerid] == 1) { format(string, sizeof(string), "[Fim Triste] A vнtima de sequestro %s estб morta", NomePlayer(playerid)); SendClientMessageToAll(COLOR_DBLUE, string); Sequestrado[playerid] = 0; } if (gPlayerTerminal[playerid] != 0) { BusrouteEnd(playerid); } if(killerid != INVALID_PLAYER_ID) { if(!IsPlayerInGuerra(killerid)) { SetPlayerCriminal(killerid, 255, "Assassinato"); PlayerPlaySound(killerid, 1138, 0.0, 0.0, 0.0); } if(reason == 34){ PlayerInfo[killerid][pMatouSniper] ++; } format(string, sizeof string, "* Vocк foi morto por {FFFFFF}%s (%s) {33CCFF}com a arma: {FFFFFF}[%s]", NomePlayer(killerid), GetOrgName(GetPlayerOrg(killerid)), NomeArma(reason)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof string, "* Vocк matou {FFFFFF}%s (%s) {33CCFF}com a arma: {FFFFFF}[%s]", NomePlayer(playerid), GetOrgName(GetPlayerOrg(playerid)), NomeArma(reason)); SendClientMessage(killerid, COLOR_LIGHTBLUE, string); PlayerInfo[killerid][pKills] ++; antifakekill[playerid] ++; SetTimerEx("antifakekill2", 1000,false,"i",playerid); } if(TendoGuerra) { new orgid = GetPlayerOrg(playerid); new orgid2 = GetPlayerOrg(killerid); if((orgid==3||orgid==15||orgid==23||orgid==29) && (orgid2==3||orgid2==15||orgid2==23||orgid2==29)) { if(IsPlayerInGuerra(playerid) && IsPlayerInGuerra(killerid) && orgid != orgid2) { if(orgid2 == 3 && orgid != 29) { PSG[3] += 1; } if(orgid2 == 15) { PSG[15] += 1; } if(orgid2 == 23) { PSG[23] += 1; } if(orgid2 == 29 && orgid != 3) { PSG[3] += 1; } GranaGuerra += 825+random(500); } } } //==================================[SUSPEITO MORTO]=========================// if(WantedPoints[playerid] >= 1 && !IsPlayerInGuerra(playerid) && !IsACop(playerid) && !gPlayerInGuerra(playerid)) { new price = WantedPoints[playerid] * 100; if(IsACop(killerid)) { GivePlayerMoney(playerid, - price); PlayerInfo[playerid][pJailed] = 24; PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(100); format(string, sizeof(string), "* Vocк estб preso por %d Segundos na [Prisгo La Sante], e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price); SendClientMessage(playerid, COLOR_LIGHTRED, string); SetTimerEx("micongela",1000,false,"i",playerid); TogglePlayerControllable(playerid,0); WantedPoints[playerid] = 0; SetPlayerWantedLevelEx(playerid, 0); PlayerInfo[playerid][pAjustado] = false; foreach(Player, i) { if(IsACop(i)) { if(GetPlayerState(i) == 2) { PlayerPlaySound(i, 2134, 0.0, 0.0, 0.0); } else { PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0); } format(string, sizeof string, "~w~Suspeito: ~p~%s ~r~Morto~n~Bonus~g~R$500", NomePlayer(playerid)); GameTextForPlayer(i, string, 5000, 1); GivePlayerMoney(i, 500); } } } } if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11) { DisablePlayerCheckpoint(playerid); gPlayerCheckpointStatus[playerid] = CHECKPOINT_Nenhum; } new caller = Mobile[playerid]; if(caller != 255) { if(caller < 255) { SendClientMessage(caller, COLOR_GRAD2, "Morreram do outro lado da linha...."); CellTime[caller] = 0; CellTime[playerid] = 0; Mobile[caller] = 255; } Mobile[playerid] = 255; CellTime[playerid] = 0; } ClearCrime(playerid); if(PlayerInfo[playerid][pHeadValue] > 0 || PlayerInfo[playerid][pHeadValueT] > 0 || PlayerInfo[playerid][pHeadValueM] > 0) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { if(GetPlayerOrg(killerid) == 8) { if(GoChase[killerid] == playerid) { GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValue]); format(string,sizeof string,"<< Um assassino cumpriu um contrato em %s, pelo preзo de: R$%d >>",NomePlayer(playerid),PlayerInfo[playerid][pHeadValue]); SendClientMessageToAll(COLOR_YELLOW, string); format(string,sizeof string,"<< O Hitman %s matou vocк por um contrato de R$%d >>",NomePlayer(killerid),PlayerInfo[playerid][pHeadValue]); SendClientMessage(playerid, COLOR_LIGHTRED, string); format(string,sizeof string,"* O assassino %s cumpriu um contrato em: %s.",NomePlayer(killerid),NomePlayer(playerid)); SendFamilyMessage(22, COLOR_YELLOW, string); PlayerInfo[playerid][pHeadValue] = 0; GotHit[playerid] = 0; GetChased[playerid] = 999; GoChase[killerid] = 999; PlayerInfo[killerid][pContratos]++; HitmanMatou++; //SetPlayerSkin(killerid, PlayerInfo[killerid][pSkin]); SetPlayerToTeamColor(killerid); if(VendoNick[killerid] == false) { VendoNick[killerid] = true; SendClientMessage(killerid, COLOR_GRAD1, "(( Vocк agora nгo estб mais em modo secreto ))"); foreach(Player, i) { ShowPlayerNameTagForPlayer(i, killerid, true); } } } } else if(GetPlayerOrg(killerid) == 22) { if(GoChase[killerid] == playerid) { GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValueT]); format(string,sizeof string,"<< Um assassino cumpriu um contrato em %s pelo preзo de R$%d >>", NomePlayer(playerid),PlayerInfo[playerid][pHeadValueT]); SendClientMessageToAll(COLOR_YELLOW, string); format(string,sizeof string,"<< O Triad %s matou vocк por um contrato de R$%d, entгo nгo foi DM. >>",NomePlayer(killerid),PlayerInfo[playerid][pHeadValueT]); SendClientMessage(playerid, COLOR_YELLOW, string); format(string,sizeof string,"* O assassino %s cumpriu um contrato em: %s.",NomePlayer(killerid),NomePlayer(playerid)); SendFamilyMessage(22, COLOR_YELLOW, string); PlayerInfo[playerid][pHeadValueT] = 0; GotTri[playerid] = 0; GetChased[playerid] = 999; GoChase[killerid] = 999; PlayerInfo[killerid][pContratos]++; TriadMatou++; //SetPlayerSkin(killerid, PlayerInfo[killerid][pSkin]); SetPlayerToTeamColor(killerid); if(VendoNick[killerid] == false) { VendoNick[killerid] = true; SendClientMessage(killerid, COLOR_GRAD1, "(( Vocк agora nгo estб mais em modo secreto ))"); foreach(Player, i) { ShowPlayerNameTagForPlayer(i, killerid, true); } } } } else if(GetPlayerOrg(killerid) == 25) { if(GoChase[killerid] == playerid) { GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValueM]); format(string,sizeof string,"<< Um assassino cumpriu um contrato em %s pelo preзo de R$%d >>", NomePlayer(playerid),PlayerInfo[playerid][pHeadValueM]); SendClientMessageToAll(COLOR_YELLOW, string); format(string,sizeof string,"<< O Mercenбrio %s matou vocк por um contrato de R$%d, entгo nгo foi DM. >>",NomePlayer(killerid),PlayerInfo[playerid][pHeadValueM]); SendClientMessage(playerid, COLOR_YELLOW, string); format(string,sizeof string,"* O assassino %s cumpriu um contrato em: %s.",NomePlayer(killerid),NomePlayer(playerid)); SendFamilyMessage(25, COLOR_YELLOW, string); PlayerInfo[playerid][pHeadValueM] = 0; GotMer[playerid] = 0; GetChased[playerid] = 999; GoChase[killerid] = 999; PlayerInfo[killerid][pContratos]++; MercMatou++; SetPlayerToTeamColor(killerid); if(VendoNick[killerid] == false) { VendoNick[killerid] = true; SendClientMessage(killerid, COLOR_GRAD1, "(( Vocк agora nгo estб mais em modo secreto ))"); foreach(Player, i) { ShowPlayerNameTagForPlayer(i, killerid, true); } } } } } } return true; }
public OnPlayerDeath(playerid, killerid, reason) { if(pmorto[playerid])return true; if(GetPVarInt(playerid, "inArena")) { new rand; rand = random(sizeof(ArenaTreinoSpawns)); SetPlayerPos(playerid, ArenaTreinoSpawns[rand][0], ArenaTreinoSpawns[rand][1], ArenaTreinoSpawns[rand][2]); SetPlayerFacingAngle(playerid, ArenaTreinoSpawns[rand][3]); SetPlayerInterior(playerid, 15); SetPlayerVirtualWorld(playerid, 0); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 24, 999); GivePlayerWeapon(playerid, 25, 999); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); SetPVarInt(playerid, "inArena", 1); ChatKill[playerid] = true; //SendClientMessage(playerid, COLOR_GREEN, "Vocк estб em uma Arena de Treinos , Casу queirб sair procure um icone de uma arma e aperte 'F'"); rKills[killerid]++; if((rKills[killerid] > rKills[TopPlayer]) || (rKills[killerid] == rKills[TopPlayer] && killerid < TopPlayer)) TopPlayer = killerid; new tString[40]; format(tString, 40, "~g~1| ~w~%s~n~~g~Mortes: ~w~%d", PlayerName(TopPlayer), rKills[TopPlayer]); foreach(Player, i) PlayerTextDrawSetString(i, Textdraw26[i], tString); return 1; } OnPlayerDeathEx(playerid, killerid, reason); TextDrawShowForPlayer(playerid, textmorte[0]); TextDrawShowForPlayer(playerid, textmorte[1]); JoinedHay[playerid] = 0; return 1; }
forward Spawn(playerid);
public Spawn(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
TogglePlayerSpectating(playerid, false);
SetSpawnInfo(playerid, NO_TEAM, GetPlayerSkin(playerid), 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
}
else
{
if(GetPlayerState(playerid) != PLAYER_STATE_WASTED)
{
Eject(playerid);
SpawnPlayer(playerid);
}
}
return 1;
}
forward Eject(playerid);
public Eject(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 0;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+3);
return 1;
}
Isso ocorre pelo uso da funзгo SpawnPlayer apуs o jogador ser morto, usando a funзгo abaixo vocк nгo terб mais esses problemas:
PHP код:
|