Erro at OnPlayerText -
Justsmile - 07.09.2009
[pwn] if(PlayerInfo[playerid][pAccountMailSendText] == 1 && PlayerInfo[playerid][pAccountMailConnect] == 1 && PlayerInfo[playerid][pAccountMailSendTextLine] == 0)
{
// new nstring[256];
new idx;
new length = strlen(text);
while ((idx < length) && (text[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = text[idx];
idx++;
}
result[idx - offset] = EOS;
PlayerInfo[playerid][pAccountMailSendTextLine] = 1;
PlayerInfo[playerid][pMailSendTextLine1] = result;
return 1;
}[/pwn]
I get an Error:
must be assigned to an array
PlayerInfo[layerid][pMailSendTextLine1] = result;
Whats wrong? I want to get, what the player is writen at this time at OnPlayerText.
Re: Erro at OnPlayerText -
dice7 - 07.09.2009
You are assigning a string to an integer.
Also, to get the chat which a player has written, just use the symbol 'text'
Re: Erro at OnPlayerText -
Justsmile - 07.09.2009
Like this?
PlayerInfo[playerid][pMailSendTextLine1] = text;
Re: Erro at OnPlayerText -
Justsmile - 07.09.2009
Or what, pls explain.
Re: Erro at OnPlayerText -
dice7 - 07.09.2009
pawn Код:
enum YourEnum
{
pMailSendTextLine1[128],
other stuff...
};
new PlayerInfo[MAX_PLAYERS][YourEnum];
public OnPlayerText(playerid, text)
{
PlayerInfo[playerid][pMailSendTextLine1] = text;
return 1;
}
Re: Erro at OnPlayerText -
Justsmile - 07.09.2009
array sizes do not match, or destination array is too small
same line.
Re: Erro at OnPlayerText -
Justsmile - 07.09.2009
I have fixxed, it so,
PlayerInfo[playerid][pMaiLSendTextLine2] = text[idx];
Re: Erro at OnPlayerText -
Correlli - 07.09.2009
Use the "Modify" button next time.
Re: Erro at OnPlayerText -
Justsmile - 07.09.2009
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /emails [playerid/PartOfName] [text]");
return 1;
}
new Ereceiver;
Ereceiver = ReturnUser(tmp);
if(Ereceiver != INVALID_PLAYER_ID)
{
PlayerInfo[playerid][pAccountMailSendTextCreate] = 1;
PlayerInfo[playerid][pMailReceiver] = Ereceiver;
is this right to save the ID of the "receiver"?
Yes, if the ID left it wont work, but if the two (playerid, ereceiver are online.