24.01.2013, 22:57
Gostaria de uma FS, quando a pessoa morre, aparecer no chat pra pessoa: " Vocк foi morto por: %s Arma: s% Hora/dia: %s " Para servidor RPG, se for possнvel.
Obrigado.

Obrigado.
public OnPlayerDeath(playerid, killerid, reason)
{
new name[MAX_PLAYER_NAME], string[128], Hour, Minute, Second;
GetPlayerName(killerid, name, sizeof(name));
gettime(Hour, Minute, Second);
format(string, sizeof(string),"Vocк foi morto por %s pela arma %d as %d:%d",name,GetPlayerWeapon(killerid),Hour,Minute);
SendClientMessage(playerid, -1, string);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new String[95], NomeArma[25], Nome[25], Hora, Minuto, Segundo; //Cria as variбveis para formatar a string, pegar o nome da arma, nome do assassino e as horas
GetWeaponName(GetPlayerWeapon(killerid), NomeArma, 25); //Pega o nome da arma e armazena na variбvel NomeArma
GetPlayerName(killerid, Nome, 25); // Pega o nome do assassino e armazena na variavel Nome
gettime(Hora, Minuto, Segundo); // Pega a hora e armazena nas variaveis
format(String, sizeof(String), "Voce foi morto por %s. Arma: %s. Hora: %d:%d:%d", Nome, NomeArma, Hora, Minuto, Segundo); //Formata a string
SendClientMessage(playerid, 0x00FF00AA, String); //Manda a mensagem pro player que foi assassinado
return 1;
}
pawn Код:
|
pawn Код:
|
public OnPlayerDeath(playerid, killerid, reason)
{
new String[95], NomeArma[25], Nome[25], Hora, Minuto, Segundo; //Cria as variбveis para formatar a string, pegar o nome da arma, nome do assassino e as horas
GetWeaponName(GetPlayerWeapon(killerid), NomeArma, 25); //Pega o nome da arma e armazena na variбvel NomeArma
GetPlayerName(killerid, Nome, 25); // Pega o nome do assassino e armazena na variavel Nome
gettime(Hora, Minuto, Segundo); // Pega a hora e armazena nas variaveis
if(playerid == killerid)
{
format(String, sizeof(String), "Vocк se suicidou. Arma: Nenhuma. Hora: %d:%d:%d", Hora, Minuto, Segundo); //Formata a string
SendClientMessage(playerid, 0x00FF00AA, String); //Manda a mensagem pro kamikaze (player que se suicidou)
}
else
{
format(String, sizeof(String), "Voce foi morto por %s. Arma: %s. Hora: %d:%d:%d", Nome, NomeArma, Hora, Minuto, Segundo); //Formata a string
SendClientMessage(playerid, 0x00FF00AA, String); //Manda a mensagem pro player que foi assassinado
}
return 1;
}
pawn Код:
|
public OnPlayerDeath(playerid, killerid, reason) { if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); } else { //SendDeathMessage(killerid,playerid,reason); } if(PlayerInfo[killerid][pJailed] == 2 && PlayerInfo[playerid][pJailed] == 2) { SendClientMessage(killerid, COLOR_RED,"Vocк foi Kickado por Cometer DM na Cela Admin."); Kick(killerid); //return 1; } new Float:px,Float:py,Float:pz; PlayerInactivity[playerid] = 0; DropWeapons(playerid); DropVida(playerid); HaveTaser[playerid] = 0; SetPVarInt(playerid, "spawned", false); gPlayerSpawned[playerid] = 0; PlayerInfo[playerid][pLocal] = 255; GetPlayerPos(playerid, px, py, pz); spawnado[playerid] = 0; if (gPlayerTerminal[playerid] != 0) { BusrouteEnd(playerid); } if(PlayerPaintballing[killerid] == 0) { SetPlayerCriminal(killerid, 255, "Assasinato"); PlayerInfo[killerid][pKills] += 1; } if(TendoGuerra == 1 && IsPlayerInTerritorio(playerid) && IsPlayerInTerritorio(killerid)) { if(PlayerInfo[killerid][pMembro] == 3 || PlayerInfo[killerid][pLider] == 3) { if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6) { Territorio[talmortos] += 1; } if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15) { Territorio[almortos] += 1; } if(PlayerInfo[playerid][pMembro] == 28 || PlayerInfo[playerid][pLider] == 28) { Territorio[hamamortos] += 1; } } if(PlayerInfo[killerid][pMembro] == 6 || PlayerInfo[killerid][pLider] == 6) { if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) { Territorio[exemortos] += 1; } if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15) { Territorio[almortos] += 1; } if(PlayerInfo[playerid][pMembro] == 28 || PlayerInfo[playerid][pLider] == 28) { Territorio[hamamortos] += 1; } } if(PlayerInfo[killerid][pMembro] == 15 || PlayerInfo[killerid][pLider] == 15) { if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) { Territorio[exemortos] += 1; } if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6) { Territorio[talmortos] += 1; } if(PlayerInfo[playerid][pMembro] == 28 || PlayerInfo[playerid][pLider] == 28) { Territorio[hamamortos] += 1; } } if(PlayerInfo[killerid][pMembro] == 28 || PlayerInfo[killerid][pLider] == 28) { if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) { Territorio[hamamortos] += 1; } if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6) { Territorio[talmortos] += 1; } if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15) { Territorio[almortos] += 1; } } }