#include <a_samp> #include <a_players>
if(!strcmp("/say", cmdtext, true)) { SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000); return 1; }
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\lvrp.pwn(544) : error 017: undefined symbol "SetPlayerChatBubble" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/say", cmd, true)==0)
{
new tmp[128];
new iText;
tmp = strtok(cmdtext, idx);
iText= strval(tmp);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /say [Text]");
SetPlayerChatBubble(playerid, iText, 0xFF0000FF, 100.0, 10000);
return 1;
}
return 0;
}
//Somewhere in your script
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\lvrp.pwn(553) : error 017: undefined symbol "SetPlayerChatBubble" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
C:\Documents and Settings\Eigenaar\Bureaublad\Roleplay\Kopie van gamemodes\test.pwn(107) : error 035: argument type mismatch (argument 2) C:\Documents and Settings\Eigenaar\Bureaublad\Roleplay\Kopie van gamemodes\test.pwn(104) : warning 204: symbol is assigned a value that is never used: "iText" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Originally Posted by Second
Help please.
|
//
// Example use of chat above player's head
//
#include <a_samp>
#include "../include/gl_common.inc"
#define MESSAGE_COLOR 0xEEEEEEFF
#define ECHO_COLOR 0xEEEEEEFF
#define ACTION_COLOR 0xEE66EEFF
//------------------------------------------------
public OnFilterScriptInit()
{
print("\n--Speech bubble example loaded.\n");
return 1;
}
//------------------------------------------------
public OnPlayerText(playerid, text[])
{
if(strlen(text) > 128) return 0;
new to_others[MAX_CHATBUBBLE_LENGTH+1];
new to_me[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
format(to_me,MAX_CHATBUBBLE_LENGTH,">> %s",text);
SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
SendClientMessage(playerid,ECHO_COLOR,to_me);
return 0; // can't do normal chat with this loaded
}
//------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new Message[256];
new idx;
new actiontext[MAX_CHATBUBBLE_LENGTH+1];
cmd = strtok(cmdtext, idx);
// Action command
if(strcmp("/say", cmd, true) == 0)
{
Message = strrest(cmdtext,idx);
format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,30.0,10000);
SendClientMessage(playerid,ACTION_COLOR,actiontext);
return 1;
}
return 0; // not handled by this script
}
//------------------------------------------------