Announce Help
#4

Quote:
Originally Posted by blackwave
View Post
Here's one basic:
pawn Code:
if(strcmp(cmd, "/announce", true) == 0)
    {
                new cmd[128], idx;
                cmd = strtok(cmdtext, idx);
                new tmp[256],tmp2[256];
                #pragma unused tmp
                #pragma unused tmp2
            #pragma unused idx
        new name[MAX_PLAYER_NAME],string[128];
        GetPlayerName(playerid,name,sizeof(name));
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, 0x00FF40FF, "USAGE: /announce <text>");
        format(string,sizeof(string),"%s: %s",name,cmdtext[10]);
        GameTextForAll(string,2000,5);
        return 1;
                stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

    }
lol full wich errors
Reply


Messages In This Thread
Announce Help - by doreto - 31.12.2010, 10:02
Re: Announce Help - by Haydz - 31.12.2010, 10:10
Re: Announce Help - by blackwave - 31.12.2010, 11:31
Re: Announce Help - by doreto - 31.12.2010, 12:57
Re: Announce Help - by HyperZ - 31.12.2010, 13:37
Re: Announce Help - by blackwave - 31.12.2010, 13:55
Re: Announce Help - by HyperZ - 31.12.2010, 14:00

Forum Jump:


Users browsing this thread: 1 Guest(s)