12.10.2011, 11:50
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Mobile[playerid] != 255)
{
new idx;
tmp = strtok(text, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Says (cellphone): %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
if(IsPlayerConnected(Mobile[playerid]))
{
if(Mobile[Mobile[playerid]] == playerid)
{
SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"Theres nobody there");
}
return 0;
}
if (realchat)
{
new sendername[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
sendername[strfind(sendername,"_")] = ' ';
format(string, sizeof(string), "%s says: %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
new lengthtime = strlen(text);
new time = lengthtime*50;
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
return 0;
}
return 1;
}
The errors are:
Код:
error 017: undefined symbol "tmp" (489) error 017: undefined symbol "strtok" (489) error 017: undefined symbol "sendername" (490) error 017: undefined symbol "sendername" (490) error 029: invalid expression, assumed zero (490) fatal error 107: too many error messages on one line (490)
pawn Код:
tmp = strtok(text, idx); //(489)
GetPlayerName(playerid, sendername, sizeof(sendername)); //(490)