DoN_SancheS
02.12.2016, 21:51
Помогите пожалуйста понять как правильно разместить вот это
new pLastAnimIndex[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
new animlib[32], animname[32];
GetAnimationName(pLastAnimIndex[playerid],animlib,32,animname,32);
if(strcmp(animlib, "PED", true) != 0) ClearAnimations(playerid);
return 1;
}
к вот этому (а то error выдает и нечего не получается)
publics OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
DisablePlayerCheckpoint(playerid);
if(Animka[playerid] == true)
{
TextDrawHideForPlayer(playerid,Anim[playerid]);
Animka[playerid] = false;
}
if(PlayerInfo[killerid][pMask] == 1 || PlayerInfo[killerid][pJailed] > 0)
{
if(GoChase[killerid] == playerid)
{
SCM(playerid,YELLOW,"Íè÷åãî ëè÷íîãî, òåáÿ çàêàçàëè.");
}
}
else
{
SendDeathMessage(killerid, playerid, reason);
}
if(InZone[playerid] == true)
{
ZonePeople --;
InZone[playerid] = false;
SetPlayerHealthAC(killerid, 100);
}
OnPlayerSave(killerid);
ServerResetPlayerWeaponsAC(playerid);
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
gPlayerSpawned[playerid] = 0;
PlayerInfo[playerid][pLocal] = 255;
if(killerid != 255)
{
if(GetPlayerState(killerid) == 2)
{
if(ProxDetectorS(20, killerid, playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SCM(killerid, LBLUE, "Òû íàðóøèë ïðàâèëî ñåðâåðà (Drive By).");
format(string, 256, "Creative: %s[%d] íàðóøèë ïðàâèëî ñåðâåðà (Drive By).",PlayerName[killerid],killerid);
ABroadCast(RED,string,1);
}
}
}
}
if(IsACop(killerid))
{
if(GetPlayerWantedLevel(playerid) > 0 && PlayerInfo[killerid][pJailTime] == 0 && InZone[killerid] == false)
{
if(PlayerInfo[playerid][pLevel] >= 1)
{
new price = PlayerInfo[playerid][pWanted] * 50;
format(string, sizeof(string), "~g~+$%d", price);
GameTextForPlayer(killerid, string, 5000, 1);
PlayerInfo[killerid][pPayCheck] += price;
PlayerInfo[killerid][pFstats] += price;
}
else
{
GameTextForPlayer(killerid, "~g~+$0", 5000, 1);
SCM(playerid, GREY, "Çà óáèéñòâî èãðîêà 0 óðîâíÿ, íàãðàäû íåò.");
}
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = PlayerInfo[playerid][pWanted]*300;
format(string, sizeof(string), "%s[%d] ïîñàäèë òåáÿ íà %d ìèíóò(û).",PlayerName[killerid],killerid, PlayerInfo[playerid][pJailTime]/60);
SCM(playerid, LBLUE, string);
PlayerInfo[playerid][pWanted] = 0;
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
}
}
if(PlayerInfo[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(PlayerInfo[killerid][pLeader] == 8 || PlayerInfo[killerid][pMember] == 8)
{
if(GoChase[killerid] == playerid)
{
GiveMoney(killerid, PlayerInfo[playerid][pHeadValue]);
format(string,128,"Õèòìàí %s âûïîëíèë çàêàç íà %s.",PlayerName[killerid],PlayerName[playerid]);
SendRadioMessage(8, YELLOW, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
}
}
}
}
killerid = INVALID_PLAYER_ID;
SetPlayerToTeamColor(playerid);
return true;
}
new pLastAnimIndex[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
new animlib[32], animname[32];
GetAnimationName(pLastAnimIndex[playerid],animlib,32,animname,32);
if(strcmp(animlib, "PED", true) != 0) ClearAnimations(playerid);
return 1;
}
к вот этому (а то error выдает и нечего не получается)
publics OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
DisablePlayerCheckpoint(playerid);
if(Animka[playerid] == true)
{
TextDrawHideForPlayer(playerid,Anim[playerid]);
Animka[playerid] = false;
}
if(PlayerInfo[killerid][pMask] == 1 || PlayerInfo[killerid][pJailed] > 0)
{
if(GoChase[killerid] == playerid)
{
SCM(playerid,YELLOW,"Íè÷åãî ëè÷íîãî, òåáÿ çàêàçàëè.");
}
}
else
{
SendDeathMessage(killerid, playerid, reason);
}
if(InZone[playerid] == true)
{
ZonePeople --;
InZone[playerid] = false;
SetPlayerHealthAC(killerid, 100);
}
OnPlayerSave(killerid);
ServerResetPlayerWeaponsAC(playerid);
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
gPlayerSpawned[playerid] = 0;
PlayerInfo[playerid][pLocal] = 255;
if(killerid != 255)
{
if(GetPlayerState(killerid) == 2)
{
if(ProxDetectorS(20, killerid, playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SCM(killerid, LBLUE, "Òû íàðóøèë ïðàâèëî ñåðâåðà (Drive By).");
format(string, 256, "Creative: %s[%d] íàðóøèë ïðàâèëî ñåðâåðà (Drive By).",PlayerName[killerid],killerid);
ABroadCast(RED,string,1);
}
}
}
}
if(IsACop(killerid))
{
if(GetPlayerWantedLevel(playerid) > 0 && PlayerInfo[killerid][pJailTime] == 0 && InZone[killerid] == false)
{
if(PlayerInfo[playerid][pLevel] >= 1)
{
new price = PlayerInfo[playerid][pWanted] * 50;
format(string, sizeof(string), "~g~+$%d", price);
GameTextForPlayer(killerid, string, 5000, 1);
PlayerInfo[killerid][pPayCheck] += price;
PlayerInfo[killerid][pFstats] += price;
}
else
{
GameTextForPlayer(killerid, "~g~+$0", 5000, 1);
SCM(playerid, GREY, "Çà óáèéñòâî èãðîêà 0 óðîâíÿ, íàãðàäû íåò.");
}
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = PlayerInfo[playerid][pWanted]*300;
format(string, sizeof(string), "%s[%d] ïîñàäèë òåáÿ íà %d ìèíóò(û).",PlayerName[killerid],killerid, PlayerInfo[playerid][pJailTime]/60);
SCM(playerid, LBLUE, string);
PlayerInfo[playerid][pWanted] = 0;
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
}
}
if(PlayerInfo[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(PlayerInfo[killerid][pLeader] == 8 || PlayerInfo[killerid][pMember] == 8)
{
if(GoChase[killerid] == playerid)
{
GiveMoney(killerid, PlayerInfo[playerid][pHeadValue]);
format(string,128,"Õèòìàí %s âûïîëíèë çàêàç íà %s.",PlayerName[killerid],PlayerName[playerid]);
SendRadioMessage(8, YELLOW, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
}
}
}
}
killerid = INVALID_PLAYER_ID;
SetPlayerToTeamColor(playerid);
return true;
}