10.04.2012, 17:54
Help me,please!Аfter death of the player,the chat and all scripts of the server is switched off.
public OnPlayerSpawn(playerid) { if(GetPlayerSkin(playerid) == 124 || GetPlayerSkin(playerid) == 125 || GetPlayerSkin(playerid) == 126) { switch(Player[playerid][pVip] >= 1) { case 0: { SetPlayerHealth(playerid, -100.0); ForceClassSelection(playerid); SendClientMessage(playerid,-1,"Вы не VIP игрок, выбирайте другой скин!");} } } new rand = random(sizeof(gRandomPlayerSpawns)); SetPlayerScore(playerid,Player[playerid][pScore]); SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); SetPlayerFacingAngle(playerid, gRandomPlayerSpawns[rand][3]); ResetPlayerMoney(playerid); GivePlayerMoney(playerid,3500); ShowPlayerDialog(playerid, radio, DIALOG_STYLE_MSGBOX, "Unlimited FM", "Unlimited FM - радио станция к которой подключен наш серверю\nВы хотите подключиться к радиостанции?", "Да", "Нет"); return 1; } public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); GivePlayerMoney(killerid,1500); GivePlayerMoney(playerid, -0); return 1; }
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
{
new VictimName[24], KillerName[24], Msg[128];
GetPlayerName(playerid, VictimName, sizeof(VictimName));//get names of the victim
GetPlayerName(killerid, KillerName, sizeof(KillerName));//get names of the killer
GivePlayerMoney(killerid,1500);//your money code for the killer, i removed the victim one cause you had -0 so you dont need it there
format(Msg, 128, "You've killed %s", VictimName);//send a message to the killer that he killed the victim
SendClientMessage(killerid, 0xFFFFFFFF, Msg);
format(Msg, 128, "You've been killed by %s", KillerName);//send a message to the victim that the killer killed him.
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
SendDeathMessage(killerid, playerid, reason);
}
return 1;
}