Aiuto Pawno

Textdraw

« Older   Newer »
 
  Share  
.
  1. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    Salve ragazzi, quando un utente crasha per questo:

    If you use color codes (such as ~R~ ~G~) beyond 255th character the client will crash trying to display the textdraw.

    Come possibile risolvere in GM???
     
    .
  2.     +1   -1
     
    .
    Avatar

    Senior Member

    Group
    Owners
    Posts
    18,167
    Reputazione
    +4,067
    Location
    San Siro

    Status
    Anonymous
    Poi fare tipo:

    if(strlen(inputtext o params o altro) > 255 && strfind(inputtext o params o altro, "~", true) != -1)) return SendClientMessage(playerid,-1,"Non puoi processare questo cmd");

    Ovviamente dove ho detto "inputtext o params o altro" si intende che devi mettere la stringa che vuoi checkare
     
    .
  3. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    puoi spiegarmi meglio come funziona? che funzione ha?
     
    .
  4.     +1   -1
     
    .
    Avatar

    Senior Member

    Group
    Owners
    Posts
    18,167
    Reputazione
    +4,067
    Location
    San Siro

    Status
    Anonymous
    Strlen ti calcola la lunghezza della string, mentre strfind cerca una determinata parola o stringa in una altra stringa.

    Quindi così se la stringa dell'announce contiene più di 255 e la tilde allora non ti processa il comando
     
    .
  5. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    e lo dovrei mettere in ogni textdraw?
     
    .
  6.     +1   -1
     
    .
    Avatar

    Senior Member

    Group
    Owners
    Posts
    18,167
    Reputazione
    +4,067
    Location
    San Siro

    Status
    Anonymous
    Se vuoi fare una textdraw editabile tramite comando sì, altrimenti evita semplicemente di superare i 255 caratteri per TextDraw
     
    .
  7. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    il problema e che non ho capito che significa appunto questa cosa dei 255 caratteri! a cosa si riferisce? a quali caratteri?
     
    .
  8.     +1   -1
     
    .
    Avatar

    Senior Member

    Group
    Owners
    Posts
    18,167
    Reputazione
    +4,067
    Location
    San Siro

    Status
    Anonymous
    Ti calcola sostanzialmente la lunghezza della stringa, spazi inclusi. Esempio: "mi piacciono i treni xdd ~r~LOL" sono 31 caratteri
     
    .
  9. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    ma il limite di 255 e per ogni textdraw o 255 caratteri in tutto per le textdraw??
     
    .
  10.     +1   -1
     
    .
    Avatar

    Senior Member

    Group
    Owners
    Posts
    18,167
    Reputazione
    +4,067
    Location
    San Siro

    Status
    Anonymous
    Ovviamente è 255 per td
     
    .
  11. Mr.Giovanni96
        +1   -1
     
    .

    User deleted


    grazie tante!
     
    .
10 replies since 3/3/2015, 15:28   159 views
  Share  
.
Top