SA-MP Forums Archive
help in 10-codes - Anak - 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: help in 10-codes - Anak (/showthread.php?tid=442820)



help in 10-codes - Anak - Anak - 09.06.2013

hello guys i have made this

pawn Код:
public OnPlayerText(playerid, text[])
{



    if(!strcmp(text, "10-0", true))
    {

     
    new textv2[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof (name));
    format(textv2, sizeof (textv2), "{FF0000}[%d] {FFFFFF}Caution. (10-0)", playerid);
    SendPlayerMessageToAll(playerid, textv2);
    return 0;
    }
}

so when i type IG "10-0"

this message appears correctly

Код:
Anak [0] Caution. (10-0)
but when i type " 10-0 hey i need help!!" or "hey i need help!! 10-0"

it appears as
Код:
Anak [0] 10-0 hey i need help!!


//or

Anak [0] hey i need help 10-0
but it should be

Код:
Anak [0] Caution. (10-0) hey i need help!!


or 


Anak [0] hey i need help!! Caution. (10-0)
hope you will understand and help me


Re: help in 10-codes - Anak - Anak - 09.06.2013

any help?


Re: help in 10-codes - Anak - Threshold - 09.06.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "10-0", true) == 0)
    {
        new textv2[128], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof (name));
        format(textv2, sizeof (textv2), "{FF0000}[%d] {FFFFFF}Caution. (10-0) %s", playerid, text[5]);
        SendPlayerMessageToAll(playerid, textv2);
        return 0;
    }
}
Give it a shot


Re: help in 10-codes - Anak - Anak - 09.06.2013

thanks


Re: help in 10-codes - Anak - Kyle - 09.06.2013

This is a reallly long way on doing it. I would advise using strreplace...