Ко всем командам:
Код
CMD:ptext(playerid, params[])
{
new str[144];
if(sscanf(params, "ds[128]", params[0], params[1])) return SendClientMessage(playerid, -1, "Используйте: /ptext [id] [текст]");
ApplyAnimation(params[0],"PED","IDLE_CHAT",4.1,0,1,1,1,1,1);
format(str, sizeof(str), "%s говорит: %s",get_name(params[0]),params[1]);
distance_chat(playerid,10.0,0xFFFFFFFF,str);
SetPlayerChatBubble(params[0], params[1], 0xFFFFFFFF, 20.0, 5000);
return 1;
}
Ко всем стокам:
Код
stock distance_chat(playerid,Float:Radi=10.0,color,text[])
{
new Float:pos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
for(new i;i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
if(IsPlayerInRangeOfPoint(i,Radi,pos[0],pos[1],pos[2])) if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid) && GetPlayerInterior(playerid) == GetPlayerInterior(i))SendClientMessage(i,color,text);
}
}
stock get_name(playerid) { new name@[MAX_PLAYER_NAME]; GetPlayerName(playerid, name@, sizeof(name@)); return name@; }