PDA

View Full Version : /rape cmd


ShadoW_StaH
12/07/2008, 04:13 AM
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 :D

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 :D

Jacky1992
12/07/2008, 11:21 PM
yeah i want to know it too ^^ that sounds good for an RPG script ^^

Mentis
12/07/2008, 11:30 PM
I'll give you mine.

In OnPlayerCommand


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

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.

Nolo
17/10/2008, 04:10 PM
Plz help i got these errors

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


6 Errors.

x-unit
17/01/2010, 03:18 PM
nah...too many errors.... :'(

HuSs3n
09/08/2011, 01:14 AM
removed

sry^^

G6X
17/06/2012, 09:01 AM
Thanks, this is what i wanted too. :)