How to make a /follow [ID]
#3

pawn Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
    new
        cmd[ 128 ],
        tmp[ 128 ],
        idx
    ;
   
    cmd = strtok( cmdtext, idx );
   
    if( !strcmp( cmd, "/follow", true ) )
    {
        tmp = strtok( cmdtext, idx );

        if( !strlen( tmp ) )
            return SendClientMessage( playerid, -1, "USAGE: /follow [playerid]" );

        SetPlayerMarkerForPlayer( playerid, strval( tmp ), 0xFF0000FF );
       
        return 1;
    }
   
    return 0;
}
pawn Код:
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;
}
Reply


Messages In This Thread
How to make a /follow [ID] - by F9 - 22.02.2012, 15:35
Re: How to make a /follow [ID] - by Vince - 22.02.2012, 15:38
Re: How to make a /follow [ID] - by Toreno - 22.02.2012, 15:41
Re: How to make a /follow [ID] - by Jochemd - 22.02.2012, 15:48
Re: How to make a /follow [ID] - by Toreno - 22.02.2012, 15:53

Forum Jump:


Users browsing this thread: 1 Guest(s)