/rape cmd
#1

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?

please help me
Reply
#2

yeah i want to know it too ^^ that sounds good for an RPG script ^^
Reply
#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
#4

Plz help i got these errors

Code:
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(185) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(190) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(191) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(192) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(193) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(198) : error 010: invalid function or declaration
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(240) : warning 219: local variable "cmd" shadows a variable at a preceding level
C:\Users\Palo\Desktop\serversamp\gamemodes\mine.pwn(310) : warning 203: symbol is never used: "cmd"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#5

nah...too many errors....
Reply
#6

removed

sry^^
Reply
#7

Thanks, this is what i wanted too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)