strlower
#10

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
With your code, it gives me spaces instead of litters
test code:
pawn Код:
public OnPlayerText(playerid, text[])
{
    SendClientMessage(playerid, -1, strlower(text));
    return 0;
}
stock strlower(string[])
{
    for(new i; i<strlen(string); i++) string[i] = tolower(string[i]);

    return string;
}
Those work, tested, one returns the string and one doesn't.
pawn Код:
#define strlower(%1)        for(new i; i<strlen(%1); i++) %1[i] = tolower(%1[i])

public OnPlayerText(playerid, text[])
{
    strlower(text);
    return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    SendClientMessage(playerid, -1, strlower(text));
    return 0;
}
stock strlower(string[])
{
    new tempstring[MAX_PLAYER_NAME];

    for(new i; i<strlen(string); i++) tempstring[i] = tolower(string[i]);

    return tempstring;
}
Third code worked

Thank you very very much, bro

You are the best

rep++;
Reply


Messages In This Thread
strlower - by ATGOggy - 19.01.2015, 12:02
Re: strlower - by Banana_Ghost - 19.01.2015, 12:12
Re: strlower - by Misiur - 19.01.2015, 12:32
Re: strlower - by ATGOggy - 19.01.2015, 12:38
Re: strlower - by nezo2001 - 19.01.2015, 13:15
Re: strlower - by ATGOggy - 19.01.2015, 15:00
Re: strlower - by xVIP3Rx - 19.01.2015, 15:20
Re: strlower - by Misiur - 19.01.2015, 15:49
Re: strlower - by ATGOggy - 20.01.2015, 10:32
Re: strlower - by ATGOggy - 20.01.2015, 10:39

Forum Jump:


Users browsing this thread: 2 Guest(s)