SA-MP Forums Archive
[HELP ME]Hello i need help on this simple DM kicker. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP ME]Hello i need help on this simple DM kicker. (/showthread.php?tid=253391)



[HELP ME]Hello i need help on this simple DM kicker. - marnickx - 06.05.2011

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.


Re: [HELP ME]Hello i need help on this simple DM kicker. - Stigg - 06.05.2011

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



Re: [HELP ME]Hello i need help on this simple DM kicker. - [DM]Kane - 06.05.2011

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;
}



Re: [HELP ME]Hello i need help on this simple DM kicker. - marnickx - 06.05.2011

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


Re: [HELP ME]Hello i need help on this simple DM kicker. - [DM]Kane - 06.05.2011

Haha okay
Try it out soon


Re: [HELP ME]Hello i need help on this simple DM kicker. - marnickx - 06.05.2011

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.


Re: [HELP ME]Hello i need help on this simple DM kicker. - marnickx - 09.05.2011

kane it works thnx man