C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(20350) : warning 213: tag mismatch C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(20354) : warning 213: tag mismatch C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(20367) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Warnings.
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new Message[256];
new gMessage[256];
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage))
{
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,COLOR_RED,"/pm : Bad player ID");
return 1;
}
if(playerid != id)
{
if(NOPM[id] == true)
{
SendClientMessage(playerid, COLOR_RED, "This player has disabled PM's");
}
if(FirstPM[playerid] == 0 && NOPM[id] == false)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,COLOR_YELLOW,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
FirstPM[playerid] = 1;
SendClientMessage(playerid, COLOR_RED, "Type /pmoff to disable PM's");
}
if(FirstPM[playerid] == 1 && NOPM[id] == false)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,COLOR_YELLOW,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot PM yourself");
}
return 1;
}
return 0;
}
Originally Posted by Niixie
What do you want us to do?
|
Originally Posted by dice7
iName is an array, not integer
|
Originally Posted by dice7
You're still trying to access an array index with a string
|
Originally Posted by [SU
BP13 ]
Quote:
|
if(NOPM[id] == true)
if(NOPM[id] == 1)
if(NOPM[id] == false)
if(NOPM[id] == 0)
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new Message[256];
new gMessage[256];
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage))
{
SendClientMessage(playerid,COLOR_RED,"Usage: /pm (id) (message)");
return 1;
}
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,COLOR_RED,"/pm : Bad player ID");
return 1;
}
if(playerid != id)
{
if(NOPM[id] == true)
{
SendClientMessage(playerid, COLOR_RED, "This player has disabled PM's");
}
if(FirstPM[playerid] == 0 && NOPM[id] == false)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,COLOR_YELLOW,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
FirstPM[playerid] = 1;
SendClientMessage(playerid, COLOR_RED, "Type /pmoff to disable PM's");
}
if(FirstPM[playerid] == 1 && NOPM[id] == false)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,COLOR_YELLOW,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot PM yourself");
}
return 1;
}