Health & Armor On Disconnect -
(_AcE_) - 19.07.2012
How do I make the disconnect message say the following incase a player times out:
(_AcE_) has left the server (Lost Connection) (HP: 100) (Armor: 25)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
First[playerid] = 0;
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "** %s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "** %s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "** %s has left the server. (Kicked)", pname);
}
SendClientMessageToAll(COLOR_ERROR, string);
return 1;
}
Re: Health & Armor On Disconnect -
Littlehelper - 19.07.2012
pawn Код:
switch(reason)
{
case 0: format(string, sizeof(string), "** %s has left the server HP: %0.f Armour %0.f.. (Lost Connection)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
case 1: format(string, sizeof(string), "** %s has left the server HP: %0.f Armour %0.f. (Leaving)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
case 2: format(string, sizeof(string), "** %s has left the server HP %0.f Armour %0.f . (Kicked)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
}
Re: Health & Armor On Disconnect -
(_AcE_) - 19.07.2012
EDIT:
Код:
warning 202: number of arguments does not match definition
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
First[playerid] = 0;
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(isclanwarstarted == 0)
{
switch(reason)
{
case 0: format(string, sizeof(string), "** %s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "** %s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "** %s has left the server. (Kicked/Banned)", pname);
}
}
else if(isclanwarstarted == 1)
{
switch(reason)
{
case 0: format(string, sizeof(string), "** %s has left the server. (Lost Connection)(HP: %0.f) (Armour: %0.f)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
case 1: format(string, sizeof(string), "** %s has left the server. (Leaving)(HP: %0.f) (Armour: %0.f)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
case 2: format(string, sizeof(string), "** %s has left the server. (Kicked/Banned)(HP: %0.f) (Armour: %0.f)", pname, GetPlayerHealth(playerid),GetPlayerArmour(playerid));
}
}
SendClientMessageToAll(COLOR_ERROR, string);
return 1;
}
HELP PLS
Re: Health & Armor On Disconnect -
sampreader - 19.07.2012
new Float:Health;
GetPlayerHealth(playerid, Health);
etc with armour
Re: Health & Armor On Disconnect -
(_AcE_) - 19.07.2012
Yeah, I fixed it, thanks for help though.