19.09.2008, 00:25
[INC]EasyNames
Damn, i didn't know saying goodbye to sa:mp was so hard Anyway, after some questions from people about detecting (parts of) playernames and such, i decided to make an easy to use include with some handy functions:
PlayerNameIs(playerid, const name[]);
This function will return '1' if the playername is equal to "name" and will return '0' if the PlayerName is not equal to the inserted string.
PlayerNameContains(playerid, const name[]);
This function will return '1' if "name" is found somewhere in the PlayerName of that player.
PlayerNameStartsWith(playerid, const name[]);
This function will return '1' if the playername of that player starts with "name".
PlayerNameEndsWith(playerid, const name[]);
This function will return '1' if the playername of that player ends with "name".
ReversePlayerName(playerid);
This function will reverse the playername (just to joke players )
Example: "Sandra19[NL]" will become "]NL[91ardnaS"
Note: If you use 1 of the functions on an unconnected player, the function will automatically return '0'.
How To Install:
- Download "EasyNames.inc"
- Place it in the "include"-folder which is located in the "pawno"-folder
- Add to your gamemode of filterscript (or whereever you want to use these functions) at the top:
Code:
#include <EasyNames>
Download:
http://www.mediafire.com/?m420zzuoxdy
Enjoy