Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/knockout", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Для начала войдите в аккаунт ");
- return 1;
- }
- if(PlayerInfo[playerid][pLevel] < 3)
- {
- SendClientMessage(playerid, COLOR_GREY, " Вам нужен 3 лвл, чтобы использовать эту команду ");
- return 1;
- }
- if(KnockedDown[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, " Игрок уже без сознания ");
- return 1;
- }
- if(PlayerInfo[playerid][pSex] == 2)
- {
- SendClientMessage(playerid, COLOR_GREY, " У вас не хватит сил, чтобы сбить кого то с ног ");
- return 1;
- }
- if(PlayerBoxing[playerid] != 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Это является запрещенным приемом ");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, " /knockout [id игрока] ");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (ProxDetectorS(1.0, playerid, giveplayerid))
- {
- if(KnockedDown[giveplayerid] != 1)
- {
- if(giveplayerid == playerid)
- {
- SendClientMessage(playerid, COLOR_GREY, " Вы не можете повалить себя ");
- return 1;
- }
- if(PlayerInfo[giveplayerid][pSex] == 2)
- {
- SendClientMessage(playerid, COLOR_GREY, " Н нападать на девушку ");
- return 1;
- }
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- return 1;
- }
- if(PlayerInfo[playerid][pForce] <= PlayerInfo[giveplayerid][pForce])
- {
- new rnd = random(10);
- if(rnd < 5)
- {
- SendClientMessage(playerid, COLOR_GREY, " У вас не хватило сил, чтобы ударить игрока! ");
- return 1;
- }
- }
- new maneyka = GetPlayerMoney(playerid);
- new giveplayername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- new rands = random(2)+1;
- format(string, sizeof(string), "* %s ударил в лицо %s и повалил его на землю", sendername, giveplayername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- ApplyAnimation(playerid,"FIGHT_D","FightD_3",4.0,0,1,1,0,0);
- if(rands == 1)
- {
- TogglePlayerControllable(giveplayerid, 0);
- ApplyAnimation(giveplayerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- SetTimerEx("ClearKnock", 20000, false, "i", giveplayerid);
- KnockedDown[giveplayerid] = 1;
- format(string,sizeof(string), "~g~+%d$",maneyka);
- GameTextForPlayer(playerid, string , 7000, 1);
- GivePlayerMoneyAnt(giveplayerid,-maneyka);
- format(string,sizeof(string), "~r~-%d$",maneyka);
- GameTextForPlayer(giveplayerid, string , 7000, 1);
- ResetPlayerMoney(giveplayerid);
- WantedPoints[playerid]+=1; //розыска при ограблении
- SetPlayerCriminal(playerid,255, " Грабеж игрока ");
- format(string,sizeof(string), "~g~-%d$",maneyka);
- GameTextForPlayer(giveplayerid, string , 7000, 1);
- format(string, sizeof(string), "* %s удар прошел удачно", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- format(string, sizeof(string), "* %s попытался ударить %s, но промахнулся.", sendername, giveplayername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Игрок уже повален ");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Этот игрок находится далеко от вас ");
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement