How do I do this
#1

Hey guys!

Okay, I've been trying out stuff in some time now, I can't find the solution. (I have searched on forum / wiki too..)
Here's what I want.
I've made /kill commando, simple using SetPlayerHealth. I want it to make a string saying "%s has commited suciside!" when the /kill sets the healt to 0 on OnPlayerDeath, so I define this:
pawn Код:
new OnPlayerKill[MAX_PLAYERS];
and puts this on my kill:
pawn Код:
OnPlayerKill[playerid] = 1;
Okay, I now go up to my OnPlayerDeath, and makes these lines:
pawn Код:
if OnPlayerKill[playerid] == 1
    {
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has committed suicide.", pName);
    SendClientMessageToAll(COLOR_GREY, string);
    }
Note: I know I just can add it to /kill, but that's not what I want. Because of spam!


Okay, but I get this error:
pawn Код:
(376) : error 029: invalid expression, assumed zero
Line 376 is the { after my if.
I've tried to change the { directions, but I can't find how to make it work.

[k]My whole OnPlayerDeath public, if you think there's something with that?[/k]
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    {
    OnPlayerDeathSpawn[playerid] = 1;
    SendDeathMessage(killerid,playerid,reason);
    }
    if OnPlayerKill[playerid] == 1
    {
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has committed suicide.", pName);
    SendClientMessageToAll(COLOR_GREY, string);
    }
    return 1;
}
Thanks!
/JaloNik
Reply


Messages In This Thread
[SOLVED] How do I do this - by [DK]JaloNik - 10.07.2010, 18:04
Re: How do I do this - by Kar - 10.07.2010, 18:10
Re: How do I do this - by Mauzen - 10.07.2010, 18:14
Re: How do I do this - by [DK]JaloNik - 10.07.2010, 18:16
Re: How do I do this - by Kar - 10.07.2010, 18:17

Forum Jump:


Users browsing this thread: 3 Guest(s)