A RP command only possible in a radius?
#1

Hello i need help with commands like /s(shout).
I need something like /s You are ugly! with this result

0-25 meters: Justsomeguy shouts: You are ugly!

I got an proxdetector wont i be able to use that? if sow how?

Thanks in advance!
Reply
#2

pawn Код:
stock MessageToClientsInRadius(playerid, iColor, szString[], Float: fRadius = 5.0) {
    if(!IsPlayerConnected(playerid))
        return 1;

    new
        l_iLocation[2],
        Float: l_fPosition[3];

    GetPlayerPos(playerid, l_fPosition[0], l_fPosition[1], l_fPosition[2]);
    l_iLocation[0] = GetPlayerInterior(playerid);
    l_iLocation[1] = GetPlayerVirtualWorld(playerid);
   
    foreach(Player, i) {
        if(IsPlayerInRangeOfPoint(i, fRadius, l_fPosition[0], l_fPosition[1], l_fPosition[2])) {
            if(GetPlayerVirtualWorld(i) == l_iLocation[1] && GetPlayerInterior(i) == l_iLocation[0]) {
                SendClientMessage(i, iColor, szString);
            }
        }
    }
    return 1;
}

CMD:shout(playerid, params[]) {
    if(isnull(params))
        return SendClientMessage(playerid, 0, "Syntax: /shout [message]");
       
    MessageToClientsInRadius(playerid, 0, params, 25);
    return 1;
}
ProxDetector is slow and outdated.

Try this, I haven't tested it though.

You'll need foreach & zcmd.
Reply
#3

You don't need old ancient proxdetector.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

EDIT: Dang, beat me.
Reply
#4

Thanks! But what do i do if i want like an /b with this usage?:

/b omg your ugly!

((justsomeguy: omg your ugly!))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)