SA-MP Forums Archive
Get firstname state then do something - 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: Get firstname state then do something (/showthread.php?tid=592721)



Get firstname state then do something - IvannGates - 29.10.2015

What is the code to get the playername state after the send some message in chat. (OnPlayerText)

Like if your name is Firstname only instead of Firstname_Lastname, will do something.

Instance:
My Name in game is: Gates
i typed on normal chat, i chat then do something with the text.


Re: Get firstname state then do something - IvannGates - 30.10.2015

Quick Up!


Re: Get firstname state then do something - PrO.GameR - 30.10.2015

You don't make any sense
if you want someone's first name (assuming you use the usual Firstname_Lastname ), loop thru string's chars, check if it matches _, if it does, strmid from 0 to that character into some string variable, and show it.
if thats not what you want, then use WORDS to describe what you want, not quick up