Macros?
#1

I was hoping it wouldnt come to this, but i fear I must call upon SA-MP Forums for something really stupid once more.

Код:
public OnPlayerText(playerid, text[])
{
	if(text[0] == '+')
	{
	new msg[72]; new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
	format(msg, sizeof msg,"(%s @ Global):""%s",pName, text);
	SendClientMessageToAll(0xC4C4C4FF,msg);
	strdel(msg,1,1);
	return 0;
	}
	return 1;
}
This code, when implemented, is supposed to replace the + sign with

(playername @ Global [insert text here]

However, my current issue, is when i put it into play, it comes up as:

(playername @ Global+[insert text here]

Basically, what i need to know is how do i get rid of that annoying little plus sign. Im sure its just a single line of code missing, but im not sure what it would be. Any serious help appreciated. Thanks
Reply
#2

Try this:
PHP код:
public OnPlayerText(playeridtext[])
{
    if(
text[0] == '+')
    {
    new 
msg[72]; new pName[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    
format(msgsizeof msg,"(%s @ Global):""%s",pNametext[1]);
    
SendClientMessageToAll(0xC4C4C4FF,msg);
    
strdel(msg,1,1);
    return 
0;
    }
    return 
1;

Reply
#3

I owe you a kiss and a beer m8! Thank you so much! I knew it was something i was just forgetting to do lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)