(AJUDA) X1 Player fica preso
#1

Seguinte,
Quando o player se mata na x1, o outro que estava com ele fica preso no x1.
Eu gostaria que o player que nгo morreu nгo ficasse trancado no x1, e sim ganhasse a batalha como se ele tivesse matado.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        if(TaX1[playerid] == true)
        {
        new x1matou[MAX_PLAYER_NAME];
        GetPlayerName(killerid, x1matou, sizeof(x1matou));
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        TaX1[playerid] = false;
        TaX1[killerid] = false;
	Playersx1 = 0; // Define que nгo tem mais ninguйm na x1
        SpawnPlayer(killerid);
        SetPlayerArmour(killerid, 100.0);
        SetPlayerHealth(killerid, 100.0);
        format(string, sizeof(string), "[SERVER] %d matou o %d no X1DM!", x1matou, name);
         SendClientMessageToAll(COR_AMARELO, string);
        }
SendDeathMessage(killerid, playerid, reason);
GivePlayerMoney(playerid, -500);
GivePlayerMoney(killerid, 500);
GameTextForPlayer(playerid,"~r~Morto!",4000,3);
return 1;
}
Outro problema й que na hora de mandar a mensagem "[SERVER] %d matou o %d no X1DM!", aparece por exemplo:
"[SERVER] [XPG]MarlonCS matou o 91 no X1DM!"

Aparece um nъmero e nгo o nome do player que morreu.
Reply
#2

format(string, sizeof(string), "[SERVER] %d matou o %s no X1DM!", x1matou, name);
Reply
#3

vlw man, mas e o outro problema? =/
Reply
#4

Coloca dentro do cmd:

pawn Код:
SpawnPlayer(killerid);
Quando o Jogador matar, ele vai ganhar spawn.
Reply
#5

Quote:
Originally Posted by StrondA_
Посмотреть сообщение
Coloca dentro do cmd:

pawn Код:
SpawnPlayer(killerid);
Quando o Jogador matar, ele vai ganhar spawn.
Sim porйm... Se o player se matar dentro da arena, o outro q estava com ele fica preso, consequentimente, nгo ganharб spawn.
Reply
#6

Й meio complicado de se fazer isso... (acho)
Reply
#7

otimizado, o resto й com vocк, se vira

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid == INVALID_PLAYER_ID)
    {
        new string[128];
        format(string, sizeof(string), "[SERVER]: %s(id:%d) se suicidou-se no x1!", Nome(playerid), playerid), SendClientMessageToAll(-1, string);
        for(new i; i < MAX_PLAYERS; i++) if(TaX1[i] == true) SpawnPlayer(TaX1[i]);
    }    
    else
    {
        if(TaX1[playerid] == true)
        {
            TaX1[playerid] = false, TaX1[killerid] = false, Playersx1 = 0, SpawnPlayer(killerid);
            SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0);
            format(string, sizeof(string), "[SERVER] %s matou o %s no X1DM!", Nome(killerid), Nome(playerid)), SendClientMessageToAll(COR_AMARELO, string);
        }
    }
    SendDeathMessage(killerid, playerid, reason);
    GivePlayerMoney(playerid, -500), GivePlayerMoney(killerid, 500);
    GameTextForPlayer(playerid,"~r~Morto!",4000,3);
    return 1;
}

stock Nome(playerid)
{
  new name[MAX_PLAYER_NAME+1];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  return name;
}
Reply
#8

StrondA strondou agora .

Tava nem pensando direito.
Reply
#9

