ello, i have problem with Brutally Wounded (BW) system on Godfather gamemode, i will try to. Well, new player connect to server, creates account and is good, if disconnect and connect to server it automatically gives BW on this player.
Код:
forward Smierc(playerid);
public Smierc(playerid)
{
SendClientMessage(playerid, COLOR_LIGHTRED,"Zginałeś. Odczekaj 45 sekund lub wpisz /akceptujsmierc (doprowadzi do blokady konta)");
SendClientMessage(playerid, COLOR_YELLOW,"Mozesz takze podjac sie reanimacji (/reanimuj). Masz szanse na ocalenie sie odrazu");
SendClientMessage(playerid, COLOR_YELLOW,"Lecz jesli reanimacja sie nie powiedzie to natychmiast zginiesz!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Oczywiscie mozesz odczekac 45 sek. I grac dalej...");
PlayerInfo[playerid][pSmierc] = 1;
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
ret=SetTimerEx("PoBW",45000,false,"d",playerid);
OnPlayerUpdate(playerid);
TextDrawShowForPlayer(playerid, Krew);
return 1;
}
Код:
if (PlayerInfo[playerid][pSmierc] == 1) //BW
{
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"WUZI", "CS_Dead_Guy", 4.0, 0, 1, 1, 1, -1);
SetPlayerCameraPos(playerid, 2786.6846,435.1964,-86.4566);
SetPlayerCameraLookAt(playerid, 2786.6846,435.1964,-86.4566);
SetTimerEx("PoBW",45000,0,"i",playerid);
TextDrawShowForPlayer(playerid, Krew);
return 1;
}
forward PoBW(playerid);
public PoBW(playerid)
{
TextDrawHideForPlayer(playerid, Krew);
SendClientMessage(playerid, COLOR_LIGHTRED,"Zyjesz!");
PlayerInfo[playerid][pSmierc] = 0;
TogglePlayerControllable(playerid,true);
OnPlayerUpdate(playerid);
return 1;
}
forward Smierc(playerid);
public Smierc(playerid)
{
SendClientMessage(playerid, COLOR_LIGHTRED,"Zginałeś. Odczekaj 45 sekund lub wpisz /akceptujsmierc (doprowadzi do blokady konta)");
SendClientMessage(playerid, COLOR_YELLOW,"Mozesz takze podjac sie reanimacji (/reanimuj). Masz szanse na ocalenie sie odrazu");
SendClientMessage(playerid, COLOR_YELLOW,"Lecz jesli reanimacja sie nie powiedzie to natychmiast zginiesz!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Oczywiscie mozesz odczekac 45 sek. I grac dalej...");
PlayerInfo[playerid][pSmierc] = 1;
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
ret=SetTimerEx("PoBW",45000,false,"d",playerid);
OnPlayerUpdate(playerid);
TextDrawShowForPlayer(playerid, Krew);
return 1;
}
forward defreeze1(playerid);
public defreeze1(playerid)
{
TextDrawHideForPlayer(playerid, Krew);
TogglePlayerControllable(playerid,1);
ClearAnimations(playerid);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pSmierc] = 0;
OnPlayerUpdate(playerid);
return 1;
}