roleplay
#1

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
Reply
#2

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);
}
Reply
#3

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'
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)