Advertisement
Guest User

Untitled

a guest
Jun 29th, 2012
1,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.87 KB | None | 0 0
  1. stock NPCTalk(npcname[],text[],talkto=-1,chat=1,bubble=0,anim=0)
  2. {
  3.     /*new string[M_S], npcid = GetNPCID(npcname), playerid = -1;
  4.     for(new i = 0; i < MAX_PLAYERS_ && playerid == -1; i++) if(IsPlayerConnected(i) && equal(GetName(i),NPCs[npcid][npcName])) playerid = i;
  5.     format(string,sizeof(string),"%s: {FFFFFF}%s",NPCs[npcid][npcName],text);
  6.     if(chat)
  7.     {
  8.         if(talkto == -1) SendClientMessageToAll(GetPlayerColor(playerid),string);
  9.         else SendClientMessage(talkto,GetPlayerColor(playerid),string);
  10.     }
  11.     if(playerid != -1)
  12.     {
  13.         if(!playerinfo[playerid][stoprob])
  14.         {
  15.             switch(anim)
  16.             {
  17.                 case 0:
  18.                 {
  19.                     ApplyAnimation(playerid,"PED","IDLE_chat",4.1,0,1,1,1,1);
  20.                     playerinfo[playerid][clearanims] = 5;
  21.                 }
  22.             }
  23.             if(bubble && strlen(text) < 120)
  24.             {
  25.                 //new col = GetPlayerColor(playerid);
  26.                 if(talkto != -1)
  27.                 {
  28.                     //col = GetPlayerColor(talkto);
  29.                     format(string,sizeof(string),playerinfo[talkto][rname]);
  30.                     format(string,sizeof(string),",%s\n%s",!PlayerDefinedName(talkto) ? (GetName(talkto)) : (string),talkBubble);
  31.                     SetPlayerChatBubble(playerid,string,white,15.0,5000);
  32.                 }
  33.                 else SetPlayerChatBubble(playerid,talkBubble,white,15.0,5000);
  34.             }
  35.         }
  36.     } Some shits of my own code. Take a look if you want! */
  37.     new string[128], playerid = INVALID_PLAYER_ID;
  38.     for(new i = 0; i < MAX_PLAYERS && playerid == INVALID_PLAYER_ID; i++) if(IsPlayerConnected(i) && IsPlayerNPC(i))
  39.     {
  40.         GetPlayerName(i,string,MAX_PLAYER_NAME);
  41.         if(equal(string,npcname)) playerid = i;
  42.     }
  43.     format(string,sizeof(string),"%s: {FFFFFF}%s",string,text);
  44.     if(chat)
  45.     {
  46.         if(talkto == -1) SendClientMessageToAll(GetPlayerColor(playerid),string);
  47.         else SendClientMessage(talkto,GetPlayerColor(playerid),string);
  48.     }
  49.     if(bubble) SetPlayerChatBubble(playerid,text,0xffffffaa,15.0,5000);
  50.     if(anim) ApplyAnimation(playerid,"PED","IDLE_chat",4.1,0,1,1,1,1);
  51.     return 1;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement