Team Kill
#1

pawn Код:
PnPlayerDaeth...
{
    if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
    {
        Kick(killerid); //Kick the team killer
        return 1;
    }
}
Why is this not working?
Reply
#2

try this..

pawn Код:
{
    if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
    {
        SendDeathMessage(killerid,playerid,reason);//Remove if you dont want team kills to show
        Kick(killerid); //Kick the team killer
    }
    else
   {
       SendDeathMessage(killerid,playerid,reason);
   }
   return 1;
}
Reply
#3

Hey try this your wrote Pn Btw its On And its Death Not Daeth
Код:
public OnPlayerDeath
{
    if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
    {
        Kick(killerid); //Kick the team killer
        return 1;
    }
}
Reply
#4

Nvm....im retarded, sorry should of paid more attention
Reply
#5

I was in a hurry when i posted fist post..

Here is my code:
pawn Код:
public OnPlayerDeath(playerid, killerid)
{
    //Some stuff over here... SendDeathMessage and other things
    if(gTeam[killerid] > 6 && gTeam[playerid] > 0)
    {
        new string[128];
        new wantedlevel = GetPlayerWantedLevel(killerid);
        SetPlayerWantedLevel(killerid, wantedlevel +10);

        SendClientMessage(playerid, COLOR_RED, "Murder!, You killed a cop or whatever!");
        format(string, sizeof(string), "Wanted Level %i", wantedlevel);
        SendClientMessage(killerid, GetPlayerColor(killerid), string);
        return 1;
    }
    else
    {
        if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
        {
            new string[128];
            SendClientMessage(playerid, COLOR_ERROR, "(TEAM KILLER)");
           
            PlayerData[killerid][TeamKills] ++;
           
            if(PlayerData[killerid][TeamKills] == 3)
            {
                PlayerData[killerid][TeamKills] = 0;
                Kick(killerid);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by YungGee
Посмотреть сообщение
Ahh..You mean ??

PS: Is this is how you gained your post count? Posting "stupid" / "useless" posts?

-.-

"Grow Up People FFS"
He posted something wrong, so he edited his post because he didnt read the topic...

But back to my problem , look at two post up ^
Reply
#7

Quote:
Originally Posted by YungGee
Посмотреть сообщение
OnTopic: Oh now it makes sence i just seen 1 page with 1 un-releated comment..my bad..

OffTopic:

What exactly is the problem? And post all the code that has the problems..
This is not working
When i kill a Cop when i am army, Then nothing happends, but it should say "(TEAM KILLER)"
pawn Код:
public OnPlayerDeath(playerid, killerid)
{
    //Some stuff over here... SendDeathMessage and other things
    if(gTeam[killerid] > 6 && gTeam[playerid] > 0)
    {
        new string[128];
        new wantedlevel = GetPlayerWantedLevel(killerid);
        SetPlayerWantedLevel(killerid, wantedlevel +10);

        SendClientMessage(playerid, COLOR_RED, "Murder!, You killed a cop or whatever!");
        format(string, sizeof(string), "Wanted Level %i", wantedlevel);
        SendClientMessage(killerid, GetPlayerColor(killerid), string);
        return 1;
    }
    else
    {
        if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
        {
            new string[128];
            SendClientMessage(playerid, COLOR_ERROR, "(TEAM KILLER)");
           
            PlayerData[killerid][TeamKills] ++;
           
            if(PlayerData[killerid][TeamKills] == 3)
            {
                PlayerData[killerid][TeamKills] = 0;
                Kick(killerid);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#8

First reason:
Код:
SendClientMessage(playerid, COLOR_ERROR, "(TEAM KILLER)");
Shouldn't it be:
Код:
SendClientMessage(killerid, COLOR_ERROR, "(TEAM KILLER)");
Second reason:
Код:
if(IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid) && IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid))
I really doubt that an AND placed in that way would work (It won't work unless playerid is a cop)... try this:
Код:
if((IsPlayerCop(killerid) || IsPlayerArmy(killerid) || IsPlayerSwat(killerid)) && ((IsPlayerCop(playerid) || IsPlayerArmy(playerid) || IsPlayerSwat(playerid)))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)