/rob /rape
#1

how to make a /rob and /rape like u go by a person u type /rape /rob without the ids need help
Reply
#2

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

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;
}
Reply
#4

Quote:
Originally Posted by Glad2BeHere
View Post
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?
Reply
#5

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

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

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dudb>
#include <gvar>
#include <time>
#include <dprops>
Reply
#8

if ur not using zcmd u can use it here

foreachhttps://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;
}
Reply
#9

i cant not found onplayercommandtext
Reply
#10

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

Code:
#include <foreach>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)