13.03.2013, 23:23
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?
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))
if(IsPlayerNearPlayer(playerid, 5, 10.0))
{
your message
}
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."
}
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."
}
}