/rape cmds
#10

pawn Код:
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
    new Float:x1,Float:y1,Float:z1,Float:x3,Float:y3,Float:z3;
    if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
    {
        return -1.00;
    }
    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x3,y3,z3);
    return floatsqroot(floatpower(floatabs(floatsub(x3,x1)),2)+floatpower(floatabs(floatsub(y3,y1)),2)+floatpower(floatabs(floatsub(z3,z1)),2));
}
This does exactly what the name says ^

Here is a simple /rape command I made (I'll use strcmp since I don't know what command processor you're using):

pawn Код:
if(strcmp(cmdtext, "/rape", true, 5) == 0) // 5 = command length including forward slash /
{
      new tmp[128], player1,string[128],aname[24],pname[24];
      GetPlayerName(player1,name,24); //  attacker name
      GetPlayerName(playerid,pname,24); // victim name
      player1 = strval(tmp); // so we make player1 a number / id value

      if(GetDistanceBetweenPlayers(playerid, player1) > 20) return SendClientMessage(playerid,red,"Target Player Is Not Close Enough To Rape.");
      // playerid = rapist || player1 = victim

      // below is if the player is less than 20 metres and what will happen, else if it goes over, it returns the error above
      new Float: health;
      GetPlayerHealth(player1,health); // getting player1's health
      SetPlayerHealth(player1, health -25); // getting player1's health and setting to -25 percent at the same time

      // so if their health is 50 (half percent) it will set to -25 percent from 50, which = 25 percent health (almost dead)

      format(string,128,"%s (%d) Has Raped You.",aname,playerid);
      SendClientMessage(player1, COLOR, string);

      format(string,128,"You Have Raped %s (%d).",pname,player1);
      SendClientMessage(playerid, COLOR, string);
Thats a very simple one, I would give you some rape to death scripts or std help, but you can figure it out

Untested but I'm sure it should work.

Good luck.
Reply


Messages In This Thread
/rape cmds - by UserName31 - 09.08.2011, 01:12
Re: /rape cmds - by Kingunit - 09.08.2011, 01:48
AW: /rape cmds - by UserName31 - 09.08.2011, 01:59
Re: /rape cmds - by Kingunit - 09.08.2011, 02:04
AW: /rape cmds - by UserName31 - 09.08.2011, 02:05
Re: /rape cmds - by PrawkC - 09.08.2011, 02:23
Re: /rape cmds - by Kush - 09.08.2011, 02:26
AW: /rape cmds - by UserName31 - 10.08.2011, 16:07
Re: /rape cmds - by =WoR=Varth - 10.08.2011, 17:25
Re: /rape cmds - by grand.Theft.Otto - 10.08.2011, 17:31

Forum Jump:


Users browsing this thread: 2 Guest(s)