Fiz outros dms seguindo a idйia do Stronda... Porйm, apenas o x1 funcionou. Os demais nгo. Veja como ficou:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        new matou[MAX_PLAYER_NAME+1];
        GetPlayerName(killerid, matou, sizeof(matou));
          if(killerid == INVALID_PLAYER_ID)
           {
		   if(TaX1[playerid] == true){ TaX1[playerid] = false, format(string, sizeof(string), "[SERVER]: %s suicidou-se no x1!", name);
		   SendClientMessageToAll(COR_AMARELO, string), Playersx1 = 0;}
		   for(new i; i < MAX_PLAYERS; i++)
		   if(TaX1[i] == true) {SpawnPlayer(TaX1[i]), TaX1[TaX1[i]] = false, SetPlayerHealth(TaX1[i], 100.0);}
		   if(TaMG[playerid] == true){ TaMG[playerid] = false, format(string, sizeof(string), "[SERVER]: %s suicidou-se no Minigun!", name);
		   SendClientMessageToAll(COR_AMARELO, string), Playersmg = 0;}
		   for(new i; i < MAX_PLAYERS; i++)
		   if(TaMG[i] == true) {SpawnPlayer(TaMG[i]), TaMG[TaMG[i]] = false, SetPlayerHealth(TaMG[i], 100.0);}
		   if(TaSN[playerid] == true){ TaSN[playerid] = false, format(string, sizeof(string), "[SERVER]: %s suicidou-se no SniperDM!", name);
		   SendClientMessageToAll(COR_AMARELO, string), Playerssn = 0;}
		   for(new i; i < MAX_PLAYERS; i++)
		   if(TaSN[i] == true) {SpawnPlayer(TaSN[i]), TaSN[TaSN[i]] = false;}
		   if(Ta69[playerid] == true){ Ta69[playerid] = false, format(string, sizeof(string), "[SERVER]: %s suicidou-se na Бrea 69!", name);
		   SendClientMessageToAll(COR_AMARELO, string), Players69 = 0;}
		   for(new i; i < MAX_PLAYERS; i++)
		   if(Ta69[i] == true) {SpawnPlayer(Ta69[i]), Ta69[Ta69[i]] = false;}
		   if(TaRPG[playerid] == true){ TaRPG[playerid] = false, format(string, sizeof(string), "[SERVER]: %s suicidou-se no RPGDM!", name);
		   SendClientMessageToAll(COR_AMARELO, string), Playersrpg = 0;}
		   for(new i; i < MAX_PLAYERS; i++)
		   if(TaRPG[i] == true) {SpawnPlayer(TaRPG[i]), TaRPG[TaRPG[i]] = false;}
           }
           else
           {
           if(TaX1[playerid] == true){
           TaX1[playerid] = false, TaX1[killerid] = false, TaX1[playerid] = false, Playersx1 = 0, SpawnPlayer(killerid);
           SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0);
           format(string, sizeof(string), "[SERVER] %d matou o %s no X1!", name, matou), SendClientMessageToAll(COR_AMARELO, string);}
           }
           if(TaMG[playerid] == true){
           TaMG[playerid] = false, TaMG[killerid] = false, Playersmg = 0, SpawnPlayer(killerid);
           SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0), GivePlayerWeapon(killerid,38,800);
           format(string, sizeof(string), "[SERVER] %d matou o %s no MinigunDM e recebeu a sua minigun!", matou, name), SendClientMessageToAll(COR_AMARELO, string);
           }
           if(TaSN[playerid] == true){
           TaSN[playerid] = false, TaSN[killerid] = false, Playerssn = 0, SpawnPlayer(killerid);
           SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0), GivePlayerWeapon(killerid,34,1000);
           format(string, sizeof(string), "[SERVER] %d matou o %s no SniperDM e ganhou sua Sniper!", matou, name), SendClientMessageToAll(COR_AMARELO, string);
           }
           if(Ta69[playerid] == true){
           Ta69[playerid] = false, Ta69[killerid] = false, Players69 = 0, SpawnPlayer(killerid);
           SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0);
           format(string, sizeof(string), "[SERVER] %d matou o %s na Бrea 69!", matou, name), SendClientMessageToAll(COR_AMARELO, string);
           }
           if(TaRPG[playerid] == true){
           TaRPG[playerid] = false, TaRPG[killerid] = false, Playersrpg = 0, SpawnPlayer(killerid);
           SetPlayerArmour(killerid, 100.0), SetPlayerHealth(killerid, 100.0), GivePlayerWeapon(killerid,35,1000);
           format(string, sizeof(string), "[SERVER] %d matou o %s no RPG DM e ganhou sua RPG!", matou, name), SendClientMessageToAll(COR_AMARELO, string);
           }
        SendDeathMessage(killerid, playerid, reason);
        GivePlayerMoney(playerid, -500);
        GivePlayerMoney(killerid, 500);
        GameTextForPlayer(playerid,"~r~Morto!",4000,3);
	    new Texto[30], Texto1[30];
	    ProgressaoInfo[killerid][Matou] ++;
	    ProgressaoInfo[playerid][Morreu] ++;
	    ProgressaoInfo[killerid][Pontos] = (ProgressaoInfo[killerid][Matou] - ProgressaoInfo[killerid][Morreu]);
	    ProgressaoInfo[playerid][Pontos] = (ProgressaoInfo[playerid][Matou] - ProgressaoInfo[playerid][Morreu]);
	    format(Texto, sizeof(Texto), "~l~Pontos: ~b~%d", ProgressaoInfo[killerid][Pontos]);
	    TextDrawSetString(ProgressaoInfo[killerid][TPontos], Texto);
	    TextDrawShowForPlayer(killerid, ProgressaoInfo[killerid][TPontos]);
	    format(Texto1, sizeof(Texto1), "~l~Pontos: ~b~%d", ProgressaoInfo[playerid][Pontos]);
	    TextDrawSetString(ProgressaoInfo[playerid][TPontos], Texto1);
	    TextDrawShowForPlayer(playerid, ProgressaoInfo[playerid][TPontos]);
	    AtualizarText(playerid);
        AtualizarText(killerid);
        TextDrawHideForPlayer(playerid,txtTimeDisp);
        TextDrawHideForPlayer(playerid,txtDateDisp);
        if(IsPlayerConnected(killerid))
            {
            Matouu[killerid]++;
            }
            Morreuu[playerid]++;
  return 1;
}
Reply
#10

Quк que cк fez ai...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)