I'll give you mine.
In OnPlayerCommand
pawn Code:
new cmd[256];
if(strcmp(cmd, "/rape", true) == 0)
{
GetPlayerName(playerid, pname, 24);
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp))return SendClientMessage(playerid, red, "**USAGE: /rape [id]");
if(!IsPlayerConnected(giveplayerid))return SendClientMessage(playerid, red, "Inactive ID");
if(giveplayerid == playerid) return SendClientMessage(playerid, red, "How are you planning on raping yourself");
if(Float:GetDistanceBetweenPlayers(playerid, giveplayerid) > 5.0)return SendClientMessage(playerid, red, "How long do you think your dick is?");
GetPlayerName(playerid, pname, 24);
GetPlayerName(giveplayerid, pname2, 24);
format(string, sizeof(string), "%s has raped %s", pname, pname2);
SendClientMessageToAll(red, string);
return 1;
}
On the bottom
pawn Code:
stock GetPlayerDistanceToPoint(playerid,Float:x,Float:y)
{
new Float:x1,Float:y1,Float:z1; GetPlayerPos(playerid,x1,y1,z1);
new Float:tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2.0)+
floatpower(floatabs(floatsub(y,y1)),2.0));
return floatround(tmpdis);
}
stock strtok(const string5[], &index)
{
new length = strlen(string5);
while ((index < length) && (string5[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string5[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string5[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Credz to whoever made GetDistanceBetweenPlayers.