Macros? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Macros? (
/showthread.php?tid=614796)
Macros? -
KingOfStarfox - 13.08.2016
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
![Smiley](images/smilies/smile.png)
[insert text here]
However, my current issue, is when i put it into play, it comes up as:
(playername @ Global
![Smiley](images/smilies/smile.png)
+[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
Re: Macros? -
Dayrion - 13.08.2016
Try this:
PHP код:
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[1]);
SendClientMessageToAll(0xC4C4C4FF,msg);
strdel(msg,1,1);
return 0;
}
return 1;
}
Re: Macros? -
KingOfStarfox - 13.08.2016
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