/rape cmds - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /rape cmds (
/showthread.php?tid=275274)
/rape cmds -
UserName31 - 09.08.2011
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?
Re: /rape cmds -
Kingunit - 09.08.2011
You can use
proxdetector for that.
AW: /rape cmds -
UserName31 - 09.08.2011
what does it do?
Re: /rape cmds -
Kingunit - 09.08.2011
You need that for the distance you wanted.
AW: /rape cmds -
UserName31 - 09.08.2011
i need command not the pogram
Re: /rape cmds -
PrawkC - 09.08.2011
you can use IsPlayerInRangeOfPoint .. wiki it
Re: /rape cmds -
Kush - 09.08.2011
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
AW: /rape cmds -
UserName31 - 10.08.2011
but can i /rape next to him anywere?
Re: /rape cmds -
=WoR=Varth - 10.08.2011
Just set the range in
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: /rape cmds -
grand.Theft.Otto - 10.08.2011
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.