/rob /rape - 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: /rob /rape (
/showthread.php?tid=390148)
/rob /rape -
DerickClark - 04.11.2012
how to make a /rob and /rape like u go by a person u type /rape /rob without the ids need help
Re: /rob /rape -
zDivine - 04.11.2012
pawn Code:
CMD:rape(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /rape [playerid]");
// Code goes here
return 1;
}
That's about all I can show you because there are so many different ways you can make the settings for the rape command. You just need to think of what will happen when the person gets raped. Like will they catch a disease, will they lose health, what?
Hope this helps.
Re: /rob /rape -
Glad2BeHere - 04.11.2012
pawn Code:
CMD:rob(playerid, params[])
{
new playerb;
if(!IsPlayerNearPlayer(playerid, playerb, 5)) return SendClientMessage(playerid, COLOR_GREY, "Your Are to far away.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rob [playerid]");
new playersonline;
foreach(Player, i)
{
if(IsPlayerConnected(i)) playersonline++;
}
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
new Rob = (GetPlayerMoney(playerb)/GetPlayerMoney(i));
GivePlayerMoney(playerid, Rob*playersonline);
GivePlayerMoney(playerb, -Rob*playersonline);
}
}
return 1;
}
pawn Code:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
{
return 1;
}
return 0;
}
Re: /rob /rape -
DerickClark - 04.11.2012
Quote:
Originally Posted by Glad2BeHere
pawn Code:
CMD:rob(playerid, params[]) { new playerb; if(!IsPlayerNearPlayer(playerid, playerb, 5)) return SendClientMessage(playerid, COLOR_GREY, "Your Are to far away."); if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rob [playerid]"); new playersonline; foreach(Player, i) { if(IsPlayerConnected(i)) playersonline++; } foreach(Player, i) { if(IsPlayerConnected(i)) { new Rob = (GetPlayerMoney(playerb)/GetPlayerMoney(i)); GivePlayerMoney(playerid, Rob*playersonline); GivePlayerMoney(playerb, -Rob*playersonline); } } return 1; }
pawn Code:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius) { new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z)) { return 1; } return 0; }
|
where i put it?
Re: /rob /rape -
DerickClark - 04.11.2012
C:\Users\derick\Desktop\CnR\gamemodes\1.2.pwn(8109 ) : warning 203: symbol is never used: "rob"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Re: /rob /rape -
Glad2BeHere - 04.11.2012
https://sampforum.blast.hk/showthread.php?tid=120356 // get sscanf plugin and include
https://sampforum.blast.hk/showthread.php?tid=91354 // zcmd include
and then at the bottom of ur script put both of them
Re: /rob /rape -
DerickClark - 04.11.2012
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dudb>
#include <gvar>
#include <time>
#include <dprops>
Re: /rob /rape -
Glad2BeHere - 04.11.2012
if ur not using zcmd u can use it here
foreach
https://sampforum.blast.hk/showthread.php?tid=92679
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rob", cmdtext, true, 10) == 0)
{
new playerb;
if(!IsPlayerNearPlayer(playerid, playerb, 5)) return SendClientMessage(playerid, COLOR_GREY, "Your Are to far away.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rob [playerid]");
new playersonline;
foreach(Player, i)
{
if(IsPlayerConnected(i)) playersonline++;
}
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
new Rob = (GetPlayerMoney(playerb)/GetPlayerMoney(i));
GivePlayerMoney(playerid, Rob*playersonline);
GivePlayerMoney(playerb, -Rob*playersonline);
}
}
return 1;
}
return 0;
}
Re: /rob /rape -
DerickClark - 04.11.2012
i cant not found onplayercommandtext
Re: /rob /rape -
Glad2BeHere - 04.11.2012
if ur not using zcmd u can use it, otherwise click a new script and u will find it.
/imageshack/img689/3644/40267045.png
get foreach
https://sampforum.blast.hk/showthread.php?tid=92679