Drunk Talk - 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: Drunk Talk (
/showthread.php?tid=297642)
Drunk Talk -
MatheusMCardoso - 16.11.2011
Hi, im trying to make a script that when you are drunk you talk like: Hi, I'm *Derp* Daniel, How *Hurr* Are You? *Herp.*
Input: I'm Daniel, How Are You?
Output: Hi, I'm *Derp* Daniel, How *Hurr* Are You? *Herp.*
it would be something like:
public OnPlayerText(playerid, text[])
{
if(GetPlayerDrunkLevel(playerid) > 1999)
{
//Split, Format, etc, etc...
}
}
but i have no idea how to do it correctly.
any help will be appreciated.
Re: Drunk Talk -
MP2 - 16.11.2011
Use a for() loop to go through the text and replace the 2nd/3rd spaces with " %s"
Re: Drunk Talk -
MatheusMCardoso - 16.11.2011
ill try it, but i dont know how to get the size of text[], do i need to search for each " " or theres an easier way?