help in 10-codes - Anak
#1

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

any help?
Reply
#3

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

thanks
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)