SA-MP Forums Archive
2 Roleplay features - 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: 2 Roleplay features (/showthread.php?tid=367554)



2 Roleplay features - CrazyManiac - 10.08.2012

Hello guys. I need help with my 2 roleplay features. I want when any player talks, it won't be said in the Global chat, but in an IC chat (Not everyone can see it, only the people who are near them). And maybe a /o command (When people type /o <text>, everyone will see it).

Would be very nice when someone could make this for me!

Greetings, CrazyManiac.


Re: 2 Roleplay features - CrazyManiac - 10.08.2012

Bumpi.


Re: 2 Roleplay features - tyler12 - 10.08.2012

pawn Код:
SendClientMessageToAll(color,message);
stock ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5) {
    new Float:P[3], Float:OP[3], Float:TP[3];
    GetPlayerPos(playerid, OP[0], OP[1], OP[2]);
    for(new i; i < MAX_PLAYERS; i++) {
        GetPlayerPos(i, P[0], P[1], P[2]);
        TP[0] = (OP[0]-P[0]);
        TP[1] = (OP[1]-P[1]);
        TP[2] = (OP[2]-P[2]);
        if(((TP[0] < radi/16) && (TP[0] > -radi/16)) && ((TP[1] < radi/16) && (TP[1] > -radi/16)) && ((TP[2] < radi/16) && (TP[2] > -radi/16))) SendClientMessage(i, col1, str);
        else if (((TP[0] < radi/8) && (TP[0] > -radi/8)) && ((TP[1] < radi/8) && (TP[1] > -radi/8)) && ((TP[2] < radi/8) && (TP[2] > -radi/8))) SendClientMessage(i, col2, str);
        else if (((TP[0] < radi/4) && (TP[0] > -radi/4)) && ((TP[1] < radi/4) && (TP[1] > -radi/4)) && ((TP[2] < radi/4) && (TP[2] > -radi/4))) SendClientMessage(i, col3, str);
        else if (((TP[0] < radi/2) && (TP[0] > -radi/2)) && ((TP[1] < radi/2) && (TP[1] > -radi/2)) && ((TP[2] < radi/2) && (TP[2] > -radi/2))) SendClientMessage(i, col4, str);
        else if (((TP[0] < radi) && (TP[0] > -radi)) && ((TP[1] < radi) && (TP[1] > -radi)) && ((TP[2] < radi) && (TP[2] > -radi))) SendClientMessage(i, col5, str);
    }
    return 1;
}



Re: 2 Roleplay features - CrazyManiac - 10.08.2012

Where do i have to post this? Under my command ''/o''?


Re: 2 Roleplay features - tyler12 - 10.08.2012

/o
SendClientMessageToAll


Local chat, use ProxDetector.


Re: 2 Roleplay features - CrazyManiac - 10.08.2012

Код:
C:\Documents and Settings\Tessa Krijnen\Mijn documenten\Fabians Fun Server (0.3e)\gamemodes\v3.9.pwn(1967) : warning 225: unreachable code
C:\Documents and Settings\Tessa Krijnen\Mijn documenten\Fabians Fun Server (0.3e)\gamemodes\v3.9.pwn(2163 -- 2164) : error 017: undefined symbol "color"
C:\Documents and Settings\Tessa Krijnen\Mijn documenten\Fabians Fun Server (0.3e)\gamemodes\v3.9.pwn(2163 -- 2164) : error 001: expected token: ")", but found ";"
C:\Documents and Settings\Tessa Krijnen\Mijn documenten\Fabians Fun Server (0.3e)\gamemodes\v3.9.pwn(2165) : error 001: expected token: ";", but found "stock"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: 2 Roleplay features - tyler12 - 10.08.2012

Guessing the lines am i?


Re: 2 Roleplay features - CrazyManiac - 10.08.2012

What do you mean? I just need help with it >_>


Re: 2 Roleplay features - CrazyManiac - 10.08.2012

I really need help with this, i dont really get it >_<

Btw, i guess tyler helped me with the /o command, but does anybody
Knows how to make it like when people talk without using any command, only
people can see it that are near them?


Re: 2 Roleplay features - tyler12 - 10.08.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
    new
        message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, message, col1,col2,col3,col4,col5);
    return 0;
}
Something like that.