Rape help - 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 help (
/showthread.php?tid=422507)
Rape help -
Ananisiki - 13.03.2013
I have a /rape command, but i need to do /rape and the players ID, is there a way to do /rape so it rapes the closest player?
Re: Rape help -
Glad2BeHere - 13.03.2013
pawn Код:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
{
return 1;
}
return 0;
}
//but typically its just the playerid u want to the target and the distance
if( IsPlayerNearPlayer(playerid, targetid, 15))
Re: Rape help -
Ananisiki - 13.03.2013
do i have to copy this and place it in my GM ?
Re: Rape help -
Eminem 2ka9 - 14.03.2013
yeah.. put it anywhere in your gamemode, alongside with your other stocks.
Re: Rape help -
Ananisiki - 14.03.2013
(461) : error 010: invalid function or declaration
Re: Rape help -
Ananisiki - 14.03.2013
whats this error ? i got it from if( IsPlayerNearPlayer(playerid, targetid, 15))
Re: Rape help -
Scrillex - 14.03.2013
pawn Код:
if(IsPlayerNearPlayer(playerid, 5, 10.0))
{
your message
}
If you showed rape cmd maybe we could help you more!
Re: Rape help -
Ananisiki - 14.03.2013
like this ?
pawn Код:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
{
return 1;
}
return 0;
}
//but typically its just the playerid u want to the target and the distance
if(IsPlayerNearPlayer(playerid, 5, 10.0))
{
SendClientMessage(playerid, COLOR_RED, "No Players Close Enough To Rape."
}
Re: Rape help -
Scrillex - 14.03.2013
Lol that function is needed to be under command! like
EXAMPLE:
pawn Код:
YCMD:rape(playerid,pramas[],help)
{
Do your code here animes etc..
if(IsPlayerNearPlayer(playerid, 5, 10.0))
{
SendClientMessage(playerid, COLOR_RED, "No Players Close Enough To Rape."
}
}