roleplay - 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: roleplay (
/showthread.php?tid=332740)
roleplay -
johannes95 - 09.04.2012
How to do question mark after the sentence like this
if you do an '?' after the sentence you want see this
''Name asks How are you?'' - See asks
and if you do without '?' you want see this ''Name says Hello'' so if you do '?' says want change to asks
Sorry im from belgium and my english is bad
Re: roleplay -
Reklez - 09.04.2012
pawn Код:
new string[120], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(strfind(text, "How are you?", false) != 1)
{
format(string, sizeof(string), "%s asks How are you", pname);
SendClientMessageToAll(-1, string);
}
Re: roleplay -
johannes95 - 09.04.2012
I don't mean that it was a example what i mean is:
if you do always an ? after a sentence you want see this *example* 'Name asks you sell that car?'
and if you do without ? you want see *example* 'Name says you sell that car'
Re: roleplay -
Shabi RoxX - 09.04.2012
Here you have , enjoy :
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[120], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(strfind(text, "?", true) == -1 )
{
format(string, sizeof(string), "%s asks %s", pname,text);
SendClientMessageToAll(-1, string);
}
else
{
format(string, sizeof(string), "%s says %s", pname,text);
SendClientMessageToAll(-1, string);
}
return 0;
}