/rape cmd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /rape cmd (
/showthread.php?tid=43160)
/rape cmd -
ShadoW_StaH - 12.07.2008
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
Re: /rape cmd -
Jacky1992 - 12.07.2008
yeah i want to know it too ^^ that sounds good for an RPG script ^^
Re: /rape cmd -
Mentis - 12.07.2008
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.
Re: /rape cmd -
Nolo - 17.10.2008
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.
Re: /rape cmd -
x-unit - 17.01.2010
nah...too many errors....
Re: /rape cmd - HuSs3n - 09.08.2011
removed
sry^^
Re: /rape cmd -
G6X - 17.06.2012
Thanks, this is what i wanted too.