Command /mask
#1

DELETED
Reply
#2

Instead of setting a name, why not just do this...

pawn Code:
new bool:Masked[MAX_PLAYERS] = false;

public OnPlayerText(playerid, text[])
{
    if(Masked[playerid])
    {
        new string[128];
        format(string, sizeof(string), "Stranger says, \"%s\"", text);
        SendClientMessageToAll(pick_a_color, string);
        return 0;
    }
    return 1;
}
Reply
#3

Thanks but I dont want to send message to all and i try to SendClientMessage and take error

pawn Code:
public OnPlayerText(playerid, text[])
{
    if(Masked[playerid])
    {
        new string[128];
        format(string, sizeof(string), "Stranger says, \"%s\"", text);
        SendClientMessage(playerid, string); // HERE IS ERROR
        return 0;
    }
    return 1;
}
and here is error

pawn Code:
C:\Users\home\Desktop\GFHF\gamemodes\rp1.pwn(232) : error 035: argument type mismatch (argument 2)
Reply
#4

pawn Code:
SendClientMessage(playerid, color, text);
it has got three arguments

pawn Code:
SendClientMessage(playerid, -1, string);
replace -1 with your color
Reply
#5

Quote:
Originally Posted by emokidx111
View Post
pawn Code:
SendClientMessage(playerid, color, text);
it has got three arguments

pawn Code:
SendClientMessage(playerid, -1, string);
replace -1 with your color
Thanks
Reply
#6

Quote:
Originally Posted by emokidx111
View Post
pawn Code:
SendClientMessage(playerid, color, text);
it has got three arguments

pawn Code:
SendClientMessage(playerid, -1, string);
replace -1 with your color
lol my bad, have other things on my mind :P

EDIT: oh no, i was correct..Don't use sendclientmessage and if you're using a radius message system make sure to use that
Reply
#7

Umm, all the above code will only send whoever typed it the message, not to every one who is near you.

Add this anywhere outside of a callback in your script.
pawn Code:
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(!IsPlayerConnected(i))continue;
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z)) SendClientMessage(i,color,string);
    }
}
and use this for your OnPlayerText
pawn Code:
public OnPlayerText(playerid, text[])
{
    if(Masked[playerid] == 1)
    {
        new string[128];
        format(string, sizeof(string), "Stranger says: %s", text);
        ProxDetector(30,playerid,string,-1); // Sends the Stranger says message to anyone who is 30 gta units close to the player
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)