Morre depois que mata
#1

galera criei um sistema de guerra aki so que quando eu mato eu morro junto
olha code
pawn Код:
//spawn
if(EmGuerra[playerid] == 1 )
   {
   new R2 = random(sizeof(GuerraSpawns));
   SetPlayerTeam(playerid, NO_TEAM);
   SetPlayerPos(playerid,GuerraSpawns[R2][0],GuerraSpawns[R2][1],GuerraSpawns[R2][2]);
   ResetPlayerWeapons(playerid);
   GivePlayerWeapon(playerid, 24 , 9999);
   GivePlayerWeapon(playerid, 26 , 9999);
   GivePlayerWeapon(playerid, 34 , 9999);
   GivePlayerWeapon(playerid, 16 , 9999);
   GivePlayerWeapon(playerid, 31 , 9999);
   GivePlayerWeapon(playerid, 32 , 9999);
   GivePlayerWeapon(playerid, 34 , 9999);
   SetPlayerHealth(playerid, 100);
   SetPlayerArmour(playerid, 100);
   }
    if (EmGuerra[playerid] > 0)
    {
    VerificaGuerra(playerid,INVALID_PLAYER_ID); // X1
    }
//death
    if (EmGuerra[playerid] > 0)
    {
        VerificaGuerra(playerid,killerid); // X1
        return 1;
    }
//connect
if (EmGuerra[playerid] > 0)     VerificaGuerra(playerid, INVALID_PLAYER_ID); // X1
//disconnect
    if (EmGuerra[playerid] > 0)
    {
    VerificaGuerra(playerid, INVALID_PLAYER_ID); // X1
    }
//cmd
if (strcmp("/irguerra", true))
        {
        if(EmDuelo[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "Vocк esta em um duelo e nгo pode usar comandos");return 1;}
        if(EmSniper[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "Vocк esta na arena de sniper e nгo pode usar comandos");return 1;}
        if(EmGuerra[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "Vocк ja esta na guerra cavalo");return 1;}
        new R2 = random(sizeof(GuerraSpawns));
        SetPlayerPos(playerid,GuerraSpawns[R2][0],GuerraSpawns[R2][1],GuerraSpawns[R2][2]);
        EmGuerra[playerid] = 1;
        SetPlayerTeam(playerid, NO_TEAM);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, 256, "~ Info ~ %s moveu-se para a guerra! /irguerra",pName );SendClientMessageToAll(0x59E000AA, string);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 24 , 9999);
        GivePlayerWeapon(playerid, 26 , 9999);
        GivePlayerWeapon(playerid, 34 , 9999);
        GivePlayerWeapon(playerid, 16 , 9999);
        GivePlayerWeapon(playerid, 31 , 9999);
        GivePlayerWeapon(playerid, 32 , 9999);
        GivePlayerWeapon(playerid, 34 , 9999);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        GameTextForPlayer(playerid,"~w~Bem Vindo a ~n~~r~guerra~n~ para sair use /sairguerra",5000,5);
        return 1;
        }
        if(strcmp("/sairguerra", true))
        {
        if(EmDuelo[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "Vocк esta em um duelo e nгo pode usar comandos");return 1;}
        if(EmSniper[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "Vocк esta na arena de sniper e nгo pode usar comandos");return 1;}
        if(EmGuerra[playerid] == 0){SendClientMessage(playerid, 0xFF6F28AA, "Vocк nao esta na guera cavalo");return 1;}
        EmGuerra[playerid] = 0;
        SpawnPlayer(playerid);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "~ Info ~ %s saiu da guerra! /sairguerra",pName );SendClientMessageToAll(0x59E000AA, string);
        return 1;
        }
//stock
stock VerificaGuerra(playerid,killerid) // X1
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
new namekiller[MAX_PLAYER_NAME];
    GetPlayerName(killerid, namekiller, sizeof(pName));
    if (EmGuerra[playerid] == 0) return 1;
    new strdue[128];
    if (EmGuerra[playerid] > 0)
    {
        if (killerid == INVALID_PLAYER_ID)
        {
            SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
            format(strdue,sizeof(strdue),"~ Info ~ %s(%d) se matou na Guerra", pName, playerid);
            SendClientMessageToAll(0x59E000AA, strdue);
        }
        else
        {
            format(strdue,sizeof(strdue),"~ Info ~ %s(%d) morreu na Guerra para %s(%d)", pName, playerid, namekiller);
            SendClientMessageToAll(0x59E000AA, strdue);
            GivePlayerMoney(killerid, 4000);
            PlayerInfo[killerid][pMatou]++;
            PlayerInfo[playerid][pMorreu]++;
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        }
        return 1;
    }
    return 1;
}
se alguem puder me ajudar eu agradeзo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)