/rape cmds
#1

well i been trying to this rape cmd for a long time and i still haven't been successful so i thought why don't i ask my fellow friends

how do i make a /rape cmd that sends a msg like ''player1 has raped player2'' and only the people who are near you can hear it and also how do i make it so it checks the distance between play?
Reply
#2

You can use proxdetector for that.
Reply
#3

what does it do?
Reply
#4

You need that for the distance you wanted.
Reply
#5

i need command not the pogram
Reply
#6

you can use IsPlayerInRangeOfPoint .. wiki it
Reply
#7

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
You can use proxdetector for that.
No, you can use IsPlayerInRangeOfPoint for that. Proxdetector is a function which grabs the player's position and allows formatted text to be sent at a radius which would have to be set. The actual function which is called is IsPlayerInRangeOfPoint.You can create your own
Reply
#8

but can i /rape next to him anywere?
Reply
#9

Just set the range in https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)