NPC Amimation!!!
#7

Quote:
Originally Posted by billiout
Посмотреть сообщение
Код:
stock SendChatEx(playerid,message[])
{
    if ((IsPlayerConnected(playerid)) && (strlen(message) > 0))
	{
    SendChat(message);
    }
    return 1;
}
you think this will work? i mean i dont any other to test if it is working. i want to show it on for the player not in all players for me i didnt have any errors and the for npc i can see it and send the chat.

its impossible to make it on the fs? i mean i dont want the code on the npc.pwn but on my fs.
SendChat() is same as SendPlayerMessageToAll, so it might not work.
the workaround is to sending commands like /sendchat [npcid] [toplayerid] [color] [message]

pawn Код:
new npc_id;
public OnNPCConnect(myplayerid) npc_id = myplayerid;
stock SendClientMessage( playerid, color, message[] )
{
    new str[256]; //LOL
    format( str, sizeof(str), "/sendclientmessage %d %d %d %s", npc_id, playerid, color, message );
    SendCommand( str );
}
and in your filterscript:

pawn Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
    if( !strcmp( cmdtext, "/sendclientmessage", true, 18 ) && IsPlayerNPC( playerid ) )
    {
        new npc_id, playerid, color, msg[128], name[MAX_PLAYER_NAME];
        GetPlayerName( playerid, name, sizeof(name) );
        sscanf( cmdtext[19], "iiis", npc_id, playerid, color, msg );
        format( msg, sizeof(msg), "%s(%d) : %s", name, npc_id, msg );
        SendClientMessage( playerid, color, msg );
        return 1;
    }
    return 0;
}
though i didn't try it it would work.

EDIT: for sure you can implement it on filterscript.
with IsPlayerNPC(playerid) and name comparing, some distance functions you can make that script.
Reply


Messages In This Thread
NPC Amimation!!! - by billiout - 21.08.2010, 17:27
Re: NPC Amimation!!! - by billiout - 22.08.2010, 06:13
Re: NPC Amimation!!! - by dax123 - 22.08.2010, 06:31
Re: NPC Amimation!!! - by billiout - 22.08.2010, 07:04
Re: NPC Amimation!!! - by dax123 - 22.08.2010, 07:09
Re: NPC Amimation!!! - by billiout - 22.08.2010, 07:18
Re: NPC Amimation!!! - by dax123 - 22.08.2010, 07:51

Forum Jump:


Users browsing this thread: 3 Guest(s)