10.07.2010, 18:04
(
Последний раз редактировалось [DK]JaloNik; 10.07.2010 в 18:17.
)
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:
and puts this on my kill:
Okay, I now go up to my OnPlayerDeath, and makes these lines:
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:
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]
Thanks!
/JaloNik
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];
pawn Код:
OnPlayerKill[playerid] = 1;
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);
}
Okay, but I get this error:
pawn Код:
(376) : error 029: invalid expression, assumed zero
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;
}
/JaloNik