Playerset testing
#5

An even more odd use. This is a replacement for my old Text_Send function from YSI 0.1. In that version there were multiple functions for sending to different people with and without formatting, in this version I think I've improved it vastly. Note that now you have a default text set in a file directly linked to that file, but you can use others. Also note that the identifiers are no longer strings:

pawn Code:
#define Text_Send(%0,%1) PSF(_Text_Send,%0,YSI_gDefaultText,#%1)
#define _Text_Send(%0,YSI_gDefaultText,#%1->%2) _Text_Send(%0,#%1,#%2)
That code will detect when a player is using the "GROUP->TEXT" format and actually get rid of the call to the file default variable. If they are not using that format then nothing will happen at all. This makes the format of _Text_Send:

pawn Code:
_Text_Send(PlayerSet<playerid>, const group[], const text[], {Float,_}:...)
But because it's wrapped up in a nice macro, you don't ever need to know half the parameters even exist.

Possible uses:

Code:
Text_Send(playerid, TEXT_NO_RACE);
Text_Send(admingroup, RACE_TEXT -> TEXT_NO_RACE);
Text_Send(someArrayOfPlayers, TEXT_STARTING_RACE, 5);
Reply


Messages In This Thread
Playerset testing - by Y_Less - 15.02.2011, 16:20
Re: Playerset testing - by AlExAlExAlEx - 16.02.2011, 07:27
Re: Playerset testing - by Y_Less - 16.02.2011, 10:21
Re: Playerset testing - by AK47317 - 17.02.2011, 09:45
Re: Playerset testing - by Y_Less - 17.02.2011, 09:48
Re: Playerset testing - by AK47317 - 17.02.2011, 10:23
Re: Playerset testing - by Sascha - 17.02.2011, 11:59
Re: Playerset testing - by Y_Less - 17.02.2011, 20:55
Re: Playerset testing - by Macluawn - 17.02.2011, 21:02
Re: Playerset testing - by Joe Staff - 17.02.2011, 21:04

Forum Jump:


Users browsing this thread: 3 Guest(s)