SA-MP Forums Archive
How would I check something with part of a name.. - 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: How would I check something with part of a name.. (/showthread.php?tid=314566)



How would I check something with part of a name.. - Dokins - 30.01.2012

I.e say I wanted to search a number.... How would I search the query in mysql with just part of their name.

I.e /findnumber Grant if any player in players had part of their name as grant how would I check this?

Or....

On a player login, how would I get their first name? i.e

Welcome to the server, Grant. and Not Grant McCaw?


Re: How would I check something with part of a name.. - Babul - 30.01.2012

for splitting a players first name, you can try
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
new FirstName[MAX_PLAYER_NAME];
new LastName[MAX_PLAYER_NAME];
sscanf(PlayerName,"p<_>s["#MAX_PLAYER_NAME"]s["#MAX_PLAYER_NAME"]",FirstName,LastName);