[HELP] How to add /tpm again?
#1

The title tells it all...

Thank you
Reply
#2

what is /tpm ?
Reply
#3

Quote from Kye

- The client commands /pm /tpm and the server callbacks OnPlayerPrivMsg and OnPlayerTeamPrivMsg are removed. If you need a replacement /pm command please see the base.pwn filterscript.
Reply
#4

Alright I see... but do you know how to make your own /tpm cmd?
Reply
#5

in a command or OnPlayerText with a check for a certain char
Код:
	
  new str[128],pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(str,sizeof(str),"TeamMsg (%s): %s",pName,cmdtext/text);	
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(gTeam[i] == gTeam[playerid])
    {
 	  SendClientMessage(i,COLOR,str);
    }
  }
Reply
#6

Is it possible to use

Код:
if(GetPlayerTeam(playerid))
Instead of

Код:
if(gTeam[i] == gTeam[playerid])
Reply
#7

yes of corse
Reply
#8

Quote:
Originally Posted by GTA967
yes of corse
Great, how would that look like, I got problems to put it in...
Reply
#9

Quote:
Originally Posted by FreddeN
Great, how would that look like, I got problems to put it in...
pawn Код:
if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
  // _send_the_msg_
}
Reply
#10

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by FreddeN
Great, how would that look like, I got problems to put it in...
pawn Код:
if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
  // _send_the_msg_
}
Alright, it almost works, just one error to fix...

Код:
	if (strcmp("/tpm", cmdtext, true, 4) == 0)
	{
		new str[128],pName[MAX_PLAYER_NAME];
	  GetPlayerName(playerid,pName,sizeof(pName));
	  format(str,sizeof(str),"TeamMsg (%s): %s",pName,cmdtext/text);
	  for(new i = 0; i < MAX_PLAYERS; i++)
  	{
    	if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
    	{
 	  		SendClientMessage(i,0xFFFF00FF,str);
    	}
  	}
	}
The error is...

Код:
undefined symbol "text"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)