Command /mask - 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: Command /mask (
/showthread.php?tid=326399)
DELETED -
RenSoprano - 17.03.2012
DELETED
Re: Command /mask -
[ABK]Antonio - 17.03.2012
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;
}
Re: Command /mask -
RenSoprano - 17.03.2012
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)
Re: Command /mask -
emokidx - 17.03.2012
pawn Code:
SendClientMessage(playerid, color, text);
it has got three arguments
pawn Code:
SendClientMessage(playerid, -1, string);
replace -1 with your color
Re: Command /mask -
RenSoprano - 17.03.2012
Quote:
Originally Posted by emokidx111
pawn Code:
SendClientMessage(playerid, color, text);
it has got three arguments
pawn Code:
SendClientMessage(playerid, -1, string);
replace -1 with your color
|
Thanks
Re: Command /mask -
[ABK]Antonio - 17.03.2012
Quote:
Originally Posted by emokidx111
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
Re: Command /mask -
ReneG - 17.03.2012
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;
}