17.10.2011, 15:16
pawn Код:
new bool:BigEars[MAX_PLAYERS]; //At the top of your script
//The command
if(strcmp("/bigears",cmdtext,true,8) == 0)
{
if(BigEars[playerid] == false) return BigEars[playerid] = true;
if(BigEars[playerid] == true) return BigEars[playerid] = false;
}
//Under OnPlayerText
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
format(string,MAX_STRING,"%s: %s",n,text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(BigEars[i] == true)
{
if(IsPlayerInRangeOfPoint(i,30,pX,pY,pZ))
{
SendClientMessage(i,COLOR_GRAD1,string);
return 0;
}
}
else
{
if(IsPlayerInRangeOfPoint(i,5,pX,pY,pZ))
{
SendClientMessage(i,COLOR_GRAD1,string);
return 0;
}
}
}
}
return 0;