[HELP ME]Hello i need help on this simple DM kicker.
#1

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(playerid != killerid)
    {
    new pname[MAX_PLAYER_NAME], string[256];
    GetPlayerName(killerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s was kicked for deathmatching!", pname);
    SendClientMessageToAll(COLOR_RED, string);
    Kick(killerid);
    }
    return 1;
}
I got the idea it works fine but when i die so suicide or kill myself then it says was kicked for deathmatching how can i prevent this because suiciding isnt deadmatch.
Reply
#2

Try:
pawn Код:
new IsPlayerInDeathmatch[MAX_PLAYERS];
Then you can use:
pawn Код:
if(IsPlayerInDeathmatch[playerid] == 1)
{
//blah blah
Reply
#3

Not sure,but try this:


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(playerid==INVALID_PLAYER_ID || killerid==INVALID_PLAYER_ID)
    {
    }
    else if(playerid != killerid)
    {
    new pname[MAX_PLAYER_NAME], string[256];
    GetPlayerName(killerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s was kicked for deathmatching!", pname);
    SendClientMessageToAll(COLOR_RED, string);
    Kick(killerid);
    }
    else
   {
    }
    return 1;
}
Reply
#4

Thnx Kane it works i dont know if it still kicks other peeps if they dm but ill find out on a day.
Reply
#5

Haha okay
Try it out soon
Reply
#6

problem is i dont have samp server yet and if i got then i got no players :P so im gonna do my best to get that.
Reply
#7

kane it works thnx man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)