/rape cmd
#3

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.
Reply


Messages In This Thread
/rape cmd - by ShadoW_StaH - 12.07.2008, 04:13
Re: /rape cmd - by Jacky1992 - 12.07.2008, 23:21
Re: /rape cmd - by Mentis - 12.07.2008, 23:30
Re: /rape cmd - by Nolo - 17.10.2008, 16:10
Re: /rape cmd - by x-unit - 17.01.2010, 15:18
Re: /rape cmd - by HuSs3n - 09.08.2011, 01:14
Re: /rape cmd - by G6X - 17.06.2012, 09:01

Forum Jump:


Users browsing this thread: 2 Guest(s)